[BACK]Return to pkglint.1 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkglint / files

File: [cvs.NetBSD.org] / pkgsrc / pkgtools / pkglint / files / pkglint.1 (download)

Revision 1.60, Sun Dec 8 00:06:38 2019 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.59: +0 -0 lines

pkgtools/pkglint: update to 19.3.14

Changes since 19.3.13:

When pkglint suggests to replace !empty(VARNAME:Mfixed) with ${VARNAME}
== fixed, the exact suggested expression is now part of the diagnostic.
The check and the autofix have been improved. They now apply only to the
last modifier in the whole chain, everything else was a bug in pkglint.

Pkglint now knows the scope of variables better than before. It knows
the difference between variables from <sys.mk> like MACHINE_ARCH, which
are always in scope, and those from mk/defaults/mk.conf, which only come
into scope later, after bsd.prefs.mk has been included. It warns when
variables are used too early, for example in .if conditions.

The pathnames in ALTERNATIVES files are now checked for absolute
pathnames. This mistake doesn't happen in practice, but the code for
converting the different path types internally made it necessary to add
these checks. At least this prevents typos.

The special check for obsolete licenses has been removed since their
license files have been removed and that is checked as well.

Variables named *_AWK may be appended to.

The variables _PKG_SILENT and _PKG_DEBUG are no longer deprecated, they
are obsolete now. They are not used in main pkgsrc and pkgsrc-wip

When a package sets a default value for a user-settable variable (which
is something that should not happen anyway), it should .include
bsd.prefs.mk before, in order to not accidentally overwrite the
user-specified value.

Variable modifiers of the form :from=to are now parsed like in bmake.
They are greedy and eat up any following colons as well. This means that
${VAR:.c=.o:Q} replaces source.c with source.o:Q, instead of quoting it.
Pkglint now warns about such cases.

The handling of relative paths in diagnostics is now consistent. All
paths that are part of a diagnostic are relative to the line that issues
the diagnostic.

Fatal errors are no longer suppressed in --autofix mode.

Plus lots of refactoring, to prevent accidental mixing of incompatible
relative paths.

.\"	$NetBSD: pkglint.1,v 1.60 2019/12/08 00:06:38 rillig Exp $
.\"	From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
.\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun@itojun.org>.
.\" All Rights Reserved.  Absolutely no warranty.
.\" Roland Illig <roland.illig@gmx.de>, 2004, 2005.
.\" Thomas Klausner <wiz@NetBSD.org>, 2012.
.\" Roland Illig <rillig@NetBSD.org>, 2015-2019.
.Dd November 30, 2019
.Nm pkglint
.Nd static analyzer for pkgsrc packages
.Nm pkglint
.Op Fl options
.Op Ar dir ...
attempts to detect features of the named pkgsrc packages that are likely
to be bugs, or that are simply deprecated.
.\" =======================================================================
.Ss Options
.Bl -tag -width 18n
.It Fl C{[no-]check,...}
Enable or disable specific checks.
For a list of checks, see below.
.It Fl d Ns | Ns Fl -debug
Enable or disable verbose log for debugging pkglint.
.It Fl e Ns | Ns Fl -explain
Print verbose explanations for diagnostics.
.It Fl F Ns | Ns Fl -autofix
Repair some of the warnings automatically.
.It Fl g Ns | Ns Fl -gcc-output-format
Use a format for the diagnostics that is understood by most programs,
especially editors, so they can provide a point-and-goto interface.
.It Fl h Ns | Ns Fl -help
Show the summary of command line options, then exit.
.It Fl I
Show the
.Pa Makefile
that is constructed by including all the files that
are slurped in via
.Ql .include
This flag is mainly for debugging.
.It Fl i Ns | Ns Fl -import
Check if a package is ready to be imported into pkgsrc.
This is especially useful for packages from the pkgsrc-wip project.
.It Fl o Ns | Ns Fl -only Ar substring
Only handle those diagnostics that have
.Ar substring
in their text.
This is useful in combination with
.Fl -autofix
.Fl -recursive,
to fix only a single kind of warning in a large number of files.
.It Fl q Ns | Ns Fl -quiet
Don't print the errors and warnings summary before terminating.
.It Fl r Ns | Ns Fl -recursive
Check subdirectories, too.
The subdirectories are those that are mentioned in a
.It Fl s Ns | Ns Fl -source
For all diagnostics having file and line number information, show the
source code along with the diagnostics.
This is especially useful together with the
.Fl f Ns | Ns Fl -show-autofix
.It Fl V Ns | Ns Fl -version
Print the current
version number and exit.
.It Fl W{[no-]warn,...}
Enable or disable specific warnings.
For a list of warnings, see below.
.\" =======================================================================
.Ss Checks
.Bl -tag -width 18n
.It Cm all
Enable all checks.
.It Cm none
Disable all checks.
.It Cm [no-]global
Check inter-package consistency for distfile hashes and used licenses.
.\" =======================================================================
.Ss Warnings
.Bl -tag -width 18n
.It Cm all
Enable all warnings.
.It Cm none
Disable all warnings.
.It Cm [no-]extra
Emit some additional warnings that are not enabled by default.
.It Cm [no-]perm
Warn if a variable is used or modified outside its specified scope.
.It Cm [no-]quoting
Warn for possibly invalid quoting of make variables in shell programs
and shell variables themselves.
.\" =======================================================================
.Ss Other arguments
.Bl -tag -width 18n -offset indent
.It Ar dir ...
The pkgsrc directories to be checked.
If omitted, the current directory is checked.
.Bl -tag -width pkgsrc/mk/* -compact
.It Pa pkgsrc/mk/*
Files from the pkgsrc infrastructure.
.Bl -tag -width Fl
.It Ic pkglint \&.
Checks the package in the current directory.
.It Ic pkglint \-Wall /usr/pkgsrc/devel
Checks the category Makefile and reports any warnings it can find.
Diagnostics are written to the standard output.
.Bl -tag -width "WARN: foobaa"
.It ERROR: ...
Errors should be fixed before a package is committed to pkgsrc.
.It WARN: ...
Warnings generally should be fixed, but they are not as critical as
.An Roland Illig Aq Mt rillig@NetBSD.org
If you don't understand the messages, feel free to ask the author or
on the
.Aq pkgsrc-users@pkgsrc.org
mailing list.