-
Notifications
You must be signed in to change notification settings - Fork 0
/
.perlcriticrc
59 lines (43 loc) · 2.26 KB
/
.perlcriticrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# DO NOT EDIT! This file is written by perl_setup_dist.
# If needed, you can add content at the end of the file.
# We report any policy of level 2 or higher (there is far too much noise if we
# go down to severity 1).
severity = 2
verbose = %f:%l: %m (%p, Severity: %s).\n
# We still include some policies whose default severity is 1
include = ValuesAndExpressions::ProhibitInterpolationOfLiterals CodeLayout::ProhibitTrailingWhitespace CodeLayout::RequireTidyCode
# Signatures are nice, let’s use them.
[TestingAndDebugging::ProhibitNoWarnings]
allow = experimental::signatures
# Methods of at most 2 lines can directly use @_ without unpacking it first
# (used here for performance reasons).
[Subroutines::RequireArgUnpacking]
short_subroutine_statements = 2
[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
allow_if_string_contains_single_quote = 1
# Let’s allow moderately complex regex using the default syntax.
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 30
# And we disable some policies that don’t work well:
# This policy confuses sub prototype with signatures.
[-Subroutines::ProhibitSubroutinePrototypes]
# This policy appears to also be confused by signatures.
[-Subroutines::ProhibitManyArgs]
# In theory we want that but, when using Locale::MakeText, this policy
# complains about the %Lexicon variables declared for the localization and there
# is no easy way to exclude them except by listing them all.
# TODO: remove once https://github.com/Perl-Critic/Perl-Critic/issues/1034 is fixed.
[-Variables::ProhibitPackageVars]
# That performance issue has been fixed in Perl 5.18 and newer.
[-Modules::RequireNoMatchVarsWithUseEnglish]
# I like postfix control :-)
[-ControlStructures::ProhibitPostfixControls]
# All the sections that I want to include are there already.
[-Documentation::RequirePodSections]
# This policy has many bugs, also I think that using the topic variable can make
# the code clearer, even in place where it would not be required to use it.
[-BuiltinFunctions::ProhibitUselessTopic]
# Let’s assume the reader knows how to write regex.
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireLineBoundaryMatching]
# End of the template. You can add custom content below this line.