This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.perlcriticrc
110 lines (79 loc) · 3.03 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
###
### Configure perlcritic display behavior.
###
# Change the default message to show the policy name so we can shut it up if necessary
verbose = %m [%p] at %f line %l, near '%r'\n
# Force perlcritic to use color, even when run through a pager.
color = 1
# Use a pager.
pager = $PAGER
###
### Turn off policies
### either because they're actively harmful
### or not helpful enough to be worth it
###
# Nuthin wrong with grep /foo/ or map @$_
[-BuiltinFunctions::RequireBlockMap]
[-BuiltinFunctions::RequireBlockGrep]
# Requiring q{} instead of "" doesn't help
[-ValuesAndExpressions::ProhibitEmptyQuotes]
# "," isn't hard to read
[-ValuesAndExpressions::ProhibitNoisyQuotes]
# "foo" doesn't hurt anything
[-ValuesAndExpressions::ProhibitInterpolationOfLiterals]
# If you don't know what local does, don't use it.
[-Variables::RequireInitializationForLocalVars]
# foo() if $bar; often makes more sense
[-ControlStructures::ProhibitPostfixControls]
# @$foo easier to read and type than @{$foo}
[-References::ProhibitDoubleSigils]
# The idea that inline POD slows compilation is a myth
[-Documentation::RequirePodAtEnd]
# If your module is procedural, yes you should export the most
# common functions by default.
[-Modules::ProhibitAutomaticExportation]
# I cannot be arsed to add text to every POD link just in case somebody
# uses an old formatter
[-Documentation::RequirePodLinksIncludeText]
# Hobgoblin
[-CodeLayout::RequireTrailingCommas]
# Too nit picky to bother with. Rarely causes a problem.
[-InputOutput::RequireBracedFileHandleWithPrint]
###
### Configure policies
###
# $! and $@ are very common and English is a pain to use right
[Variables::ProhibitPunctuationVars]
allow = $@ $!
# No point putting a /x on really short regexes.
[RegularExpressions::RequireExtendedFormatting]
minimum_regex_length_to_complain_about = 5
# Extend the ability to play with @_ to 3 line subroutines.
[Subroutines::RequireArgUnpacking]
short_subroutine_statements = 3
# Inform perlcritic that Mouse turns on strictures
[TestingAndDebugging::RequireUseStrict]
equivalent_modules = Mouse Mouse::Role perl5i::0 perl5i::1 perl5i::2 Modern::Perl
[TestingAndDebugging::RequireUseWarnings]
equivalent_modules = Mouse Mouse::Role perl5i::0 perl5i::1 perl5i::2 Modern::Perl
# No tabs ever
[CodeLayout::ProhibitHardTabs]
allow_leading_tabs = 0
# "no warnings 'foo'" is fine
[TestingAndDebugging::ProhibitNoWarnings]
allow_with_category_restriction = 1
# "no strict 'refs'" is necessary. The rest you don't need.
[TestingAndDebugging::ProhibitNoStrict]
allow = refs
# A sensible, minimal list of POD sections
[Documentation::RequirePodSections]
lib_sections = NAME | SYNOPSIS | DESCRIPTION
script_sections = NAME | SYNOPSIS | DESCRIPTION
# Check everything... except print and close, that's a bit too much
[InputOutput::RequireCheckedSyscalls]
functions = :builtins
exclude_functions = print close
# Globals, and equivalents, are $Foo
[NamingConventions::Capitalization]
global_variables = :starts_with_upper
file_lexical_variables = :starts_with_upper