This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=5d64af3892539b720ad87939e223f322716950f2 commit 5d64af3892539b720ad87939e223f322716950f2 Author: Guillem Jover <[email protected]> AuthorDate: Sat Mar 25 20:06:49 2023 +0100 test: Make some perlcritic checks more strict These were being ignored completely, but we can tune them to at least catch some of the issues and avoid the current ones that trigger them. --- t/critic.t | 2 ++ t/critic/perlcriticrc | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/t/critic.t b/t/critic.t index 8eedf5939..f2058778a 100644 --- a/t/critic.t +++ b/t/critic.t @@ -54,6 +54,7 @@ my @policies = qw( ControlStructures::ProhibitYadaOperator Documentation::RequirePackageMatchesPodName Documentation::RequirePodSections + InputOutput::ProhibitBacktickOperators InputOutput::ProhibitBarewordDirHandles InputOutput::ProhibitBarewordFileHandles InputOutput::ProhibitInteractiveTest @@ -76,6 +77,7 @@ my @policies = qw( Modules::RequireExplicitPackage Modules::RequireFilenameMatchesPackage NamingConventions::Capitalization + NamingConventions::ProhibitAmbiguousNames Objects::ProhibitIndirectSyntax RegularExpressions::ProhibitCaptureWithoutTest RegularExpressions::ProhibitSingleCharAlternation diff --git a/t/critic/perlcriticrc b/t/critic/perlcriticrc index d5ef6f3fd..e2e55b04d 100644 --- a/t/critic/perlcriticrc +++ b/t/critic/perlcriticrc @@ -11,6 +11,14 @@ program-extensions = .pl .t lib_sections = NAME | DESCRIPTION | CHANGES script_sections = NAME | SYNOPSIS | DESCRIPTION +[InputOutput::ProhibitBacktickOperators] +# TODO: Add new Dpkg::Program module and switch those to it ? +only_in_void_context = 1 + +[NamingConventions::ProhibitAmbiguousNames] +# Allow set(), which is the common name for a setter. +forbid = abstract bases close contract last left no record right second + [RegularExpressions::ProhibitUnusualDelimiters] allow_all_brackets = 1 @@ -64,9 +72,6 @@ allow_if_string_contains_single_quote = 1 # Not relevant anymore, the mentioned problems were fixed in Perl 5.14. [-ErrorHandling::RequireCheckingReturnValueOfEval] -# TODO: Check it out, add new Dpkg::Program module? -[-InputOutput::ProhibitBacktickOperators] - # Needed, using <>/<@ARGV> is not correct, Prompt is not a core module. [-InputOutput::ProhibitExplicitStdin] @@ -79,9 +84,6 @@ allow_if_string_contains_single_quote = 1 # BUG: Too many false positives; non-modules all trigger. [-Modules::RequireVersionVar] -# These are fine. -[-NamingConventions::ProhibitAmbiguousNames] - # We work primarily with ASCII, so we need to specify the exact characters # to match. [-RegularExpressions::ProhibitEnumeratedClasses] -- Dpkg.Org's dpkg

