pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Added the -Wstyle command lin...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e75dcaa6aa08
branches:  trunk
changeset: 508927:e75dcaa6aa08
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Feb 28 15:25:44 2006 +0000

description:
- 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:

 pkgtools/pkglint/files/pkglint.0  |   5 ++++-
 pkgtools/pkglint/files/pkglint.1  |   6 ++++--
 pkgtools/pkglint/files/pkglint.pl |  16 +++++++++++-----
 3 files changed, 19 insertions(+), 8 deletions(-)

diffs (106 lines):

diff -r b40b70f787a4 -r e75dcaa6aa08 pkgtools/pkglint/files/pkglint.0
--- a/pkgtools/pkglint/files/pkglint.0  Tue Feb 28 15:21:09 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.0  Tue Feb 28 15:25:44 2006 +0000
@@ -120,6 +120,9 @@
 
      [[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 @@
      If you don't understand the messages, feel free to ask on the
      <tech-pkg%NetBSD.org@localhost> mailing list.
 
-NetBSD 3.0                     February 18, 2006                    NetBSD 3.0
+pkgsrc                         February 18, 2006                        pkgsrc
diff -r b40b70f787a4 -r e75dcaa6aa08 pkgtools/pkglint/files/pkglint.1
--- a/pkgtools/pkglint/files/pkglint.1  Tue Feb 28 15:21:09 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.1  Tue Feb 28 15:25:44 2006 +0000
@@ -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@localhost>.
@@ -7,7 +7,7 @@
 .\" Roland Illig <roland.illig%gmx.de@localhost>, 2004, 2005.
 .\" Roland Illig <rillig%NetBSD.org@localhost>, 2005, 2006.
 .\"
-.Dd February 18, 2006
+.Dd February 28, 2006
 .Dt PKGLINT 1
 .Sh NAME
 .Nm pkglint
@@ -150,6 +150,8 @@
 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 -r b40b70f787a4 -r e75dcaa6aa08 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Feb 28 15:21:09 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Feb 28 15:25:44 2006 +0000
@@ -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_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 @@
        "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 @@
                }], [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 @@
                        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.");



Home | Main Index | Thread Index | Old Index