diff options
author | rillig <rillig> | 2006-02-28 15:25:44 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-02-28 15:25:44 +0000 |
commit | 6ca9c77ed9945d5b7d81c89a2c8f2bcafafa0c9f (patch) | |
tree | 269abcf519ceb91b5614f6b202c3ef13a395e96e /pkgtools | |
parent | d397eb2d489795960bc320c1f0801096795356d5 (diff) | |
download | pkgsrc-6ca9c77ed9945d5b7d81c89a2c8f2bcafafa0c9f.tar.gz |
- Added the -Wstyle command line option, which enables warnings that don't
affect the build process but are of more stylistic nature.
- Enabled the warnings on missing explanatory comments for patch files when
-Wstyle is enabled.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.0 | 5 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.1 | 6 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 16 |
3 files changed, 19 insertions, 8 deletions
diff --git a/pkgtools/pkglint/files/pkglint.0 b/pkgtools/pkglint/files/pkglint.0 index e6ad3c448b2..7c000260b5b 100644 --- a/pkgtools/pkglint/files/pkglint.0 +++ b/pkgtools/pkglint/files/pkglint.0 @@ -120,6 +120,9 @@ DDEESSCCRRIIPPTTIIOONN [[nnoo--]]ssppaaccee Emit notes for inconsistent use of white-space. + [[nnoo--]]ssttyyllee Warn for stylistic issues that don't affect the build + process. + [[nnoo--]]ttyyppeess Warn for some _M_a_k_e_f_i_l_e variables if their assigned values do not match their type. @@ -167,4 +170,4 @@ BBUUGGSS If you don't understand the messages, feel free to ask on the <tech-pkg@NetBSD.org> mailing list. -NetBSD 3.0 February 18, 2006 NetBSD 3.0 +pkgsrc February 18, 2006 pkgsrc diff --git a/pkgtools/pkglint/files/pkglint.1 b/pkgtools/pkglint/files/pkglint.1 index 6d0eae232f6..1c6a07d2c73 100644 --- a/pkgtools/pkglint/files/pkglint.1 +++ b/pkgtools/pkglint/files/pkglint.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkglint.1,v 1.37 2006/02/18 16:12:13 rillig Exp $ +.\" $NetBSD: pkglint.1,v 1.38 2006/02/28 15:25:44 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>. @@ -7,7 +7,7 @@ .\" Roland Illig <roland.illig@gmx.de>, 2004, 2005. .\" Roland Illig <rillig@NetBSD.org>, 2005, 2006. .\" -.Dd February 18, 2006 +.Dd February 28, 2006 .Dt PKGLINT 1 .Sh NAME .Nm pkglint @@ -150,6 +150,8 @@ Warn for possibly invalid quoting of make variables in shell programs and shell variables themselves. .It Cm [no-]space Emit notes for inconsistent use of white-space. +.It Cm [no-]style +Warn for stylistic issues that don't affect the build process. .It Cm [no-]types Warn for some .Pa Makefile diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 1e796a46b63..c1c631c8d52 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.537 2006/02/28 00:20:23 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.538 2006/02/28 15:25:44 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -1171,6 +1171,7 @@ my $opt_warn_plist_depr = false; my $opt_warn_plist_sort = false; my $opt_warn_quoting = false; my $opt_warn_space = false; +my $opt_warn_style = false; my $opt_warn_types = true; my $opt_warn_varorder = false; my (%warnings) = ( @@ -1182,6 +1183,7 @@ my (%warnings) = ( "plist-sort" => [\$opt_warn_plist_sort, "warn about unsorted entries in PLISTs"], "quoting" => [\$opt_warn_quoting, "warn about quoting issues"], "space" => [\$opt_warn_space, "warn about inconsistent use of white-space"], + "style" => [\$opt_warn_style, "warn about stylistic issues"], "types" => [\$opt_warn_types, "do some simple type checking in Makefiles"], "varorder" => [\$opt_warn_varorder, "warn about the ordering of variables"], ); @@ -4257,10 +4259,14 @@ sub checkfile_patch($) { }], [PST_CENTER, re_patch_empty, PST_TEXT, sub() { # }], [PST_TEXT, re_patch_cfd, PST_CFA, sub() { - #$seen_comment or $line->log_warning("Comment expected."); + if (!$seen_comment) { + $opt_warn_style and $line->log_warning("Comment expected."); + } $line->log_warning("Please use unified diffs (diff -u) for patches."); }], [PST_TEXT, re_patch_ufd, PST_UFA, sub() { - #$seen_comment or $line->log_warning("Comment expected."); + if (!$seen_comment) { + $opt_warn_style and $line->log_warning("Comment expected."); + } }], [PST_TEXT, re_patch_text, PST_TEXT, sub() { $seen_comment = true; }], [PST_TEXT, re_patch_empty, PST_TEXT, sub() { @@ -4271,14 +4277,14 @@ sub checkfile_patch($) { if ($seen_comment) { $opt_warn_space and $line->log_note("Empty line expected."); } else { - #$line->log_warning("Comment expected."); + $opt_warn_style and $line->log_warning("Comment expected."); } $line->log_warning("Please use unified diffs (diff -u) for patches."); }], [PST_CENTER, re_patch_ufd, PST_UFA, sub() { if ($seen_comment) { $opt_warn_space and $line->log_note("Empty line expected."); } else { - #$line->log_warning("Comment expected."); + $opt_warn_style and $line->log_warning("Comment expected."); } }], [PST_CENTER, undef, PST_TEXT, sub() { $opt_warn_space and $line->log_note("Empty line expected."); |