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

lintian: r683 - in trunk: checks debian testset/debconf/debian



Author: rra
Date: 2006-06-25 05:31:54 +0200 (Sun, 25 Jun 2006)
New Revision: 683

Modified:
   trunk/checks/debconf
   trunk/checks/debconf.desc
   trunk/debian/changelog
   trunk/testset/debconf/debian/debconf-test.templates
Log:
  + [RA] Exclude debconf templates with "for internal use" in the short
    description from style checks and document this in the log
    description of the tags most likely to trigger on internal
    templates.  (Closes: #368206)

Modified: trunk/checks/debconf
===================================================================
--- trunk/checks/debconf	2006-06-21 20:57:16 UTC (rev 682)
+++ trunk/checks/debconf	2006-06-25 03:31:54 UTC (rev 683)
@@ -230,65 +230,68 @@
     }
 
     # Check the description against the best practices in the Developer's
-    # Reference.
+    # Reference, but skip all templates where the short description contains
+    # the string "for internal use".
     $template->{description} =~ m/^([^\n]*)\n(.*)$/s;
     my ($short, $extended) = ($1, $2);
     unless (defined $short) {
 	$short = $template->{description};
     }
-    my $isprompt = grep { $_ eq $template->{type} } qw(string select password multiselect);
-    if ($isprompt) {
-	if ($short !~ m/:$/) {
-	    tag "malformed-prompt-in-templates", $template->{template};
+    unless ($short =~ /for internal use/i) {
+	my $isprompt = grep { $_ eq $template->{type} } qw(string select password multiselect);
+	if ($isprompt) {
+	    if ($short !~ m/:$/) {
+		tag "malformed-prompt-in-templates", $template->{template};
+	    }
+	    if ($short =~ /^(Please|Cho+se|Enter|Select|Specify|Give)/) {
+		tag "using-imperative-form-in-templates", $template->{template};
+	    }
 	}
-	if ($short =~ /^(Please|Cho+se|Enter|Select|Specify|Give)/) {
-	    tag "using-imperative-form-in-templates", $template->{template};
+	if ($template->{type} eq 'boolean') {
+	    if ($short !~ /\?/) {
+		tag "malformed-question-in-templates", $template->{template};
+	    }
+	    if (defined ($extended) && $extended =~ /\?/) {
+		tag "using-question-in-extended-description-in-templates", $template->{template};
+	    }
 	}
-    }
-    if ($template->{type} eq 'boolean') {
-	if ($short !~ /\?/) {
-	    tag "malformed-question-in-templates", $template->{template};
+	if ($template->{type} eq 'note') {
+	    if ($short =~ /[.?;:]$/) {
+		tag "malformed-title-in-templates", $template->{template};
+	    }
 	}
-	if (defined ($extended) && $extended =~ /\?/) {
-	    tag "using-question-in-extended-description-in-templates", $template->{template};
+	if (length ($short) > 75) {
+	    tag "too-long-short-description-in-templates", $template->{template};
 	}
-    }
-    if ($template->{type} eq 'note') {
-	if ($short =~ /[.?;:]$/) {
-	    tag "malformed-title-in-templates", $template->{template};
+	if ($template->{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us) /) {
+	    tag "using-first-person-in-templates", $template->{template};
 	}
-    }
-    if (length ($short) > 75) {
-	tag "too-long-short-description-in-templates", $template->{template};
-    }
-    if ($template->{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us) /) {
-	tag "using-first-person-in-templates", $template->{template};
-    }
-    if ($template->{description} =~ /[ \'\"]([Yy]es)[ \'\",.]/) {
-	tag "making-assumptions-about-interfaces-in-templates", $template->{template};
-    }
+	if ($template->{description} =~ /[ \'\"]([Yy]es)[ \'\",.]/) {
+	    tag "making-assumptions-about-interfaces-in-templates", $template->{template};
+	}
 
-    # Check whether the extended description is too long.
-    if ($extended) {
-	my $lines = 0;
-	for my $string (split ("\n", $extended)) {
-	    while (length ($string) > 80) {
-		my $pos = rindex ($string, ' ', 80);
-		if ($pos == -1) {
-		    $pos = index ($string, ' ');
+	# Check whether the extended description is too long.
+	if ($extended) {
+	    my $lines = 0;
+	    for my $string (split ("\n", $extended)) {
+		while (length ($string) > 80) {
+		    my $pos = rindex ($string, ' ', 80);
+		    if ($pos == -1) {
+			$pos = index ($string, ' ');
+		    }
+		    if ($pos == -1) {
+			$string = '';
+		    } else {
+			$string = substr ($string, $pos + 1);
+			$lines++;
+		    }
 		}
-		if ($pos == -1) {
-		    $string = '';
-		} else {
-		    $string = substr ($string, $pos + 1);
-		    $lines++;
-		}
+		$lines++;
 	    }
-	    $lines++;
+	    if ($lines > 20) {
+		tag "too-long-extended-description-in-templates", $template->{template};
+	    }
 	}
-	if ($lines > 20) {
-	    tag "too-long-extended-description-in-templates", $template->{template};
-	}
     }
 }
 

Modified: trunk/checks/debconf.desc
===================================================================
--- trunk/checks/debconf.desc	2006-06-21 20:57:16 UTC (rev 682)
+++ trunk/checks/debconf.desc	2006-06-25 03:31:54 UTC (rev 683)
@@ -193,6 +193,9 @@
  debconf template is a prompt and not a title. Avoid question style
  prompts ("IP Address?") in favour of "opened" prompts ("IP address:").
  The use of colons is recommended.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
 Ref: devref 6.5.4.2
 
 Tag: malformed-title-in-templates
@@ -208,12 +211,18 @@
  phrased in the form of a question which should be kept short and should
  generally end with a question mark. Terse writing style is permitted and
  even encouraged if the question is rather long.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
 Ref: devref 6.5.4.2.2
 
 Tag: using-question-in-extended-description-in-templates
 Type: warning
 Info: The extended description of a boolean debconf template should not
  include a question.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
 Ref: devref 6.5.4.2.2
 
 Tag: using-imperative-form-in-templates
@@ -229,6 +238,9 @@
  "We recommend..."). The computer is not a person and the Debconf
  templates do not speak for the Debian developers. You should use neutral
  construction and often the passive form.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
 Ref: devref 6.5.2.5
 
 Tag: making-assumptions-about-interfaces-in-templates

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-06-21 20:57:16 UTC (rev 682)
+++ trunk/debian/changelog	2006-06-25 03:31:54 UTC (rev 683)
@@ -3,6 +3,10 @@
   * checks/debconf:
     + [JvW] Teach lintian to know about the 'error' debconf template
       question type. (Closes: #374399)
+    + [RA] Exclude debconf templates with "for internal use" in the short
+      description from style checks and document this in the log
+      description of the tags most likely to trigger on internal
+      templates.  (Closes: #368206)
   * checks/fields:
     + [RA] Allow build-depend on quilt if clean depends on the xsfclean
       rule, for packages maintained by the X Strike Force.
@@ -24,7 +28,7 @@
     + [RA] Don't consider templates.in to be a stray translated template
       file.  Thanks, Thomas Huriaux.  (Closes: #367534)
 
- -- Russ Allbery <rra@debian.org>  Wed, 21 Jun 2006 13:53:06 -0700
+ -- Russ Allbery <rra@debian.org>  Sat, 24 Jun 2006 20:26:24 -0700
 
 lintian (1.23.21) unstable; urgency=low
 

Modified: trunk/testset/debconf/debian/debconf-test.templates
===================================================================
--- trunk/testset/debconf/debian/debconf-test.templates	2006-06-21 20:57:16 UTC (rev 682)
+++ trunk/testset/debconf/debian/debconf-test.templates	2006-06-25 03:31:54 UTC (rev 683)
@@ -47,3 +47,9 @@
 _Description: Select one of these:
  I am a stupid test of first-person syntax that tells you to select yes
  even though yes isn't an option in this prompt.
+
+Template: debconf/internal
+Type: boolean
+Description: For internal use only
+ We are testing that style checks are not applied to templates that are
+ marked as internal.



Reply to: