ridecharge-rubocop 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +14 -0
  5. data/CHANGELOG.md +0 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +35 -0
  9. data/Rakefile +22 -0
  10. data/bin/ridecharge-rubocop +49 -0
  11. data/config/0default.yml +8 -0
  12. data/config/fleet-magic-todo.yml +380 -0
  13. data/config/rc-todo.yml +190 -0
  14. data/config/ridecharge-rubocop_todo.yml +73 -0
  15. data/config/rubocop/default.yml +308 -0
  16. data/config/rubocop/disabled.yml +9 -0
  17. data/config/rubocop/enabled.yml +648 -0
  18. data/config/standard-todo.yml +24 -0
  19. data/config/tabs.yml +15 -0
  20. data/config/vehicle-todo.yml +195 -0
  21. data/lib/ridecharge/rubocop.rb +2 -0
  22. data/lib/ridecharge/rubocop/version.rb +5 -0
  23. data/lib/rubocop/config_loader_monkeypatch.rb +117 -0
  24. data/lib/rubocop/ridecharge.rb +1 -0
  25. data/ridecharge-rubocop.gemspec +25 -0
  26. data/spec/isolated_environment_spec.rb +24 -0
  27. data/spec/project_spec.rb +118 -0
  28. data/spec/rubocop/cli_spec.rb +1385 -0
  29. data/spec/rubocop/config_loader_spec.rb +328 -0
  30. data/spec/rubocop/config_spec.rb +179 -0
  31. data/spec/rubocop/config_store_spec.rb +53 -0
  32. data/spec/rubocop/cop/commissioner_spec.rb +83 -0
  33. data/spec/rubocop/cop/cop_spec.rb +114 -0
  34. data/spec/rubocop/cop/corrector_spec.rb +59 -0
  35. data/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +113 -0
  36. data/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +35 -0
  37. data/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +107 -0
  38. data/spec/rubocop/cop/lint/block_alignment_spec.rb +411 -0
  39. data/spec/rubocop/cop/lint/condition_position_spec.rb +49 -0
  40. data/spec/rubocop/cop/lint/debugger_spec.rb +39 -0
  41. data/spec/rubocop/cop/lint/else_layout_spec.rb +65 -0
  42. data/spec/rubocop/cop/lint/empty_ensure_spec.rb +27 -0
  43. data/spec/rubocop/cop/lint/end_alignment_spec.rb +136 -0
  44. data/spec/rubocop/cop/lint/end_in_method_spec.rb +29 -0
  45. data/spec/rubocop/cop/lint/ensure_return_spec.rb +39 -0
  46. data/spec/rubocop/cop/lint/eval_spec.rb +35 -0
  47. data/spec/rubocop/cop/lint/handle_exceptions_spec.rb +30 -0
  48. data/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +33 -0
  49. data/spec/rubocop/cop/lint/literal_in_condition_spec.rb +63 -0
  50. data/spec/rubocop/cop/lint/loop_spec.rb +27 -0
  51. data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +57 -0
  52. data/spec/rubocop/cop/lint/require_parentheses_spec.rb +82 -0
  53. data/spec/rubocop/cop/lint/rescue_exception_spec.rb +131 -0
  54. data/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +237 -0
  55. data/spec/rubocop/cop/lint/syntax_spec.rb +34 -0
  56. data/spec/rubocop/cop/lint/unreachable_code_spec.rb +63 -0
  57. data/spec/rubocop/cop/lint/useless_assignment_spec.rb +1570 -0
  58. data/spec/rubocop/cop/lint/useless_comparison_spec.rb +30 -0
  59. data/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +48 -0
  60. data/spec/rubocop/cop/lint/useless_setter_call_spec.rb +149 -0
  61. data/spec/rubocop/cop/lint/void_spec.rb +57 -0
  62. data/spec/rubocop/cop/offence_spec.rb +133 -0
  63. data/spec/rubocop/cop/rails/default_scope_spec.rb +37 -0
  64. data/spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb +13 -0
  65. data/spec/rubocop/cop/rails/output_spec.rb +41 -0
  66. data/spec/rubocop/cop/rails/read_attribute_spec.rb +13 -0
  67. data/spec/rubocop/cop/rails/validation_spec.rb +21 -0
  68. data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +361 -0
  69. data/spec/rubocop/cop/style/accessor_method_name_spec.rb +81 -0
  70. data/spec/rubocop/cop/style/alias_spec.rb +59 -0
  71. data/spec/rubocop/cop/style/align_array_spec.rb +75 -0
  72. data/spec/rubocop/cop/style/align_hash_spec.rb +310 -0
  73. data/spec/rubocop/cop/style/align_parameters_spec.rb +222 -0
  74. data/spec/rubocop/cop/style/and_or_spec.rb +57 -0
  75. data/spec/rubocop/cop/style/ascii_comments_spec.rb +22 -0
  76. data/spec/rubocop/cop/style/ascii_identifiers_spec.rb +36 -0
  77. data/spec/rubocop/cop/style/attr_spec.rb +19 -0
  78. data/spec/rubocop/cop/style/begin_block_spec.rb +13 -0
  79. data/spec/rubocop/cop/style/block_comments_spec.rb +21 -0
  80. data/spec/rubocop/cop/style/block_nesting_spec.rb +156 -0
  81. data/spec/rubocop/cop/style/blocks_spec.rb +99 -0
  82. data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +284 -0
  83. data/spec/rubocop/cop/style/case_equality_spec.rb +12 -0
  84. data/spec/rubocop/cop/style/case_indentation_spec.rb +289 -0
  85. data/spec/rubocop/cop/style/character_literal_spec.rb +37 -0
  86. data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +40 -0
  87. data/spec/rubocop/cop/style/class_length_spec.rb +131 -0
  88. data/spec/rubocop/cop/style/class_methods_spec.rb +45 -0
  89. data/spec/rubocop/cop/style/class_vars_spec.rb +19 -0
  90. data/spec/rubocop/cop/style/collection_methods_spec.rb +48 -0
  91. data/spec/rubocop/cop/style/colon_method_call_spec.rb +60 -0
  92. data/spec/rubocop/cop/style/comment_annotation_spec.rb +86 -0
  93. data/spec/rubocop/cop/style/constant_name_spec.rb +65 -0
  94. data/spec/rubocop/cop/style/cyclomatic_complexity_spec.rb +204 -0
  95. data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +39 -0
  96. data/spec/rubocop/cop/style/documentation_spec.rb +123 -0
  97. data/spec/rubocop/cop/style/dot_position_spec.rb +94 -0
  98. data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +127 -0
  99. data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +56 -0
  100. data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +131 -0
  101. data/spec/rubocop/cop/style/empty_lines_spec.rb +40 -0
  102. data/spec/rubocop/cop/style/empty_literal_spec.rb +100 -0
  103. data/spec/rubocop/cop/style/encoding_spec.rb +56 -0
  104. data/spec/rubocop/cop/style/end_block_spec.rb +13 -0
  105. data/spec/rubocop/cop/style/end_of_line_spec.rb +47 -0
  106. data/spec/rubocop/cop/style/even_odd_spec.rb +75 -0
  107. data/spec/rubocop/cop/style/favor_join_spec.rb +31 -0
  108. data/spec/rubocop/cop/style/favor_sprintf_spec.rb +47 -0
  109. data/spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb +76 -0
  110. data/spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb +41 -0
  111. data/spec/rubocop/cop/style/final_newline_spec.rb +30 -0
  112. data/spec/rubocop/cop/style/flip_flop_spec.rb +23 -0
  113. data/spec/rubocop/cop/style/for_spec.rb +105 -0
  114. data/spec/rubocop/cop/style/global_vars_spec.rb +34 -0
  115. data/spec/rubocop/cop/style/hash_methods_spec.rb +45 -0
  116. data/spec/rubocop/cop/style/hash_syntax_spec.rb +131 -0
  117. data/spec/rubocop/cop/style/if_unless_modifier_spec.rb +128 -0
  118. data/spec/rubocop/cop/style/if_with_semicolon_spec.rb +19 -0
  119. data/spec/rubocop/cop/style/indentation_consistency_spec.rb +490 -0
  120. data/spec/rubocop/cop/style/indentation_width_spec.rb +470 -0
  121. data/spec/rubocop/cop/style/lambda_call_spec.rb +65 -0
  122. data/spec/rubocop/cop/style/lambda_spec.rb +41 -0
  123. data/spec/rubocop/cop/style/leading_comment_space_spec.rb +64 -0
  124. data/spec/rubocop/cop/style/line_end_concatenation_spec.rb +34 -0
  125. data/spec/rubocop/cop/style/line_length_spec.rb +20 -0
  126. data/spec/rubocop/cop/style/method_call_parentheses_spec.rb +59 -0
  127. data/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +60 -0
  128. data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +106 -0
  129. data/spec/rubocop/cop/style/method_length_spec.rb +147 -0
  130. data/spec/rubocop/cop/style/method_name_spec.rb +125 -0
  131. data/spec/rubocop/cop/style/module_function_spec.rb +24 -0
  132. data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +78 -0
  133. data/spec/rubocop/cop/style/multiline_if_then_spec.rb +107 -0
  134. data/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +18 -0
  135. data/spec/rubocop/cop/style/nested_ternary_operator_spec.rb +21 -0
  136. data/spec/rubocop/cop/style/nil_comparison_spec.rb +30 -0
  137. data/spec/rubocop/cop/style/not_spec.rb +22 -0
  138. data/spec/rubocop/cop/style/numeric_literals_spec.rb +64 -0
  139. data/spec/rubocop/cop/style/one_line_conditional_spec.rb +13 -0
  140. data/spec/rubocop/cop/style/op_method_spec.rb +74 -0
  141. data/spec/rubocop/cop/style/parameter_lists_spec.rb +44 -0
  142. data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +122 -0
  143. data/spec/rubocop/cop/style/perl_backrefs_spec.rb +17 -0
  144. data/spec/rubocop/cop/style/predicate_name_spec.rb +25 -0
  145. data/spec/rubocop/cop/style/proc_spec.rb +27 -0
  146. data/spec/rubocop/cop/style/raise_args_spec.rb +82 -0
  147. data/spec/rubocop/cop/style/redundant_begin_spec.rb +57 -0
  148. data/spec/rubocop/cop/style/redundant_exception_spec.rb +27 -0
  149. data/spec/rubocop/cop/style/redundant_return_spec.rb +171 -0
  150. data/spec/rubocop/cop/style/redundant_self_spec.rb +142 -0
  151. data/spec/rubocop/cop/style/regexp_literal_spec.rb +83 -0
  152. data/spec/rubocop/cop/style/rescue_modifier_spec.rb +116 -0
  153. data/spec/rubocop/cop/style/semicolon_spec.rb +100 -0
  154. data/spec/rubocop/cop/style/signal_exception_spec.rb +266 -0
  155. data/spec/rubocop/cop/style/single_line_block_params_spec.rb +68 -0
  156. data/spec/rubocop/cop/style/single_line_methods_spec.rb +52 -0
  157. data/spec/rubocop/cop/style/space_after_colon_spec.rb +38 -0
  158. data/spec/rubocop/cop/style/space_after_comma_spec.rb +30 -0
  159. data/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +84 -0
  160. data/spec/rubocop/cop/style/space_after_method_name_spec.rb +70 -0
  161. data/spec/rubocop/cop/style/space_after_not_spec.rb +22 -0
  162. data/spec/rubocop/cop/style/space_after_semicolon_spec.rb +23 -0
  163. data/spec/rubocop/cop/style/space_around_block_braces_spec.rb +283 -0
  164. data/spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb +33 -0
  165. data/spec/rubocop/cop/style/space_around_operators_spec.rb +325 -0
  166. data/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +70 -0
  167. data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +52 -0
  168. data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +138 -0
  169. data/spec/rubocop/cop/style/space_inside_parens_spec.rb +34 -0
  170. data/spec/rubocop/cop/style/special_global_vars_spec.rb +56 -0
  171. data/spec/rubocop/cop/style/string_literals_spec.rb +212 -0
  172. data/spec/rubocop/cop/style/symbol_array_spec.rb +37 -0
  173. data/spec/rubocop/cop/style/tab_spec.rb +17 -0
  174. data/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +43 -0
  175. data/spec/rubocop/cop/style/trailing_comma_spec.rb +230 -0
  176. data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +30 -0
  177. data/spec/rubocop/cop/style/trivial_accessors_spec.rb +415 -0
  178. data/spec/rubocop/cop/style/unless_else_spec.rb +25 -0
  179. data/spec/rubocop/cop/style/variable_interpolation_spec.rb +47 -0
  180. data/spec/rubocop/cop/style/variable_name_spec.rb +107 -0
  181. data/spec/rubocop/cop/style/when_then_spec.rb +41 -0
  182. data/spec/rubocop/cop/style/while_until_do_spec.rb +53 -0
  183. data/spec/rubocop/cop/style/while_until_modifier_spec.rb +75 -0
  184. data/spec/rubocop/cop/style/word_array_spec.rb +97 -0
  185. data/spec/rubocop/cop/team_spec.rb +156 -0
  186. data/spec/rubocop/cop/util_spec.rb +49 -0
  187. data/spec/rubocop/cop/variable_inspector/assignment_spec.rb +213 -0
  188. data/spec/rubocop/cop/variable_inspector/locatable_spec.rb +734 -0
  189. data/spec/rubocop/cop/variable_inspector/scope_spec.rb +184 -0
  190. data/spec/rubocop/cop/variable_inspector/variable_spec.rb +73 -0
  191. data/spec/rubocop/cop/variable_inspector/variable_table_spec.rb +269 -0
  192. data/spec/rubocop/cop/variable_inspector_spec.rb +29 -0
  193. data/spec/rubocop/file_inspector_spec.rb +78 -0
  194. data/spec/rubocop/formatter/base_formatter_spec.rb +191 -0
  195. data/spec/rubocop/formatter/clang_style_formatter_spec.rb +114 -0
  196. data/spec/rubocop/formatter/colorizable_spec.rb +107 -0
  197. data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +50 -0
  198. data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +62 -0
  199. data/spec/rubocop/formatter/file_list_formatter_spec.rb +33 -0
  200. data/spec/rubocop/formatter/formatter_set_spec.rb +132 -0
  201. data/spec/rubocop/formatter/json_formatter_spec.rb +148 -0
  202. data/spec/rubocop/formatter/offence_count_formatter_spec.rb +52 -0
  203. data/spec/rubocop/formatter/progress_formatter_spec.rb +182 -0
  204. data/spec/rubocop/formatter/simple_text_formatter_spec.rb +123 -0
  205. data/spec/rubocop/options_spec.rb +145 -0
  206. data/spec/rubocop/path_util_spec.rb +42 -0
  207. data/spec/rubocop/processed_source_spec.rb +114 -0
  208. data/spec/rubocop/source_parser_spec.rb +139 -0
  209. data/spec/rubocop/target_finder_spec.rb +180 -0
  210. data/spec/rubocop/token_spec.rb +25 -0
  211. data/spec/spec_helper.rb +136 -0
  212. data/spec/support/ast_helper.rb +15 -0
  213. data/spec/support/file_helper.rb +21 -0
  214. data/spec/support/isolated_environment.rb +34 -0
  215. data/spec/support/mri_syntax_checker.rb +73 -0
  216. data/spec/support/shared_context.rb +22 -0
  217. data/spec/support/shared_examples.rb +33 -0
  218. data/spec/support/statement_modifier_helper.rb +41 -0
  219. metadata +511 -0
