This is an automated email from the git hooks/post-receive script. lamby pushed a commit to branch master in repository lintian.
commit e19c3b1343c76db16778b89d1129cdfdda55cd4c Author: Chris Lamb <[email protected]> Date: Wed Feb 21 15:54:10 2018 +0000 Warn about changelog files that are too short. Thanks to Adrian Bunk for the suggestion. (Closes: #890920) --- checks/changelog-file.desc | 22 ++++++++++++++++++++++ checks/changelog-file.pm | 5 ++++- debian/changelog | 3 +++ .../debian/debian/changelog.in | 14 ++++++++++++++ t/tests/changelog-file-line-too-short/desc | 8 ++++++++ t/tests/changelog-file-line-too-short/tags | 4 ++++ 6 files changed, 55 insertions(+), 1 deletion(-) diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc index 1dff2df..2acb75a 100644 --- a/checks/changelog-file.desc +++ b/checks/changelog-file.desc @@ -351,6 +351,28 @@ Info: The given line of the latest changelog entry is over 80 columns. messages and be annoying to read. Please wrap changelog entries at 80 columns or less where possible. +Tag: debian-changelog-line-too-short +Severity: pedantic +Certainty: possible +Info: The given line of the latest changelog entry appears to contain a + very terse entry. + . + This can make it hard for others to understand the changelog entry. + Please keep in mind that: + . + * It is not uncommon that people read changelog entries that are more + than a decade old to understand why a change was made or why a + package works in a specific way. + * Many users will read the changelog via + <tt>apt-listchanges(1)</tt> + * The information in <tt>debian/changelog</tt> is permanent. + . + Examples for too short entries include "dh 11" or simply "R³" - these + could be expanded to, for example: + . + * Switch to debhelper compat 11. + * Rules-Requires-Root: no + Tag: changelog-news-debian-mismatch Severity: normal Certainty: possible diff --git a/checks/changelog-file.pm b/checks/changelog-file.pm index 210d75e..7dd61c9 100644 --- a/checks/changelog-file.pm +++ b/checks/changelog-file.pm @@ -482,9 +482,12 @@ sub run { # length check. my @lines = split("\n", decode('utf-8', $changes)); for my $i (0 .. $#lines) { + my $line = $i + $chloff; + tag 'debian-changelog-line-too-short', $1, "(line $line)" + if $lines[$i] =~ /^ [*]\s(.{1,5})$/; if (length($lines[$i]) > 81 and $lines[$i] !~ /^[\s.o*+-]*(?:[Ss]ee:?\s+)?\S+$/) { - tag 'debian-changelog-line-too-long', 'line ' . ($i + $chloff); + tag 'debian-changelog-line-too-long', "line $line"; } } diff --git a/debian/changelog b/debian/changelog index 9641dd3..383fe46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ lintian (2.5.76) UNRELEASED; urgency=medium of "header" terminology (versus "field", etc.) in descriptions and tag names. Thanks! (Closes: #890959) + * checks/changelog-file.{desc,pm}: + + [CL] Warn about changelog files that are too short. Thanks to Adrian + Bunk for the suggestion. (Closes: #890920) * checks/cruft.pm: + [CL] Avoid false-positives in Jush's syntax highlighting definition files. diff --git a/t/tests/changelog-file-line-too-short/debian/debian/changelog.in b/t/tests/changelog-file-line-too-short/debian/debian/changelog.in new file mode 100644 index 0000000..2ba39b5 --- /dev/null +++ b/t/tests/changelog-file-line-too-short/debian/debian/changelog.in @@ -0,0 +1,14 @@ +{$source} ({$version}) unstable; urgency=low + + * Suppress "should close ITP bug" messages. (Closes: #123456) + + * The following lines are too short. + * R³ + * dh 11 + * 12345 + + * The following entries are long enough. + * dh 11. + * 123456 + + -- {$author} {$date} diff --git a/t/tests/changelog-file-line-too-short/desc b/t/tests/changelog-file-line-too-short/desc new file mode 100644 index 0000000..1cc7733 --- /dev/null +++ b/t/tests/changelog-file-line-too-short/desc @@ -0,0 +1,8 @@ +Testname: changelog-file-line-too-short +Type: non-native +Options: --pedantic +Skeleton: pedantic +Version: 1.0-1 +Description: Test for short changelog entries +Test-For: + debian-changelog-line-too-short diff --git a/t/tests/changelog-file-line-too-short/tags b/t/tests/changelog-file-line-too-short/tags new file mode 100644 index 0000000..18a368b --- /dev/null +++ b/t/tests/changelog-file-line-too-short/tags @@ -0,0 +1,4 @@ +P: changelog-file-line-too-short source: debian-watch-does-not-check-gpg-signature +P: changelog-file-line-too-short: debian-changelog-line-too-short 12345 (line 8) +P: changelog-file-line-too-short: debian-changelog-line-too-short R³ (line 6) +P: changelog-file-line-too-short: debian-changelog-line-too-short dh 11 (line 7) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git

