On 4/13/20 12:47 PM, Andrew Dunstan wrote:
>
> OK, I've committed all that stuff. I think that takes care of the
> non-controversial part of what I proposed :-)
>
>

OK, it seems there is a majority of people commenting in this thread in
favor of not doing more except to reverse the policy of requiring
subroutine returns. I'll do that shortly. In the spirit of David
Steele's contribution, here is a snippet that when added to the
perlcriticrc would allow us to pass at the "brutal" setting (severity
1). But I'm not proposing to add this, it's just here so anyone
interested can see what's involved.

One of the things that's a bit sad is that perlcritic doesn't generally
let you apply policies to a given set of files or files matching some
pattern. It would be nice, for instance, to be able to apply some
additional standards to strategic library files like PostgresNode.pm,
TestLib.pm and Catalog.pm. There are good reasons as suggested upthread
to apply higher standards to library files than to, say, a TAP test
script. The only easy way I can see to do that would be to have two
different perlcriticrc files and adjust pgperlcritic to make two runs.
If people think that's worth it I'll put a little work into it. If not,
I'll just leave things here.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

# severity  4
[-BuiltinFunctions::RequireBlockGrep] # 9 occurrences
[-BuiltinFunctions::RequireBlockMap] # 1 occurrences
[-InputOutput::ProhibitReadlineInForLoop] # 2 occurrences
[-InputOutput::RequireBriefOpen] # 83 occurrences
[-Modules::ProhibitAutomaticExportation] # 7 occurrences
[-Modules::ProhibitMultiplePackages] # 9 occurrences
[-Objects::ProhibitIndirectSyntax] # 12 occurrences
[-Subroutines::RequireArgUnpacking] # 39 occurrences
[-TestingAndDebugging::ProhibitNoWarnings] # 6 occurrences
[-TestingAndDebugging::ProhibitProlongedStrictureOverride] # 2 occurrences
[-ValuesAndExpressions::ProhibitCommaSeparatedStatements] # 4 occurrences
[-ValuesAndExpressions::ProhibitConstantPragma] # 2 occurrences
[-ValuesAndExpressions::ProhibitMixedBooleanOperators] # 2 occurrences
[-Variables::RequireLocalizedPunctuationVars] # 72 occurrences
# severity  3
[-BuiltinFunctions::ProhibitComplexMappings] # 2 occurrences
[-BuiltinFunctions::ProhibitLvalueSubstr] # 1 occurrences
[-BuiltinFunctions::ProhibitVoidMap] # 1 occurrences
[-BuiltinFunctions::RequireSimpleSortBlock] # 1 occurrences
[-ClassHierarchies::ProhibitExplicitISA] # 10 occurrences
[-CodeLayout::ProhibitHardTabs] # 172 occurrences
[-ControlStructures::ProhibitCascadingIfElse] # 15 occurrences
[-ControlStructures::ProhibitDeepNests] # 1 occurrences
[-ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions] # 5 
occurrences
[-ErrorHandling::RequireCarping] # 284 occurrences
[-ErrorHandling::RequireCheckingReturnValueOfEval] # 11 occurrences
[-InputOutput::ProhibitBacktickOperators] # 13 occurrences
[-InputOutput::ProhibitJoinedReadline] # 1 occurrences
[-InputOutput::RequireCheckedOpen] # 24 occurrences
[-Miscellanea::ProhibitUnrestrictedNoCritic] # 12 occurrences
[-Modules::ProhibitConditionalUseStatements] # 1 occurrences
[-Modules::ProhibitExcessMainComplexity] # 15 occurrences
[-NamingConventions::ProhibitAmbiguousNames] # 3 occurrences
[-RegularExpressions::ProhibitCaptureWithoutTest] # 30 occurrences
[-RegularExpressions::ProhibitComplexRegexes] # 267 occurrences
[-RegularExpressions::ProhibitUnusedCapture] # 11 occurrences
[-RegularExpressions::RequireExtendedFormatting] # 1048 occurrences
[-Subroutines::ProhibitExcessComplexity] # 13 occurrences
[-Subroutines::ProhibitManyArgs] # 9 occurrences
[-Subroutines::ProhibitUnusedPrivateSubroutines] # 3 occurrences
[-TestingAndDebugging::RequireTestLabels] # 4 occurrences
[-ValuesAndExpressions::ProhibitImplicitNewlines] # 312 occurrences
[-ValuesAndExpressions::ProhibitMismatchedOperators] # 11 occurrences
[-ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters] # 2 
occurrences
[-ValuesAndExpressions::ProhibitVersionStrings] # 1 occurrences
[-ValuesAndExpressions::RequireQuotedHeredocTerminator] # 98 occurrences
[-Variables::ProhibitPackageVars] # 79 occurrences
[-Variables::ProhibitReusedNames] # 14 occurrences
[-Variables::ProhibitUnusedVariables] # 8 occurrences
[-Variables::RequireInitializationForLocalVars] # 3 occurrences
# severity  2
[-BuiltinFunctions::ProhibitBooleanGrep] # 14 occurrences
[-BuiltinFunctions::ProhibitStringySplit] # 8 occurrences
[-BuiltinFunctions::ProhibitUselessTopic] # 4 occurrences
[-CodeLayout::ProhibitQuotedWordLists] # 13 occurrences
[-ControlStructures::ProhibitCStyleForLoops] # 26 occurrences
[-ControlStructures::ProhibitPostfixControls] # 325 occurrences
[-ControlStructures::ProhibitUnlessBlocks] # 12 occurrences
[-Documentation::RequirePodSections] # 51 occurrences
[-InputOutput::RequireCheckedClose] # 140 occurrences
[-Miscellanea::ProhibitTies] # 3 occurrences
[-Miscellanea::ProhibitUselessNoCritic] # 2 occurrences
[-Modules::RequireVersionVar] # 180 occurrences
[-References::ProhibitDoubleSigils] # 85 occurrences
[-RegularExpressions::ProhibitFixedStringMatches] # 33 occurrences
[-RegularExpressions::ProhibitUselessTopic] # 4 occurrences
[-RegularExpressions::RequireDotMatchAnything] # 1327 occurrences
[-RegularExpressions::RequireLineBoundaryMatching] # 1074 occurrences
[-Subroutines::ProhibitAmpersandSigils] # 13 occurrences
[-ValuesAndExpressions::ProhibitEmptyQuotes] # 267 occurrences
[-ValuesAndExpressions::ProhibitEscapedCharacters] # 9 occurrences
[-ValuesAndExpressions::ProhibitMagicNumbers] # 331 occurrences
[-ValuesAndExpressions::ProhibitNoisyQuotes] # 170 occurrences
[-ValuesAndExpressions::RequireNumberSeparators] # 60 occurrences
[-Variables::ProhibitPunctuationVars] # 257 occurrences
# severity  1
[-BuiltinFunctions::ProhibitReverseSortBlock] # 1 occurrences
[-CodeLayout::ProhibitParensWithBuiltins] # 568 occurrences
[-CodeLayout::ProhibitTrailingWhitespace] # 1 occurrences
[-CodeLayout::RequireTidyCode] # 173 occurrences
[-CodeLayout::RequireTrailingCommas] # 32 occurrences
[-Documentation::PodSpelling] # 4 occurrences
[-Documentation::RequirePodAtEnd] # 5 occurrences
[-InputOutput::RequireBracedFileHandleWithPrint] # 352 occurrences
[-InputOutput::RequireCheckedSyscalls] # 688 occurrences
[-NamingConventions::Capitalization] # 122 occurrences
[-RegularExpressions::ProhibitEnumeratedClasses] # 33 occurrences
[-RegularExpressions::ProhibitEscapedMetacharacters] # 237 occurrences
[-RegularExpressions::ProhibitSingleCharAlternation] # 3 occurrences
[-RegularExpressions::ProhibitUnusualDelimiters] # 71 occurrences
[-RegularExpressions::RequireBracesForMultiline] # 165 occurrences
[-ValuesAndExpressions::ProhibitInterpolationOfLiterals] # 1951 occurrences
[-ValuesAndExpressions::RequireInterpolationOfMetachars] # 79 occurrences

Reply via email to