rubocop 0.4.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.gitignore +50 -0
- data/.rubocop.yml +5 -127
- data/.travis.yml +7 -1
- data/CHANGELOG.md +157 -0
- data/CONTRIBUTING.md +13 -6
- data/Gemfile +3 -8
- data/README.md +160 -9
- data/Rakefile +3 -17
- data/bin/rubocop +16 -10
- data/config/default.yml +46 -0
- data/config/disabled.yml +5 -0
- data/config/enabled.yml +322 -0
- data/lib/rubocop/cli.rb +248 -93
- data/lib/rubocop/config.rb +205 -0
- data/lib/rubocop/config_store.rb +37 -0
- data/lib/rubocop/cop/access_control.rb +41 -0
- data/lib/rubocop/cop/alias.rb +17 -0
- data/lib/rubocop/cop/align_parameters.rb +20 -95
- data/lib/rubocop/cop/and_or.rb +26 -0
- data/lib/rubocop/cop/ascii_comments.rb +13 -0
- data/lib/rubocop/cop/ascii_identifiers.rb +19 -0
- data/lib/rubocop/cop/avoid_class_vars.rb +15 -0
- data/lib/rubocop/cop/avoid_for.rb +17 -0
- data/lib/rubocop/cop/avoid_global_vars.rb +61 -0
- data/lib/rubocop/cop/avoid_perl_backrefs.rb +17 -0
- data/lib/rubocop/cop/avoid_perlisms.rb +47 -0
- data/lib/rubocop/cop/block_comments.rb +15 -0
- data/lib/rubocop/cop/blocks.rb +11 -47
- data/lib/rubocop/cop/case_indentation.rb +22 -0
- data/lib/rubocop/cop/class_and_module_camel_case.rb +20 -11
- data/lib/rubocop/cop/class_methods.rb +15 -0
- data/lib/rubocop/cop/collection_methods.rb +16 -16
- data/lib/rubocop/cop/colon_method_call.rb +20 -0
- data/lib/rubocop/cop/constant_name.rb +24 -0
- data/lib/rubocop/cop/cop.rb +34 -47
- data/lib/rubocop/cop/def_parentheses.rb +43 -35
- data/lib/rubocop/cop/empty_line_between_defs.rb +22 -0
- data/lib/rubocop/cop/empty_lines.rb +21 -13
- data/lib/rubocop/cop/empty_literal.rb +47 -0
- data/lib/rubocop/cop/encoding.rb +3 -3
- data/lib/rubocop/cop/end_of_line.rb +3 -3
- data/lib/rubocop/cop/ensure_return.rb +19 -0
- data/lib/rubocop/cop/eval.rb +19 -0
- data/lib/rubocop/cop/favor_join.rb +22 -0
- data/lib/rubocop/cop/favor_modifier.rb +38 -48
- data/lib/rubocop/cop/favor_percent_r.rb +19 -0
- data/lib/rubocop/cop/favor_sprintf.rb +21 -0
- data/lib/rubocop/cop/favor_unless_over_negated_if.rb +19 -17
- data/lib/rubocop/cop/handle_exceptions.rb +17 -0
- data/lib/rubocop/cop/hash_syntax.rb +29 -14
- data/lib/rubocop/cop/if_then_else.rb +32 -29
- data/lib/rubocop/cop/leading_comment_space.rb +17 -0
- data/lib/rubocop/cop/line_continuation.rb +15 -0
- data/lib/rubocop/cop/line_length.rb +4 -4
- data/lib/rubocop/cop/loop.rb +33 -0
- data/lib/rubocop/cop/method_and_variable_snake_case.rb +41 -17
- data/lib/rubocop/cop/method_length.rb +52 -0
- data/lib/rubocop/cop/new_lambda_literal.rb +8 -6
- data/lib/rubocop/cop/not.rb +21 -0
- data/lib/rubocop/cop/numeric_literals.rb +9 -7
- data/lib/rubocop/cop/offence.rb +12 -1
- data/lib/rubocop/cop/op_method.rb +26 -0
- data/lib/rubocop/cop/parameter_lists.rb +12 -6
- data/lib/rubocop/cop/parentheses_around_condition.rb +11 -11
- data/lib/rubocop/cop/percent_r.rb +19 -0
- data/lib/rubocop/cop/reduce_arguments.rb +29 -0
- data/lib/rubocop/cop/rescue_exception.rb +26 -0
- data/lib/rubocop/cop/rescue_modifier.rb +17 -0
- data/lib/rubocop/cop/semicolon.rb +31 -0
- data/lib/rubocop/cop/single_line_methods.rb +44 -0
- data/lib/rubocop/cop/space_after_comma_etc.rb +30 -10
- data/lib/rubocop/cop/space_after_control_keyword.rb +29 -0
- data/lib/rubocop/cop/string_literals.rb +9 -23
- data/lib/rubocop/cop/surrounding_space.rb +223 -83
- data/lib/rubocop/cop/symbol_array.rb +31 -0
- data/lib/rubocop/cop/symbol_name.rb +23 -0
- data/lib/rubocop/cop/syntax.rb +35 -5
- data/lib/rubocop/cop/tab.rb +3 -3
- data/lib/rubocop/cop/ternary_operator.rb +26 -24
- data/lib/rubocop/cop/trailing_whitespace.rb +3 -5
- data/lib/rubocop/cop/trivial_accessors.rb +26 -0
- data/lib/rubocop/cop/unless_else.rb +11 -7
- data/lib/rubocop/cop/util.rb +26 -0
- data/lib/rubocop/cop/variable_interpolation.rb +29 -0
- data/lib/rubocop/cop/when_then.rb +6 -14
- data/lib/rubocop/cop/word_array.rb +37 -0
- data/lib/rubocop/report/emacs_style.rb +2 -2
- data/lib/rubocop/report/plain_text.rb +1 -1
- data/lib/rubocop/version.rb +3 -1
- data/lib/rubocop.rb +48 -8
- data/rubocop.gemspec +32 -151
- data/spec/project_spec.rb +27 -0
- data/spec/rubocop/cli_spec.rb +573 -200
- data/spec/rubocop/config_spec.rb +409 -0
- data/spec/rubocop/config_store_spec.rb +66 -0
- data/spec/rubocop/cops/access_control_spec.rb +129 -0
- data/spec/rubocop/cops/alias_spec.rb +39 -0
- data/spec/rubocop/cops/align_parameters_spec.rb +66 -70
- data/spec/rubocop/cops/and_or_spec.rb +37 -0
- data/spec/rubocop/cops/ascii_comments_spec.rb +26 -0
- data/spec/rubocop/cops/ascii_identifiers_spec.rb +26 -0
- data/spec/rubocop/cops/avoid_class_vars_spec.rb +25 -0
- data/spec/rubocop/cops/avoid_for_spec.rb +35 -0
- data/spec/rubocop/cops/avoid_global_vars_spec.rb +32 -0
- data/spec/rubocop/cops/avoid_perl_backrefs_spec.rb +18 -0
- data/spec/rubocop/cops/avoid_perlisms_spec.rb +44 -0
- data/spec/rubocop/cops/block_comments_spec.rb +25 -0
- data/spec/rubocop/cops/blocks_spec.rb +33 -0
- data/spec/rubocop/cops/{indentation_spec.rb → case_indentation_spec.rb} +7 -7
- data/spec/rubocop/cops/class_and_module_camel_case_spec.rb +15 -5
- data/spec/rubocop/cops/class_methods_spec.rb +49 -0
- data/spec/rubocop/cops/collection_methods_spec.rb +9 -4
- data/spec/rubocop/cops/colon_method_call_spec.rb +53 -0
- data/spec/rubocop/cops/constant_name_spec.rb +42 -0
- data/spec/rubocop/cops/def_with_parentheses_spec.rb +13 -8
- data/spec/rubocop/cops/def_without_parentheses_spec.rb +11 -5
- data/spec/rubocop/cops/empty_line_between_defs_spec.rb +83 -0
- data/spec/rubocop/cops/empty_lines_spec.rb +14 -59
- data/spec/rubocop/cops/empty_literal_spec.rb +90 -0
- data/spec/rubocop/cops/encoding_spec.rb +11 -11
- data/spec/rubocop/cops/end_of_line_spec.rb +2 -2
- data/spec/rubocop/cops/ensure_return_spec.rb +35 -0
- data/spec/rubocop/cops/eval_spec.rb +39 -0
- data/spec/rubocop/cops/favor_join_spec.rb +35 -0
- data/spec/rubocop/cops/favor_modifier_spec.rb +16 -14
- data/spec/rubocop/cops/favor_percent_r_spec.rb +29 -0
- data/spec/rubocop/cops/favor_sprintf_spec.rb +51 -0
- data/spec/rubocop/cops/favor_unless_over_negated_if_spec.rb +4 -4
- data/spec/rubocop/cops/favor_until_over_negated_while_spec.rb +3 -3
- data/spec/rubocop/cops/handle_exceptions_spec.rb +34 -0
- data/spec/rubocop/cops/hash_syntax_spec.rb +11 -6
- data/spec/rubocop/cops/if_with_semicolon_spec.rb +7 -1
- data/spec/rubocop/cops/leading_comment_space_spec.rb +54 -0
- data/spec/rubocop/cops/line_continuation_spec.rb +24 -0
- data/spec/rubocop/cops/line_length_spec.rb +3 -2
- data/spec/rubocop/cops/loop_spec.rb +31 -0
- data/spec/rubocop/cops/method_and_variable_snake_case_spec.rb +55 -9
- data/spec/rubocop/cops/method_length_spec.rb +147 -0
- data/spec/rubocop/cops/multiline_if_then_spec.rb +15 -15
- data/spec/rubocop/cops/new_lambda_literal_spec.rb +5 -6
- data/spec/rubocop/cops/not_spec.rb +31 -0
- data/spec/rubocop/cops/numeric_literals_spec.rb +13 -13
- data/spec/rubocop/cops/offence_spec.rb +13 -0
- data/spec/rubocop/cops/one_line_conditional_spec.rb +1 -1
- data/spec/rubocop/cops/op_method_spec.rb +78 -0
- data/spec/rubocop/cops/parameter_lists_spec.rb +7 -7
- data/spec/rubocop/cops/parentheses_around_condition_spec.rb +41 -44
- data/spec/rubocop/cops/percent_r_spec.rb +29 -0
- data/spec/rubocop/cops/reduce_arguments_spec.rb +57 -0
- data/spec/rubocop/cops/rescue_exception_spec.rb +125 -0
- data/spec/rubocop/cops/rescue_modifier_spec.rb +37 -0
- data/spec/rubocop/cops/semicolon_spec.rb +88 -0
- data/spec/rubocop/cops/single_line_methods_spec.rb +50 -0
- data/spec/rubocop/cops/space_after_colon_spec.rb +3 -3
- data/spec/rubocop/cops/space_after_comma_spec.rb +14 -2
- data/spec/rubocop/cops/space_after_control_keyword_spec.rb +67 -0
- data/spec/rubocop/cops/space_after_semicolon_spec.rb +6 -1
- data/spec/rubocop/cops/space_around_braces_spec.rb +18 -3
- data/spec/rubocop/cops/space_around_equals_in_default_parameter_spec.rb +12 -2
- data/spec/rubocop/cops/space_around_operators_spec.rb +88 -26
- data/spec/rubocop/cops/space_inside_brackets_spec.rb +13 -7
- data/spec/rubocop/cops/space_inside_hash_literal_braces_spec.rb +79 -0
- data/spec/rubocop/cops/space_inside_parens_spec.rb +7 -3
- data/spec/rubocop/cops/string_literals_spec.rb +21 -6
- data/spec/rubocop/cops/symbol_array_spec.rb +41 -0
- data/spec/rubocop/cops/symbol_name_spec.rb +119 -0
- data/spec/rubocop/cops/syntax_spec.rb +28 -5
- data/spec/rubocop/cops/tab_spec.rb +2 -2
- data/spec/rubocop/cops/ternary_operator_spec.rb +13 -17
- data/spec/rubocop/cops/trailing_whitespace_spec.rb +3 -3
- data/spec/rubocop/cops/trivial_accessors_spec.rb +329 -0
- data/spec/rubocop/cops/unless_else_spec.rb +8 -8
- data/spec/rubocop/cops/variable_interpolation_spec.rb +49 -0
- data/spec/rubocop/cops/when_then_spec.rb +14 -14
- data/spec/rubocop/cops/word_array_spec.rb +47 -0
- data/spec/spec_helper.rb +30 -9
- data/spec/support/file_helper.rb +21 -0
- data/spec/support/isolated_environment.rb +27 -0
- metadata +235 -76
- data/.document +0 -5
- data/Gemfile.lock +0 -41
- data/VERSION +0 -1
- data/lib/rubocop/cop/ampersands_pipes_vs_and_or.rb +0 -25
- data/lib/rubocop/cop/grammar.rb +0 -135
- data/lib/rubocop/cop/indentation.rb +0 -44
- data/spec/rubocop/cops/ampersands_pipes_vs_and_or_spec.rb +0 -57
- data/spec/rubocop/cops/grammar_spec.rb +0 -71
- data/spec/rubocop/cops/multiline_blocks_spec.rb +0 -24
- data/spec/rubocop/cops/single_line_blocks_spec.rb +0 -22
data/config/default.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# This is the default configuration file. Enabling and disabling is configured
|
2
|
+
# in separate files. This file adds all other parameters apart from Enabled.
|
3
|
+
|
4
|
+
inherit_from:
|
5
|
+
- enabled.yml
|
6
|
+
- disabled.yml
|
7
|
+
|
8
|
+
# Common configuration.
|
9
|
+
AllCops:
|
10
|
+
# Include gemspec and Rakefile
|
11
|
+
Includes:
|
12
|
+
- '**/*.gemspec'
|
13
|
+
- '**/Rakefile'
|
14
|
+
Excludes: []
|
15
|
+
|
16
|
+
# Limit lines to 79 characters.
|
17
|
+
LineLength:
|
18
|
+
Max: 79
|
19
|
+
|
20
|
+
# Avoid methods longer than 10 lines of code
|
21
|
+
MethodLength:
|
22
|
+
CountComments: false # count full line comments?
|
23
|
+
Max: 10
|
24
|
+
|
25
|
+
# Avoid parameter lists longer than four parameters.
|
26
|
+
ParameterLists:
|
27
|
+
Max: 4
|
28
|
+
|
29
|
+
# Don't use semicolons to terminate expressions.
|
30
|
+
Semicolon:
|
31
|
+
# For example; def area(height, width); height * width end
|
32
|
+
AllowAfterParameterListInOneLineMethods: false
|
33
|
+
# For example; def area(height, width) height * width; end
|
34
|
+
AllowBeforeEndInOneLineMethods: true
|
35
|
+
|
36
|
+
# Avoid single-line methods.
|
37
|
+
SingleLineMethods:
|
38
|
+
AllowIfMethodIsEmpty: true
|
39
|
+
|
40
|
+
# Use spaces inside hash literal braces - or don't.
|
41
|
+
SpaceInsideHashLiteralBraces:
|
42
|
+
EnforcedStyleIsWithSpaces: true
|
43
|
+
|
44
|
+
# Symbol literals should use snake_case.
|
45
|
+
SymbolName:
|
46
|
+
AllowCamelCase: true
|
data/config/disabled.yml
ADDED
data/config/enabled.yml
ADDED
@@ -0,0 +1,322 @@
|
|
1
|
+
# These are all the cops that are enabled in the default configuration.
|
2
|
+
|
3
|
+
# Use UTF-8 as the source file encoding.
|
4
|
+
Encoding:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
# Limit lines to 80 characters.
|
8
|
+
LineLength:
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
# Avoid methods longer than 10 lines of code
|
12
|
+
MethodLength:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
# No hard tabs.
|
16
|
+
Tab:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
# Avoid trailing whitespace.
|
20
|
+
TrailingWhitespace:
|
21
|
+
Enabled: true
|
22
|
+
|
23
|
+
# Indent when as deep as case.
|
24
|
+
CaseIndentation:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
# Use empty lines between defs.
|
28
|
+
EmptyLineBetweenDefs:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
# Don't use several empty lines in a row.
|
32
|
+
EmptyLines:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
# Use spaces around operators.
|
36
|
+
SpaceAroundOperators:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
# Use spaces around { and before }.
|
40
|
+
SpaceAroundBraces:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
# No spaces after ( or before ).
|
44
|
+
SpaceInsideParens:
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
# No spaces after [ or before ].
|
48
|
+
SpaceInsideBrackets:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
# Use spaces after commas.
|
52
|
+
SpaceAfterComma:
|
53
|
+
Enabled: true
|
54
|
+
|
55
|
+
# Use spaces after semicolons.
|
56
|
+
SpaceAfterSemicolon:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
# Use spaces after colons.
|
60
|
+
SpaceAfterColon:
|
61
|
+
Enabled: true
|
62
|
+
|
63
|
+
# Use spaces after if/elsif/unless/while/until/case/when.
|
64
|
+
SpaceAfterControlKeyword:
|
65
|
+
Enabled: true
|
66
|
+
|
67
|
+
# Prefer symbols instead of strings as hash keys.
|
68
|
+
HashSyntax:
|
69
|
+
Enabled: true
|
70
|
+
|
71
|
+
# Use Unix-style line endings.
|
72
|
+
EndOfLine:
|
73
|
+
Enabled: true
|
74
|
+
|
75
|
+
# Add underscores to large numeric literals to improve their readability.
|
76
|
+
NumericLiterals:
|
77
|
+
Enabled: true
|
78
|
+
|
79
|
+
# Align the parameters of a method call if they span more than one line.
|
80
|
+
AlignParameters:
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
# Use def with parentheses when there are arguments.
|
84
|
+
DefWithParentheses:
|
85
|
+
Enabled: true
|
86
|
+
|
87
|
+
# Omit the parentheses when the method doesn't accept any arguments.
|
88
|
+
DefWithoutParentheses:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
# Never use if x; .... Use the ternary operator instead.
|
92
|
+
IfWithSemicolon:
|
93
|
+
Enabled: true
|
94
|
+
|
95
|
+
# Never use then for multi-line if/unless.
|
96
|
+
MultilineIfThen:
|
97
|
+
Enabled: true
|
98
|
+
|
99
|
+
# Favor the ternary operator(?:) over if/then/else/end constructs.
|
100
|
+
OneLineConditional:
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
# Avoid using {...} for multi-line blocks (multiline chaining is always ugly).
|
104
|
+
# Prefer {...} over do...end for single-line blocks.
|
105
|
+
Blocks:
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
# Avoid parameter lists longer than three or four parameters.
|
109
|
+
ParameterLists:
|
110
|
+
Enabled: true
|
111
|
+
|
112
|
+
# Prefer ' strings when you don't need string interpolation or special symbols.
|
113
|
+
StringLiterals:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
# Avoid multi-line ?: (the ternary operator); use if/unless instead.
|
117
|
+
MultilineTernaryOperator:
|
118
|
+
Enabled: true
|
119
|
+
|
120
|
+
# Use one expression per branch in a ternary operator.
|
121
|
+
NestedTernaryOperator:
|
122
|
+
Enabled: true
|
123
|
+
|
124
|
+
# Never use unless with else. Rewrite these with the positive case first.
|
125
|
+
UnlessElse:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
# Use &&/|| instead of and/or.
|
129
|
+
AndOr:
|
130
|
+
Enabled: true
|
131
|
+
|
132
|
+
# Use when x then ... for one-line cases.
|
133
|
+
WhenThen:
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
# Favor modifier if/unless usage when you have a single-line body.
|
137
|
+
IfUnlessModifier:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
# Favor modifier while/until usage when you have a single-line body.
|
141
|
+
WhileUntilModifier:
|
142
|
+
Enabled: true
|
143
|
+
|
144
|
+
# Favor unless over if for negative conditions (or control flow or).
|
145
|
+
FavorUnlessOverNegatedIf:
|
146
|
+
Enabled: true
|
147
|
+
|
148
|
+
# Favor until over while for negative conditions.
|
149
|
+
FavorUntilOverNegatedWhile:
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
# Use spaces around the = operator when assigning default values in def params.
|
153
|
+
SpaceAroundEqualsInParameterDefault:
|
154
|
+
Enabled: true
|
155
|
+
|
156
|
+
# Use the new lambda literal syntax.
|
157
|
+
NewLambdaLiteral:
|
158
|
+
Enabled: true
|
159
|
+
|
160
|
+
# Don't use parentheses around the condition of an if/unless/while.
|
161
|
+
ParenthesesAroundCondition:
|
162
|
+
Enabled: true
|
163
|
+
|
164
|
+
# Use snake_case for symbols, methods and variables.
|
165
|
+
MethodAndVariableSnakeCase:
|
166
|
+
Enabled: true
|
167
|
+
|
168
|
+
# Use CamelCase for classes and modules.
|
169
|
+
ClassAndModuleCamelCase:
|
170
|
+
Enabled: true
|
171
|
+
|
172
|
+
# Causes Ruby to check the syntax of the script and exit without executing.
|
173
|
+
Syntax:
|
174
|
+
Enabled: true
|
175
|
+
|
176
|
+
# Preferred collection methods.
|
177
|
+
CollectionMethods:
|
178
|
+
Enabled: true
|
179
|
+
|
180
|
+
# Prefer each over for.
|
181
|
+
AvoidFor:
|
182
|
+
Enabled: true
|
183
|
+
|
184
|
+
# Avoid Perl-style global variables.
|
185
|
+
AvoidPerlisms:
|
186
|
+
Enabled: true
|
187
|
+
|
188
|
+
# Avoid Perl-style regex back references.
|
189
|
+
AvoidPerlBackrefs:
|
190
|
+
Enabled: true
|
191
|
+
|
192
|
+
# Avoid the use of class variables.
|
193
|
+
AvoidClassVars:
|
194
|
+
Enabled: true
|
195
|
+
|
196
|
+
# Don't interpolate global, instance and class variables directly in strings.
|
197
|
+
VariableInterpolation:
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
# Don't use semicolons to terminate expressions.
|
201
|
+
Semicolon:
|
202
|
+
Enabled: true
|
203
|
+
|
204
|
+
# Use sprintf instead of String#%.
|
205
|
+
FavorSprintf:
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
# Use Array#join instead of Array#*.
|
209
|
+
FavorJoin:
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
# Use alias_method instead of alias.
|
213
|
+
Alias:
|
214
|
+
Enabled: true
|
215
|
+
|
216
|
+
# Use ! instead of not.
|
217
|
+
Not:
|
218
|
+
Enabled: true
|
219
|
+
|
220
|
+
# Avoid using rescue in its modifier form.
|
221
|
+
RescueModifier:
|
222
|
+
Enabled: true
|
223
|
+
|
224
|
+
# Never use return in an ensure block.
|
225
|
+
EnsureReturn:
|
226
|
+
Enabled: true
|
227
|
+
|
228
|
+
# Don't suppress exception.
|
229
|
+
HandleExceptions:
|
230
|
+
Enabled: true
|
231
|
+
|
232
|
+
# Use only ascii symbols in identifiers.
|
233
|
+
AsciiIdentifiers:
|
234
|
+
Enabled: true
|
235
|
+
|
236
|
+
# Use only ascii symbols in comments.
|
237
|
+
AsciiComments:
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
# Do not use block comments.
|
241
|
+
BlockComments:
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
# Avoid rescuing the Exception class.
|
245
|
+
RescueException:
|
246
|
+
Enabled: true
|
247
|
+
|
248
|
+
# Prefer literals to Array.new/Hash.new/String.new.
|
249
|
+
EmptyLiteral:
|
250
|
+
Enabled: true
|
251
|
+
|
252
|
+
# When defining binary operators, name the argument other.
|
253
|
+
OpMethod:
|
254
|
+
Enabled: true
|
255
|
+
|
256
|
+
# Name reduce arguments |a, e| (accumulator, element)
|
257
|
+
ReduceArguments:
|
258
|
+
Enabled: true
|
259
|
+
|
260
|
+
# Use %r only for regular expressions matching more than one '/' character.
|
261
|
+
PercentR:
|
262
|
+
Enabled: true
|
263
|
+
|
264
|
+
# Use %r for regular expressions matching more than one '/' character.
|
265
|
+
FavorPercentR:
|
266
|
+
Enabled: true
|
267
|
+
|
268
|
+
# Use self when defining module/class methods.
|
269
|
+
ClassMethods:
|
270
|
+
Enabled: true
|
271
|
+
|
272
|
+
# Avoid single-line methods.
|
273
|
+
SingleLineMethods:
|
274
|
+
Enabled: true
|
275
|
+
|
276
|
+
# Use %w or %W for arrays of words.
|
277
|
+
WordArray:
|
278
|
+
Enabled: true
|
279
|
+
|
280
|
+
# Use spaces inside hash literal braces - or don't.
|
281
|
+
SpaceInsideHashLiteralBraces:
|
282
|
+
Enabled: true
|
283
|
+
|
284
|
+
# Avoid the use of line continuation (/).
|
285
|
+
LineContinuation:
|
286
|
+
Enabled: true
|
287
|
+
|
288
|
+
# Prefer attr_* methods to trivial readers/writers.
|
289
|
+
TrivialAccessors:
|
290
|
+
Enabled: true
|
291
|
+
|
292
|
+
# Comments should start with a space.
|
293
|
+
LeadingCommentSpace:
|
294
|
+
Enabled: true
|
295
|
+
|
296
|
+
# Do not use :: for method invocation.
|
297
|
+
ColonMethodCall:
|
298
|
+
Enabled: true
|
299
|
+
|
300
|
+
# Do not introduce global variables.
|
301
|
+
AvoidGlobalVars:
|
302
|
+
Enabled: true
|
303
|
+
|
304
|
+
# The use of eval represents a serious security risk.
|
305
|
+
Eval:
|
306
|
+
Enabled: true
|
307
|
+
|
308
|
+
# Symbol literals should use snake_case.
|
309
|
+
SymbolName:
|
310
|
+
Enabled: true
|
311
|
+
|
312
|
+
# Constants should use SCREAMING_SNAKE_CASE.
|
313
|
+
ConstantName:
|
314
|
+
Enabled: true
|
315
|
+
|
316
|
+
# Indent private/protected as deep as defs and keep blank lines around them.
|
317
|
+
AccessControl:
|
318
|
+
Enabled: true
|
319
|
+
|
320
|
+
# Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests.
|
321
|
+
Loop:
|
322
|
+
Enabled: true
|