Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Dec 2022 14:24:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 268640] ports-mgmt/portlint: reported line numbers are sometimes wrong
Message-ID:  <bug-268640-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268640

            Bug ID: 268640
           Summary: ports-mgmt/portlint: reported line numbers are
                    sometimes wrong
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: marcus@FreeBSD.org
          Reporter: vidar@karlsen.tech
             Flags: maintainer-feedback?(marcus@FreeBSD.org)
          Assignee: marcus@FreeBSD.org

I have noticed that portlint sometimes reports the wrong line numbers for
warnings and errors.
Below, I have inserted errors into a port's Makefile to demonstrate how it =
gets
reported by portlint.


Putting a !=3D on line 15, portlint says it is on line 13:
# grep -n THIS Makefile
15:TRYTHIS!=3D    echo

# portlint
WARN: Makefile: [13]: use of !=3D in assignments is almost never a good thi=
ng to
do.  Try to avoid using them.  See
http://lists.freebsd.org/pipermail/freebsd-ports/2008-July/049777.html for =
some
helpful hints on what to do instead.
WARN: Makefile: [13]: possible direct use of command "echo" found. use
${ECHO_CMD} or ${ECHO_MSG} instead.
0 fatal errors and 2 warnings found.


Putting some trailing whitespaces on line 13, portlint gets the whitespaces
right, but thinks the !=3D is on the same line:
# grep -n "   " Makefile
13:USES=3D                gmake tar:tgz   <-- three whitespaces at the end =
of the
line here

# portlint
WARN: Makefile: [13]: whitespace before end of line.
WARN: Makefile: [13]: use of !=3D in assignments is almost never a good thi=
ng to
do.  Try to avoid using them.  See
http://lists.freebsd.org/pipermail/freebsd-ports/2008-July/049777.html for =
some
helpful hints on what to do instead.
WARN: Makefile: [13]: possible direct use of command "echo" found. use
${ECHO_CMD} or ${ECHO_MSG} instead.
0 fatal errors and 3 warnings found.


Adding another variable above the !=3D line, portlint now thinks the !=3D i=
s on
line 15 while it should say 16:
# egrep -n "THIS|SOMEOTHER|   " Makefile
13:USES=3D                gmake tar:tgz=20=20=20
15:SOMEOTHER=3D   1
16:TRYTHIS!=3D    echo

# portlint
WARN: Makefile: [13]: whitespace before end of line.
WARN: Makefile: [15]: use of !=3D in assignments is almost never a good thi=
ng to
do.  Try to avoid using them.  See
http://lists.freebsd.org/pipermail/freebsd-ports/2008-July/049777.html for =
some
helpful hints on what to do instead.
WARN: Makefile: [15]: possible direct use of command "echo" found. use
${ECHO_CMD} or ${ECHO_MSG} instead.
0 fatal errors and 3 warnings found.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-268640-7788>