Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools for technical analysts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
tools for technical analysts
Commits
ce1402e3
Commit
ce1402e3
authored
1 year ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- init
parent
d0cc010b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.perlcriticrc
+249
-0
249 additions, 0 deletions
.perlcriticrc
with
249 additions
and
0 deletions
.perlcriticrc
0 → 100644
+
249
−
0
View file @
ce1402e3
#severity = gentle
severity = stern
only = 0
force = 0
verbose = 8
top = 10
#theme = (core || pbp || security || bugs || complexity || maintenance || cosmetic || pulp || bangs ||certrec || certrule ) && !more
# more
color = 1
# Tell us which rule this violated, so we can tell it to get lost
verbose = [%p] %m at %f line %l, near '%r'\n
### rules
### Git
# We use git, not svn or RCS
[-Miscellanea::RequireRcsKeywords]
# We'll enforce dependencies in other ways, rather than magically putting
# a $VERSION variable in modules.
[-Modules::RequireVersionVar]
### Modern Perl
# We'll run on at least perl 5.30
[Compatibility::PodMinimumVersion]
above_version = 5.031
# So don't badger us about explicitly declaring which version of Perl we
# require
[-Compatibility::PerlMinimumVersionAndWhy]
# Perltidy is a judgement call.
[-CodeLayout::RequireTidyCode]
# Damian Conway's insistence that the literal '' or "" in a proper
# monospaced font is difficult to read is frankly bizarre.
[-ValuesAndExpressions::ProhibitEmptyQuotes]
[-ValuesAndExpressions::ProhibitNoisyQuotes]
[-ValuesAndExpressions::ProhibitNullStatements]
[-ValuesAndExpressions::ProhibitVersionStrings]
# reverse sort @array is indeed better than
# sort { $b cmp $a } @array
# I'm not so sure about hating on $b vs $a in e.g.
# sort { $b->{stuff} <=> $a->{stuff} }
[-BuiltinFunctions::ProhibitReverseSortBlock]
# This is overridden by the better rule RequireCheckedSyscalls
[-InputOutput::RequireCheckedClose]
# There's muscle memory of always adding /xms to a regex, and then there's
# typing for the hell of it.
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireLineBoundaryMatching]
# Inline POD is good, dammit.
[-Documentation::RequirePodAtEnd]
# These are internal Perl modules. They don't need all these sections.
[-Documentation::RequirePodSections]
# We throw structured exceptions all the time. Carp would be a bad idea
# here.
[-ErrorHandling::RequireCarping]
[-ErrorHandling::RequireUseOfExceptions]
[-Perlsecret]
###
[Bangs::ProhibitDebuggingModules]
severity = 3
[Bangs::ProhibitNumberedNames]
exceptions = md5 utf8 sha1 sha2 sha512
severity = 3
##
[BuiltinFunctions::ProhibitStringyEval]
allow_includes = 1
##
[CodeLayout::RequireConsistentNewlines]
##
# the values for cognitive complexity are tuned. Sometimes you have several if-statements, which could not be replaced
# by other constructs. See 'validate()' in SLUB::LZA::BagIt (score=17) for example.
[CognitiveComplexity::ProhibitExcessCognitiveComplexity]
severity = 5
warn_level = 13
info_level = 10
##
[CompileTime]
##
[ControlStructures::ProhibitCascadingIfElse]
severity = 5
max_elsif = 3
##
[ControlStructures::ProhibitMutatingListFunctions]
severity = 3
##
[ControlStructures::ProhibitPostfixControls]
allow = if unless
severity = cruel
##
[InputOutput::ProhibitBacktickOperators]
##
[InputOutput::ProhibitExplicitStdin]
severity = 5
##
[InputOutput::RequireBriefOpen]
lines = 30
severity = 5
##
[Miscellanea::ProhibitUnrestrictedNoCritic]
severity = 4
##
[RegularExpressions::ProhibitCaptureWithoutTest]
severity = 5
##
[RegularExpressions::ProhibitUnusedCapture]
##
[Subroutines::ProhibitBuiltinHomonyms]
severity = 5
##
[Subroutines::ProhibitExcessComplexity]
severity = 4
##
### Moose
[Moose::RequireMakeImmutable]
severity = 3
# Builders are pulled in from Moose, but perlcritic can't possibly begin
# to fathom that out. So let these things slide.
[Subroutines::ProhibitUnusedPrivateSubroutines]
private_name_regex = _(?!build)\w+
##
[Subroutines::RequireArgUnpacking]
short_subroutine_statements = 2
allow_subscripts = 1
severity = 4
##
[Subroutines::RequireFinalReturn]
severity = 5
##
[CognitiveComplexity::ProhibitExcessCognitiveComplexity]
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = MooseX::My::Sugar
severity = 5
##
[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = MooseX::My::Sugar
severity = 5
##
## Modules that import strictures etc.
# We have use strict and use warnings, dammit.
# Adding Test::Class::Moose temporarily as perlcritic doesn't realise that,
# like Moose, it enables strictures and warnings.
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = common::sense our::way Test::Class::Moose
[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = our::way Test::Class::Moose
[TestingAndDebugging::ProhibitNoWarnings]
severity = 5
allow = uninitialized once void experimental::signatures experimental::smartmatch
##
[TooMuchCode::ProhibitDuplicateLiteral]
# severity = 3
##
[TooMuchCode::ProhibitLargeBlock]
severity = 5
##
[TooMuchCode::ProhibitUnnecessaryUTF8Pragma]
severity = 4
##
[Variables::ProhibitReusedNames]
severity = 5
##
[Variables::ProhibitPunctuationVars]
allow = $@ $!
##
[Variables::RequireLocalizedPunctuationVars]
allow = %SIG
##
[ValuesAndExpressions::ProhibitMagicNumbers]
allowed_values = 0 1 2
##
[ValuesAndExpressions::ProhibitLeadingZeros]
strict = 0
##
[ValuesAndExpressions::RequireNumberSeparators]
min_value = 100000
severity = brutal
##
[ValuesAndExpressions::RestrictLongStrings]
# Yes, require /x but perhaps not for really trivial regexen
# or stuff that looks for a constant
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 35
# Checking return values is a good thing. Checking the return value of
# close or print STDERR is downright silly, as is checking whether you
# managed to sleep or not (!).
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print close sleep
# Some things like DBIx::Class work fine with long chains of method calls.
# Bump up the number of method calls allowed.
[ValuesAndExpressions::ProhibitLongChainsOfMethodCalls]
max_chain_length = 5
# A blanket prohibition like this policy is harsh, but is meant as a
# building block or at least to make you think carefully whether "-f" is
# really right.
[-ValuesAndExpressions::ProhibitFiletest_f]
##
[Variables::ProhibitLoopOnHash]
##
### MOOSE
[Moose::ProhibitDESTROYMethod]
[Moose::ProhibitMultipleWiths]
[Moose::ProhibitNewMethod]
[Moose::RequireCleanNamespace]
[Moose::RequireMakeImmutable]
[Moose::ProhibitLazyBuild]
[TooMuchCode::ProhibitUnusedImport]
severity=3
[TooMuchCode::ProhibitUnusedInclude]
severity=3
[Modules::RequireExplicitInclusion]
severity=3
[Subroutines::ProhibitQualifiedSubDeclarations]
severity=3
######################### should be rechecked soon #########################
[-Modules::ProhibitAutomaticExportation]
[-Subroutines::ProhibitCallsToUndeclaredSubs]
[-Subroutines::ProhibitCallsToUnexportedSubs]
[-Subroutines::ProhibitSubroutinePrototypes]
[-ValuesAndExpressions::ProhibitConstantPragma]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment