Package: lintian Version: 2.5.13 This time with tests
From 86c63d58512a20624929ab3d9ad7b0271a6ce50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bast...@gmail.com> Date: Mon, 29 Jul 2013 17:48:20 +0200 Subject: [PATCH] Add test of boilerplate on changelog
--- checks/changelog-file.desc | 8 ++++++++ checks/changelog-file.pm | 14 ++++++++++---- t/tests/generic-dh-make-2005/desc | 1 + t/tests/generic-dh-make-2005/tags | 1 + t/tests/generic-dh-make-2008/desc | 1 + t/tests/generic-dh-make-2008/tags | 1 + 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/checks/changelog-file.desc b/checks/changelog-file.desc index 2c0b6fe..255c73b 100644 --- a/checks/changelog-file.desc +++ b/checks/changelog-file.desc @@ -39,6 +39,14 @@ Info: NEWS.Debian files should be compressed using "gzip -9". The file must always have the same name. Ref: devref 6.3.4 +Tag: changelog-is-dh_make-template +Severity: important +Certainty: certain +Info: dh_make adds the following changelog entry template: + * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> + . + You have not removed the "<... is the bug number ...>" part. + Tag: changelog-not-compressed-with-max-compression Severity: normal Certainty: certain diff --git a/checks/changelog-file.pm b/checks/changelog-file.pm index 72481f5..d97e9d9 100644 --- a/checks/changelog-file.pm +++ b/checks/changelog-file.pm @@ -289,11 +289,17 @@ if (@entries) { # Some checks should only be done against the most recent changelog entry. my $entry = $entries[0]; - if (@entries == 1 and $entry->Version and $entry->Version =~ /-1$/) { - tag 'new-package-should-close-itp-bug' - unless @{ $entry->Closes }; - } my $changes = $entry->Changes || ''; + + if (@entries == 1) { + if($entry->Version and $entry->Version =~ /-1$/) { + tag 'new-package-should-close-itp-bug' + unless @{ $entry->Closes }; + } + if($changes =~ /(?:#?\s*)(?:\d|n)+? is the bug number of your ITP/i) { + tag 'changelog-is-dh_make-template'; + } + } while ($changes =~ /(closes\s*(?:bug)?\#?\s?\d{6,})[^\w]/ig) { tag 'possible-missing-colon-in-closes', $1 if $1; } diff --git a/t/tests/generic-dh-make-2005/desc b/t/tests/generic-dh-make-2005/desc index 6709fa7..c4b7987 100644 --- a/t/tests/generic-dh-make-2005/desc +++ b/t/tests/generic-dh-make-2005/desc @@ -6,6 +6,7 @@ Version: 1-1 Description: Generic dh_make template generated in 2005 Test-For: ancient-standards-version + changelog-is-dh_make-template copyright-without-copyright-notice debian-rules-ignores-make-clean-error debian-rules-sets-DH_COMPAT diff --git a/t/tests/generic-dh-make-2005/tags b/t/tests/generic-dh-make-2005/tags index 0b4b5b7..392b7ff 100644 --- a/t/tests/generic-dh-make-2005/tags +++ b/t/tests/generic-dh-make-2005/tags @@ -1,3 +1,4 @@ +E: generic-dh-make-2005: changelog-is-dh_make-template E: generic-dh-make-2005: description-is-dh_make-template E: generic-dh-make-2005: helper-templates-in-copyright E: generic-dh-make-2005: section-is-dh_make-template diff --git a/t/tests/generic-dh-make-2008/desc b/t/tests/generic-dh-make-2008/desc index 08d37a2..8cb780c 100644 --- a/t/tests/generic-dh-make-2008/desc +++ b/t/tests/generic-dh-make-2008/desc @@ -8,6 +8,7 @@ Options: -IE --pedantic Test-For: ancient-standards-version bad-homepage + changelog-is-dh_make-template copyright-contains-dh_make-todo-boilerplate copyright-has-url-from-dh_make-boilerplate copyright-with-old-dh-make-debian-copyright diff --git a/t/tests/generic-dh-make-2008/tags b/t/tests/generic-dh-make-2008/tags index c49bfa3..5a03b47 100644 --- a/t/tests/generic-dh-make-2008/tags +++ b/t/tests/generic-dh-make-2008/tags @@ -1,3 +1,4 @@ +E: generic-dh-make-2008: changelog-is-dh_make-template E: generic-dh-make-2008: copyright-contains-dh_make-todo-boilerplate E: generic-dh-make-2008: description-is-dh_make-template E: generic-dh-make-2008: helper-templates-in-copyright -- 1.7.10.4