@@ -0,0 +1,9 @@
1
+ # These are all the cops that are disabled in the default configuration.
2
+
3
+ MethodCalledOnDoEndBlock:
4
+ Description: 'Avoid chaining a method call on a do...end block.'
5
+ Enabled: false
6
+
7
+ SymbolArray:
8
+ Description: 'Use %i or %I for arrays of symbols.'
9
+ Enabled: false
@@ -0,0 +1,648 @@
1
+ # These are all the cops that are enabled in the default configuration.
2
+
3
+ AccessModifierIndentation:
4
+ Description: Check indentation of private/protected visibility modifiers.
5
+ Enabled: true
6
+
7
+ AccessorMethodName:
8
+ Description: Check the naming of accessor methods for get_/set_.
9
+ Enabled: true
10
+
11
+ Alias:
12
+ Description: 'Use alias_method instead of alias.'
13
+ Enabled: true
14
+
15
+ AlignArray:
16
+ Description: >-
17
+ Align the elements of an array literal if they span more than
18
+ one line.
19
+ Enabled: true
20
+
21
+ AlignHash:
22
+ Description: >-
23
+ Align the elements of a hash literal if they span more than
24
+ one line.
25
+ Enabled: true
26
+
27
+ AlignParameters:
28
+ Description: >-
29
+ Align the parameters of a method call if they span more
30
+ than one line.
31
+ Enabled: true
32
+
33
+ AndOr:
34
+ Description: 'Use &&/|| instead of and/or.'
35
+ Enabled: true
36
+
37
+ AsciiComments:
38
+ Description: 'Use only ascii symbols in comments.'
39
+ Enabled: true
40
+
41
+ AsciiIdentifiers:
42
+ Description: 'Use only ascii symbols in identifiers.'
43
+ Enabled: true
44
+
45
+ Attr:
46
+ Description: 'Checks for uses of Module#attr.'
47
+ Enabled: true
48
+
49
+ BeginBlock:
50
+ Description: 'Avoid the use of BEGIN blocks.'
51
+ Enabled: true
52
+
53
+ BlockComments:
54
+ Description: 'Do not use block comments.'
55
+ Enabled: true
56
+
57
+ BlockNesting:
58
+ Description: 'Avoid excessive block nesting'
59
+ Enabled: true
60
+
61
+ Blocks:
62
+ Description: >-
63
+ Avoid using {...} for multi-line blocks (multiline chaining is
64
+ always ugly).
65
+ Prefer {...} over do...end for single-line blocks.
66
+ Enabled: true
67
+
68
+ BracesAroundHashParameters:
69
+ Description: 'Enforce braces style inside hash parameters.'
70
+ Enabled: true
71
+
72
+ CaseEquality:
73
+ Description: 'Avoid explicit use of the case equality operator(===).'
74
+ Enabled: true
75
+
76
+ CaseIndentation:
77
+ Description: 'Indentation of when in a case/when/[else/]end.'
78
+ Enabled: true
79
+
80
+ CharacterLiteral:
81
+ Description: 'Checks for uses of character literals.'
82
+ Enabled: true
83
+
84
+ ClassAndModuleCamelCase:
85
+ Description: 'Use CamelCase for classes and modules.'
86
+ Enabled: true
87
+
88
+ ClassLength:
89
+ Description: 'Avoid classes longer than 100 lines of code.'
90
+ Enabled: true
91
+
92
+ ClassMethods:
93
+ Description: 'Use self when defining module/class methods.'
94
+ Enabled: true
95
+
96
+ ClassVars:
97
+ Description: 'Avoid the use of class variables.'
98
+ Enabled: true
99
+
100
+ CollectionMethods:
101
+ Description: 'Preferred collection methods.'
102
+ Enabled: true
103
+
104
+ ColonMethodCall:
105
+ Description: 'Do not use :: for method call.'
106
+ Enabled: true
107
+
108
+ CommentAnnotation:
109
+ Description: >-
110
+ Checks formatting of special comments
111
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
112
+ Enabled: true
113
+
114
+ ConstantName:
115
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
116
+ Enabled: true
117
+
118
+ CyclomaticComplexity:
119
+ Description: 'Avoid complex methods.'
120
+ Enabled: true
121
+
122
+ DefWithParentheses:
123
+ Description: 'Use def with parentheses when there are arguments.'
124
+ Enabled: true
125
+
126
+ Documentation:
127
+ Description: 'Document classes and non-namespace modules.'
128
+ Enabled: true
129
+
130
+ DotPosition:
131
+ Description: 'Checks the position of the dot in multi-line method calls.'
132
+ Enabled: true
133
+
134
+ EmptyLineBetweenDefs:
135
+ Description: 'Use empty lines between defs.'
136
+ Enabled: true
137
+
138
+ EmptyLines:
139
+ Description: "Don't use several empty lines in a row."
140
+ Enabled: true
141
+
142
+ EmptyLinesAroundAccessModifier:
143
+ Description: "Keep blank lines around access modifiers."
144
+ Enabled: true
145
+
146
+ EmptyLinesAroundBody:
147
+ Description: "Keeps track of empty lines around expression bodies."
148
+ Enabled: true
149
+
150
+ EmptyLiteral:
151
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
152
+ Enabled: true
153
+
154
+ Encoding:
155
+ Description: 'Use UTF-8 as the source file encoding.'
156
+ Enabled: true
157
+
158
+ EndBlock:
159
+ Description: 'Avoid the use of END blocks.'
160
+ Enabled: true
161
+
162
+ EndOfLine:
163
+ Description: 'Use Unix-style line endings.'
164
+ Enabled: true
165
+
166
+ EvenOdd:
167
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
168
+ Enabled: true
169
+
170
+ FavorJoin:
171
+ Description: 'Use Array#join instead of Array#*.'
172
+ Enabled: true
173
+
174
+ FavorSprintf:
175
+ Description: 'Use sprintf instead of String#%.'
176
+ Enabled: true
177
+
178
+ FavorUnlessOverNegatedIf:
179
+ Description: >-
180
+ Favor unless over if for negative conditions
181
+ (or control flow or).
182
+ Enabled: true
183
+
184
+ FavorUntilOverNegatedWhile:
185
+ Description: 'Favor until over while for negative conditions.'
186
+ Enabled: true
187
+
188
+ FinalNewline:
189
+ Description: 'Checks for a final newline in a source file.'
190
+ Enabled: true
191
+
192
+ FlipFlop:
193
+ Description: 'Checks for flip flops'
194
+ Enabled: true
195
+
196
+ For:
197
+ Description: 'Checks use of for or each in multiline loops.'
198
+ Enabled: true
199
+
200
+ GlobalVars:
201
+ Description: 'Do not introduce global variables.'
202
+ Enabled: true
203
+
204
+ HashMethods:
205
+ Description: 'Checks for use of deprecated Hash methods.'
206
+ Enabled: true
207
+
208
+ HashSyntax:
209
+ Description: >-
210
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
211
+ { :a => 1, :b => 2 }.
212
+ Enabled: true
213
+
214
+ IfUnlessModifier:
215
+ Description: >-
216
+ Favor modifier if/unless usage when you have a
217
+ single-line body.
218
+ Enabled: true
219
+
220
+ IfWithSemicolon:
221
+ Description: 'Never use if x; .... Use the ternary operator instead.'
222
+ Enabled: true
223
+
224
+ IndentationConsistency:
225
+ Description: 'Keep indentation straight.'
226
+ Enabled: true
227
+
228
+ IndentationWidth:
229
+ Description: 'Use 2 spaces for indentation.'
230
+ Enabled: true
231
+
232
+ Lambda:
233
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
234
+ Enabled: true
235
+
236
+ LambdaCall:
237
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
238
+ Enabled: true
239
+
240
+ LeadingCommentSpace:
241
+ Description: 'Comments should start with a space.'
242
+ Enabled: true
243
+
244
+ LineEndConcatenation:
245
+ Description: 'Use \\ instead of + to concatenate two string literals at line end.'
246
+ Enabled: true
247
+
248
+ LineLength:
249
+ Description: 'Limit lines to 79 characters.'
250
+ Enabled: true
251
+
252
+ MethodCallParentheses:
253
+ Description: 'Do not use parentheses for method calls with no arguments.'
254
+ Enabled: true
255
+
256
+ MethodDefParentheses:
257
+ Description: >-
258
+ Checks if the method definitions have or don't have
259
+ parentheses.
260
+ Enabled: true
261
+
262
+ MethodLength:
263
+ Description: 'Avoid methods longer than 10 lines of code.'
264
+ Enabled: true
265
+
266
+ MethodName:
267
+ Description: 'Use the configured style when naming methods.'
268
+ Enabled: true
269
+
270
+ ModuleFunction:
271
+ Description: 'Checks for usage of `extend self` in modules.'
272
+ Enabled: true
273
+
274
+ MultilineBlockChain:
275
+ Description: 'Avoid multi-line chains of blocks.'
276
+ Enabled: true
277
+
278
+ MultilineIfThen:
279
+ Description: 'Never use then for multi-line if/unless.'
280
+ Enabled: true
281
+
282
+ MultilineTernaryOperator:
283
+ Description: >-
284
+ Avoid multi-line ?: (the ternary operator);
285
+ use if/unless instead.
286
+ Enabled: true
287
+
288
+ NestedTernaryOperator:
289
+ Description: 'Use one expression per branch in a ternary operator.'
290
+ Enabled: true
291
+
292
+ NilComparison:
293
+ Description: 'Prefer x.nil? to x == nil.'
294
+ Enabled: true
295
+
296
+ Not:
297
+ Description: 'Use ! instead of not.'
298
+ Enabled: true
299
+
300
+ NumericLiterals:
301
+ Description: >-
302
+ Add underscores to large numeric literals to improve their
303
+ readability.
304
+ Enabled: true
305
+
306
+ OneLineConditional:
307
+ Description: >-
308
+ Favor the ternary operator(?:) over
309
+ if/then/else/end constructs.
310
+ Enabled: true
311
+
312
+ OpMethod:
313
+ Description: 'When defining binary operators, name the argument other.'
314
+ Enabled: true
315
+
316
+ ParameterLists:
317
+ Description: 'Avoid parameter lists longer than three or four parameters.'
318
+ Enabled: true
319
+
320
+ ParenthesesAroundCondition:
321
+ Description: >-
322
+ Don't use parentheses around the condition of an
323
+ if/unless/while.
324
+ Enabled: true
325
+
326
+ PerlBackrefs:
327
+ Description: 'Avoid Perl-style regex back references.'
328
+ Enabled: true
329
+
330
+ PredicateName:
331
+ Description: 'Check the names of predicate methods.'
332
+ Enabled: true
333
+
334
+ Proc:
335
+ Description: 'Use proc instead of Proc.new.'
336
+ Enabled: true
337
+
338
+ RaiseArgs:
339
+ Description: 'Checks the arguments passed to raise/fail.'
340
+ Enabled: true
341
+
342
+ RedundantBegin:
343
+ Description: "Don't use begin blocks when they are not needed."
344
+ Enabled: true
345
+
346
+ RedundantException:
347
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
348
+ Enabled: true
349
+
350
+ RedundantReturn:
351
+ Description: "Don't use return where it's not required."
352
+ Enabled: true
353
+
354
+ RedundantSelf:
355
+ Description: "Don't use self where it's not needed."
356
+ Enabled: true
357
+
358
+ RegexpLiteral:
359
+ Description: >-
360
+ Use %r for regular expressions matching more than
361
+ `MaxSlashes` '/' characters.
362
+ Use %r only for regular expressions matching more than
363
+ `MaxSlashes` '/' character.
364
+ Enabled: true
365
+
366
+ RescueModifier:
367
+ Description: 'Avoid using rescue in its modifier form.'
368
+ Enabled: true
369
+
370
+ Semicolon:
371
+ Description: "Don't use semicolons to terminate expressions."
372
+ Enabled: true
373
+
374
+ SignalException:
375
+ Description: 'Checks for proper usage of fail and raise.'
376
+ Enabled: true
377
+
378
+ SingleLineBlockParams:
379
+ Description: 'Enforces the names of some block params.'
380
+ Enabled: true
381
+
382
+ SingleLineMethods:
383
+ Description: 'Avoid single-line methods.'
384
+ Enabled: true
385
+
386
+ SpaceAfterColon:
387
+ Description: 'Use spaces after colons.'
388
+ Enabled: true
389
+
390
+ SpaceAfterComma:
391
+ Description: 'Use spaces after commas.'
392
+ Enabled: true
393
+
394
+ SpaceAfterControlKeyword:
395
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
396
+ Enabled: true
397
+
398
+ SpaceAfterMethodName:
399
+ Description: >-
400
+ Never put a space between a method name and the opening
401
+ parenthesis.
402
+ Enabled: true
403
+
404
+ SpaceAfterNot:
405
+ Description: Tracks redundant space after the ! operator.
406
+ Enabled: true
407
+
408
+ SpaceAfterSemicolon:
409
+ Description: 'Use spaces after semicolons.'
410
+ Enabled: true
411
+
412
+ SpaceAroundBlockBraces:
413
+ Description: >-
414
+ Checks that block braces have or don't have surrounding space.
415
+ For blocks taking parameters, checks that the left brace has
416
+ or doesn't have trailing space.
417
+ Enabled: true
418
+
419
+ SpaceAroundEqualsInParameterDefault:
420
+ Description: >-
421
+ Use spaces around the = operator when assigning default
422
+ values in def params.
423
+ Enabled: true
424
+
425
+ SpaceAroundOperators:
426
+ Description: 'Use spaces around operators.'
427
+ Enabled: true
428
+
429
+ SpaceBeforeModifierKeyword:
430
+ Description: 'Put a space before the modifier keyword.'
431
+ Enabled: true
432
+
433
+ SpaceInsideBrackets:
434
+ Description: 'No spaces after [ or before ].'
435
+ Enabled: true
436
+
437
+ SpaceInsideHashLiteralBraces:
438
+ Description: "Use spaces inside hash literal braces - or don't."
439
+ Enabled: true
440
+
441
+ SpaceInsideParens:
442
+ Description: 'No spaces after ( or before ).'
443
+ Enabled: true
444
+
445
+ SpecialGlobalVars:
446
+ Description: 'Avoid Perl-style global variables.'
447
+ Enabled: true
448
+
449
+ StringLiterals:
450
+ Description: 'Checks if uses of quotes match the configured preference.'
451
+ Enabled: true
452
+
453
+ Tab:
454
+ Description: 'No hard tabs.'
455
+ Enabled: true
456
+
457
+ TrailingBlankLines:
458
+ Description: 'Checks for superfluous trailing blank lines.'
459
+ Enabled: true
460
+
461
+ TrailingComma:
462
+ Description: 'Checks for trailing comma in parameter lists and literals.'
463
+ Enabled: true
464
+
465
+ TrailingWhitespace:
466
+ Description: 'Avoid trailing whitespace.'
467
+ Enabled: true
468
+
469
+ TrivialAccessors:
470
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
471
+ Enabled: true
472
+
473
+ UnlessElse:
474
+ Description: >-
475
+ Never use unless with else. Rewrite these with the positive
476
+ case first.
477
+ Enabled: true
478
+
479
+ VariableInterpolation:
480
+ Description: >-
481
+ Don't interpolate global, instance and class variables
482
+ directly in strings.
483
+ Enabled: true
484
+
485
+ VariableName:
486
+ Description: 'Use the configured style when naming variables.'
487
+ Enabled: true
488
+
489
+ WhenThen:
490
+ Description: 'Use when x then ... for one-line cases.'
491
+ Enabled: true
492
+
493
+ WhileUntilDo:
494
+ Description: 'Checks for redundant do after while or until.'
495
+ Enabled: true
496
+
497
+ WhileUntilModifier:
498
+ Description: >-
499
+ Favor modifier while/until usage when you have a
500
+ single-line body.
501
+ Enabled: true
502
+
503
+ WordArray:
504
+ Description: 'Use %w or %W for arrays of words.'
505
+ Enabled: true
506
+
507
+ #################### Lint ################################
508
+ ### Warnings
509
+
510
+ AmbiguousOperator:
511
+ Description: >-
512
+ Checks for ambiguous operators in the first argument of a
513
+ method invocation without parentheses.
514
+ Enabled: true
515
+
516
+ AmbiguousRegexpLiteral:
517
+ Description: >-
518
+ Checks for ambiguous regexp literals in the first argument of
519
+ a method invocation without parenthesis.
520
+ Enabled: true
521
+
522
+ AssignmentInCondition:
523
+ Description: "Don't use assignment in conditions."
524
+ Enabled: true
525
+
526
+ BlockAlignment:
527
+ Description: 'Align block ends correctly.'
528
+ Enabled: true
529
+
530
+ ConditionPosition:
531
+ Description: 'Checks for condition placed in a confusing position relative to the keyword.'
532
+ Enabled: true
533
+
534
+ Debugger:
535
+ Description: 'Check for debugger calls.'
536
+ Enabled: true
537
+
538
+ ElseLayout:
539
+ Description: 'Check for odd code arrangement in an else block.'
540
+ Enabled: true
541
+
542
+ EmptyEnsure:
543
+ Description: 'Checks for empty ensure block.'
544
+ Enabled: true
545
+
546
+ EndAlignment:
547
+ Description: 'Align ends correctly.'
548
+ Enabled: true
549
+
550
+ EndInMethod:
551
+ Description: 'END blocks should not be placed inside method definitions.'
552
+ Enabled: true
553
+
554
+ EnsureReturn:
555
+ Description: 'Never use return in an ensure block.'
556
+ Enabled: true
557
+
558
+ Eval:
559
+ Description: 'The use of eval represents a serious security risk.'
560
+ Enabled: true
561
+
562
+ HandleExceptions:
563
+ Description: "Don't suppress exception."
564
+ Enabled: true
565
+
566
+ InvalidCharacterLiteral:
567
+ Description: >-
568
+ Checks for invalid character literals with a non-escaped
569
+ whitespace character.
570
+ Enabled: true
571
+
572
+ LiteralInCondition:
573
+ Description: 'Checks of literals used in conditions.'
574
+ Enabled: true
575
+
576
+ Loop:
577
+ Description: >-
578
+ Use Kernel#loop with break rather than begin/end/until or
579
+ begin/end/while for post-loop tests.
580
+ Enabled: true
581
+
582
+ ParenthesesAsGroupedExpression:
583
+ Description: >-
584
+ Checks for method calls with a space before the opening
585
+ parenthesis.
586
+ Enabled: true
587
+
588
+ RequireParentheses:
589
+ Description: >-
590
+ Use parentheses in the method call to avoid confusion
591
+ about precedence.
592
+ Enabled: true
593
+
594
+ RescueException:
595
+ Description: 'Avoid rescuing the Exception class.'
596
+ Enabled: true
597
+
598
+ ShadowingOuterLocalVariable:
599
+ Description: >-
600
+ Do not use the same name as outer local variable
601
+ for block arguments or block local variables.
602
+ Enabled: true
603
+
604
+ UnreachableCode:
605
+ Description: 'Unreachable code.'
606
+ Enabled: true
607
+
608
+ UselessAssignment:
609
+ Description: 'Checks for useless assignment to a local variable.'
610
+ Enabled: true
611
+
612
+ UselessComparison:
613
+ Description: 'Checks for comparison of something with itself.'
614
+ Enabled: true
615
+
616
+ UselessElseWithoutRescue:
617
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
618
+ Enabled: true
619
+
620
+ UselessSetterCall:
621
+ Description: 'Checks for useless setter call to a local variable.'
622
+ Enabled: true
623
+
624
+ Void:
625
+ Description: 'Possible use of operator/literal/variable in void context.'
626
+ Enabled: true
627
+
628
+ ##################### Rails ##################################
629
+
630
+ DefaultScope:
631
+ Description: 'Checks if the argument passed to default_scope is a block.'
632
+ Enabled: true
633
+
634
+ HasAndBelongsToMany:
635
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
636
+ Enabled: true
637
+
638
+ Output:
639
+ Description: 'Checks for calls to puts, print, etc.'
640
+ Enabled: true
641
+
642
+ ReadAttribute:
643
+ Description: 'Prefer self[:attribute] over read_attribute(:attribute).'
644
+ Enabled: true
645
+
646
+ Validation:
647
+ Description: 'Use sexy validations.'
648
+ Enabled: true