This is an automated email from the git hooks/post-receive script. lamby pushed a commit to branch master in repository lintian.
commit f444db614d4ac4ed4ef24060cb6856fb61b5b631 Author: Chris Lamb <la...@debian.org> Date: Mon Jan 29 09:21:21 2018 +1100 Check for packages that mention planned/upcoming features in their long description. (Closes: #782990) --- checks/description.desc | 12 +++++++++++ checks/description.pm | 8 ++++++++ data/description/planned-features | 8 ++++++++ debian/changelog | 3 +++ .../debian/debian/control.in | 23 ++++++++++++++++++++++ t/tests/description-mentions-planned-features/desc | 7 +++++++ t/tests/description-mentions-planned-features/tags | 6 ++++++ 7 files changed, 67 insertions(+) diff --git a/checks/description.desc b/checks/description.desc index db64e64..a7cef96 100644 --- a/checks/description.desc +++ b/checks/description.desc @@ -244,3 +244,15 @@ Experimental: yes Info: Debian users are likely to look for perl modules by their name, e.g. Foo::Bar, not by package name (libfoo-bar-perl). To make this easier, the main module name should be present in the long package description. + +Tag: description-mentions-planned-features +Severity: wishlist +Certainty: wild-guess +Info: This package appears to mention planned or upcoming features of + the software. + . + Package descriptions should not mention features that not yet implemented + as they waste the time of people searching for particular keywords. They + are also liable to become outdated quickly. + . + Please remove such statements from the package description. diff --git a/checks/description.pm b/checks/description.pm index 8b214fe..6396466 100644 --- a/checks/description.pm +++ b/checks/description.pm @@ -29,11 +29,14 @@ use constant DH_MAKE_PERL_TEMPLATE => 'this description was' use Encode qw(decode); +use Lintian::Data; use Lintian::Check qw(check_spelling check_spelling_picky spelling_tag_emitter); use Lintian::Tags qw(tag); use Lintian::Util qw(strip); +my $PLANNED_FEATURES = Lintian::Data->new('description/planned-features'); + my $SPELLING_ERROR_IN_SYNOPSIS = spelling_tag_emitter('spelling-error-in-description-synopsis'); my $SPELLING_ERROR_IN_DESCRIPTION @@ -153,6 +156,11 @@ sub run { $flagged_homepage = 1; } + foreach my $regex ($PLANNED_FEATURES->all()) { + tag 'description-mentions-planned-features', "(line $lines)" + if m/$regex/i; + } + if (index(lc($_), DH_MAKE_PERL_TEMPLATE) != -1) { tag 'description-contains-dh-make-perl-template'; } diff --git a/data/description/planned-features b/data/description/planned-features new file mode 100644 index 0000000..70c8f14 --- /dev/null +++ b/data/description/planned-features @@ -0,0 +1,8 @@ +# Regular expressions (/i) of "planned features" + +will soon allow +soon will allow +soon will be able +will soon be able +will soon support +soon will support diff --git a/debian/changelog b/debian/changelog index 31b87a3..00a99f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ lintian (2.5.73) UNRELEASED; urgency=medium * checks/cruft.pm: + [CL] When looking for the source of "build/foo/bar.min.js", also check "src/foo/bar.js". (Closes: #832027) + * checks/description.pm: + + [CL] Check for packages that mention planned/upcoming features in + their long description. (Closes: #782990) * checks/fields.{desc,pm}: + [CL] Add a pedantic warning for co-maintained packages that are not managed in a revision control system. (Closes: #884497) diff --git a/t/tests/description-mentions-planned-features/debian/debian/control.in b/t/tests/description-mentions-planned-features/debian/debian/control.in new file mode 100644 index 0000000..21574e6 --- /dev/null +++ b/t/tests/description-mentions-planned-features/debian/debian/control.in @@ -0,0 +1,23 @@ +Source: {$source} +Priority: optional +Section: {$section} +Maintainer: {$author} +Standards-Version: {$standards_version} +Build-Depends: {$build_depends} +Rules-Requires-Root: no + +Package: {$source} +Architecture: {$architecture} +Depends: $\{misc:Depends\} +Description: {$description} + This is a test package designed to exercise some feature or tag of + Lintian. It is part of the Lintian test suite and may do very odd + things. It should not be installed like a regular package. It may + be an empty package. + . + Foo will soon allow something. + Foo soon will allow something. + Foo soon will be able something. + Foo will soon be able something. + Foo will soon support something. + Foo SOON WILL SUPPORT something. diff --git a/t/tests/description-mentions-planned-features/desc b/t/tests/description-mentions-planned-features/desc new file mode 100644 index 0000000..fcea236 --- /dev/null +++ b/t/tests/description-mentions-planned-features/desc @@ -0,0 +1,7 @@ +Testname: description-mentions-planned-features +Version: 1.0 +Skeleton: pedantic +Options: --pedantic -I -E +Description: Test for a packages mentioning upcoming features +Test-For: + description-mentions-planned-features diff --git a/t/tests/description-mentions-planned-features/tags b/t/tests/description-mentions-planned-features/tags new file mode 100644 index 0000000..8a18387 --- /dev/null +++ b/t/tests/description-mentions-planned-features/tags @@ -0,0 +1,6 @@ +I: description-mentions-planned-features: description-mentions-planned-features (line 10) +I: description-mentions-planned-features: description-mentions-planned-features (line 5) +I: description-mentions-planned-features: description-mentions-planned-features (line 6) +I: description-mentions-planned-features: description-mentions-planned-features (line 7) +I: description-mentions-planned-features: description-mentions-planned-features (line 8) +I: description-mentions-planned-features: description-mentions-planned-features (line 9) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git