Login
RT #79289: False Postive in Perl::Critic::Utils::is_in_void_context()
[gknop/Perl-Critic.git] / examples / perlcriticrc
CommitLineData
aeb65262
JRT
1##############################################################################
2# This file is an example of a Perl::Critic configuration file. This
3# file is usually called ".perlcriticrc" and is usually located in
4# your home directory or the working directory of your project.
5# However, you can use the -profile option to tell Perl::Critic use a
6# different file in another location.
7#
8# The area before any of the [Perl::Critic::Policy] sections is used
9# to set default values for the arguments to the Perl::Critic engine.
10# If you are using the "perlcritic" program, you can override these
11# settings at the command-line. Or if you are using the Perl::Critic
12# library, your API arguments will override these settings as well.
13
14
15#-----------------------------------------------------------------------------
16# exclude: Directs Perl::Critic to never apply Policies with names that
17# match one of the patterns. To specify multiple patterns, separate them
18# with whitespace. Do not put quotes around anything.
19
20exclude = Documentation Naming
21
22#-----------------------------------------------------------------------------
23# include: Directs Perl::Critic to always apply Policies with names that
24# match one of the patterns. To specify multiple patterns, separate them
25# with whitespace. Do not put quotes around anything.
26
27include = CodeLayout Modules
28
29#-----------------------------------------------------------------------------
30# force: Directs Perl::Critic to ignore the special "##no critic"
31# comments embedded in the source code. The default is 0. If
32# defined, this should be either 1 or 0.
33
34force = 1
35
36#-----------------------------------------------------------------------------
37# only: Directs Perl::Critic to only choose from Policies that are
38# explicitly mentioned in this file. Otherwise, Perl::Critic chooses
39# from all the Perl::Critic::Policy classes that are found on the
40# local machine. The default is 0. If defined, this should be either
41# 1 or 0.
42
43only = 1
44
45#-----------------------------------------------------------------------------
46# severity: Sets the default minimum severity level for Policies. The
47# default is 5. If defined, this should be an integer from 1 to 5,
48# where 5 is the highest severity.
49
50severity = 3
51
52#-----------------------------------------------------------------------------
53# theme: Sets the default theme. Only Policies that fit into this
54# them shall be applied. If defined, this should be a valid theme
55# expression. See the Perl::Critic POD for more details about this.
56
57theme = danger + risky - pbp
58
59#-----------------------------------------------------------------------------
60# top: Directs Perl::Critic to only report the top N Policy violations,
61# as ranked by their individual severity. If defined, this should be
62# a positive integer.
63
64top = 50
65
66#-----------------------------------------------------------------------------
67# verbose: Sets the format for printing Policy violations. If
68# defined, this should be either a format spcecification, or a numeric
69# verbosity level. See the Perl::Critic POD for more details.
70
71verbose = 5
72
172f00ec
TW
73#-----------------------------------------------------------------------------
74# color-severity-highest: sets the color used for displaying highest
75# severity violations when coloring is in effect. This should be a color
76# specification acceptable to Term::ANSIColor. See the Perl::Critic POD
77# for details. Do not put quotes around the values. The default is 'bold
78# red'.
79
80color-severity-highest = bold red underline
81
82#-----------------------------------------------------------------------------
83# color-severity-high: sets the color used for displaying high severity
84# violations when coloring is in effect. This should be a color
85# specification acceptable to Term::ANSIColor. See the Perl::Critic POD
86# for details. Do not put quotes around the values. The default is
87# 'magenta'.
88
89color-severity-high = bold magenta
90
91#-----------------------------------------------------------------------------
92# color-severity-medium: sets the color used for displaying medium
93# severity violations when coloring is in effect. This should be a color
94# specification acceptable to Term::ANSIColor. See the Perl::Critic POD
95# for details. Do not put quotes around the values. The default is ''.
96
97color-severity-medium = blue
98
99#-----------------------------------------------------------------------------
100# color-severity-low: sets the color used for displaying low severity
101# violations when coloring is in effect. This should be a color
102# specification acceptable to Term::ANSIColor. See the Perl::Critic POD
103# for details. Do not put quotes around the values. The default is ''.
104
105color-severity-low =
106
107#-----------------------------------------------------------------------------
108# color-severity-lowest: sets the color used for displaying lowest
109# severity violations when coloring is in effect. This should be a color
110# specification acceptable to Term::ANSIColor. See the Perl::Critic POD
111# for details. Do not put quotes around the values. The default is ''.
112
113color-severity-lowest =
114
d533eee5 115#-----------------------------------------------------------------------------
1b936936
ES
116# program-extensions: specifies the file name endings for files that should
117# be interpreted as programs rather than modules. This should be a space-
d533eee5
ES
118# delimited list of the name endings, with leading '.' if that is desired.
119# These are case-sensitive. See the Perl::Critic POD for details, but in
120# general any file beginning with a shebang line, any file whose name ends
121# '.PL', and any file whose name ends in one of the values specified here
1b936936 122# will be considered a program; any other file will be considered a module.
d533eee5
ES
123# Do not put quotes around the values. The default is ''.
124
1b936936 125program-extensions =
d533eee5 126
aeb65262
JRT
127##############################################################################
128# The rest of the file consists of several named blocks that contain
129# configuration parameters for each of the Policies. The names of
130# each blocks correspond to the names of the Policy modules. For
131# brevity, the "Perl::Critic::Policy" portion of the name can be
132# omitted. See the POD for the appropriate Policy for a complete
133# description of the configuration parameters that it supports.
134
135
136#-----------------------------------------------------------------------------
137# If you vehmently disagree with a particular Policy, putting a "-" in
138# front of the Policy name will effectively disables that Policy. It
139# will never be applied unless you use the "-include" option to apply
140# it explicitly.
141
d5ff35da 142[-NamingConventions::Capitalization]
aeb65262
JRT
143[-TestingAndDebugging::RequireUseWarnings]
144
145#-----------------------------------------------------------------------------
146# If you agree with a Policy, but feel that it's severity level is not
147# appropriate, then you can change the severity for any Policy. If
148# defined this should be an integer from 1 to 5, where 5 is the
149# highest severity.
150
151[BuiltinFunctions::RequireBlockGrep]
152severity = 2
153
154[CodeLayout::ProhibitHardTabs]
155severity = 1
156
b9e520c1
JRT
157[ClassHierarchies::ProhibitAutoloading]
158severity = 5
aeb65262
JRT
159
160#-----------------------------------------------------------------------------
161# Policies are also organized into themes. Themes are just names for
162# arbitrary groups of Policies. You can define new themes and add
163# them to any Policy. If defined, this should be a string of
164# whitespace-delimited words.
165
166[RegularExpressions::RequireExtendedFormatting]
167add_themes = client_foo
168severity = 3
169
170[RegularExpressions::RequireExtendedFormatting]
171add_themes = client_foo client_bar
172severity = 3
173
6036a254 174#-----------------------------------------------------------------------------
aeb65262
JRT
175# Some Policies also have specialized configuration parameters. In
176# all cases, these are repsented as simple name=value pairs. See the
177# POD for the appropriate Policy for a complete discussion of its
178# configuration parameters.
179
180[ControlStructures::ProhibitPostfixControls]
181allow = for if
182severity = 4
183
184[Documentation::RequirePodSections]
185lib_sections = NAME | SYNOPSIS | METHODS | AUTHOR
186add_themes = my_favorites
187severity = 4
188
189#-----------------------------------------------------------------------------
190# If you set the "only" flag, then Perl::Critic only chooses from
191# Policies that are mentioned in your configuration file. This is
192# helpful when you want to use only a very small subset of the
193# Policies. So just create blocks for any other Policies that you
194# want to use.
195
196[ValuesAndExpressions::ProhibitInterpolationOfLiterals]
197[ValuesAndExpressions::ProhibitLeadingZeros]
198[InputOutput::ProhibitBarewordFileHandles]
199[Miscellanea::ProhibitTies]
200
201