rubocop 0.16.0 → 0.17.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.

Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +3 -1
  4. data/CHANGELOG.md +44 -0
  5. data/CONTRIBUTING.md +40 -8
  6. data/Gemfile +6 -0
  7. data/README.md +65 -20
  8. data/Rakefile +0 -1
  9. data/config/default.yml +15 -3
  10. data/config/enabled.yml +143 -109
  11. data/lib/rubocop.rb +45 -26
  12. data/lib/rubocop/cli.rb +26 -27
  13. data/lib/rubocop/config.rb +0 -1
  14. data/lib/rubocop/config_loader.rb +16 -23
  15. data/lib/rubocop/cop/commissioner.rb +2 -7
  16. data/lib/rubocop/cop/cop.rb +24 -51
  17. data/lib/rubocop/cop/ignored_node.rb +31 -0
  18. data/lib/rubocop/cop/lint/ambiguous_operator.rb +50 -0
  19. data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +36 -0
  20. data/lib/rubocop/cop/lint/assignment_in_condition.rb +3 -11
  21. data/lib/rubocop/cop/lint/block_alignment.rb +6 -20
  22. data/lib/rubocop/cop/lint/condition_position.rb +52 -0
  23. data/lib/rubocop/cop/lint/else_layout.rb +57 -0
  24. data/lib/rubocop/cop/lint/end_alignment.rb +33 -8
  25. data/lib/rubocop/cop/lint/invalid_character_literal.rb +37 -0
  26. data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +2 -4
  27. data/lib/rubocop/cop/lint/syntax.rb +6 -12
  28. data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +25 -0
  29. data/lib/rubocop/cop/mixin/array_syntax.rb +20 -0
  30. data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +76 -0
  31. data/lib/rubocop/cop/mixin/check_assignment.rb +26 -0
  32. data/lib/rubocop/cop/{check_methods.rb → mixin/check_methods.rb} +0 -0
  33. data/lib/rubocop/cop/mixin/code_length.rb +33 -0
  34. data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +53 -0
  35. data/lib/rubocop/cop/mixin/configurable_max.rb +19 -0
  36. data/lib/rubocop/cop/mixin/configurable_naming.rb +45 -0
  37. data/lib/rubocop/cop/{style → mixin}/if_node.rb +0 -0
  38. data/lib/rubocop/cop/mixin/if_then_else.rb +23 -0
  39. data/lib/rubocop/cop/mixin/negative_conditional.rb +24 -0
  40. data/lib/rubocop/cop/mixin/parser_diagnostic.rb +34 -0
  41. data/lib/rubocop/cop/mixin/safe_assignment.rb +19 -0
  42. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +32 -0
  43. data/lib/rubocop/cop/mixin/space_inside.rb +31 -0
  44. data/lib/rubocop/cop/mixin/statement_modifier.rb +59 -0
  45. data/lib/rubocop/cop/mixin/string_help.rb +32 -0
  46. data/lib/rubocop/cop/mixin/surrounding_space.rb +42 -0
  47. data/lib/rubocop/cop/rails/default_scope.rb +3 -1
  48. data/lib/rubocop/cop/style/accessor_method_name.rb +4 -12
  49. data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +16 -1
  50. data/lib/rubocop/cop/style/case_indentation.rb +33 -16
  51. data/lib/rubocop/cop/style/character_literal.rb +10 -0
  52. data/lib/rubocop/cop/style/dot_position.rb +23 -6
  53. data/lib/rubocop/cop/style/empty_lines_around_body.rb +5 -5
  54. data/lib/rubocop/cop/style/favor_unless_over_negated_if.rb +1 -32
  55. data/lib/rubocop/cop/style/favor_until_over_negated_while.rb +20 -0
  56. data/lib/rubocop/cop/style/hash_syntax.rb +5 -1
  57. data/lib/rubocop/cop/style/if_unless_modifier.rb +34 -0
  58. data/lib/rubocop/cop/style/if_with_semicolon.rb +1 -1
  59. data/lib/rubocop/cop/style/indentation_consistency.rb +51 -0
  60. data/lib/rubocop/cop/style/indentation_width.rb +0 -26
  61. data/lib/rubocop/cop/style/lambda_call.rb +12 -5
  62. data/lib/rubocop/cop/style/method_def_parentheses.rb +29 -11
  63. data/lib/rubocop/cop/style/multiline_if_then.rb +4 -9
  64. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +22 -0
  65. data/lib/rubocop/cop/style/{ternary_operator.rb → nested_ternary_operator.rb} +0 -15
  66. data/lib/rubocop/cop/style/numeric_literals.rb +30 -2
  67. data/lib/rubocop/cop/style/one_line_conditional.rb +2 -1
  68. data/lib/rubocop/cop/style/parameter_lists.rb +7 -3
  69. data/lib/rubocop/cop/style/parentheses_around_condition.rb +9 -11
  70. data/lib/rubocop/cop/style/predicate_name.rb +4 -12
  71. data/lib/rubocop/cop/style/raise_args.rb +19 -11
  72. data/lib/rubocop/cop/style/regexp_literal.rb +19 -6
  73. data/lib/rubocop/cop/style/space_after_colon.rb +36 -0
  74. data/lib/rubocop/cop/style/space_after_comma.rb +16 -0
  75. data/lib/rubocop/cop/style/space_after_semicolon.rb +16 -0
  76. data/lib/rubocop/cop/style/space_around_block_braces.rb +38 -38
  77. data/lib/rubocop/cop/style/space_around_operators.rb +1 -2
  78. data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +6 -2
  79. data/lib/rubocop/cop/style/string_literals.rb +5 -5
  80. data/lib/rubocop/cop/style/trailing_comma.rb +94 -0
  81. data/lib/rubocop/cop/style/unless_else.rb +2 -2
  82. data/lib/rubocop/cop/style/while_until_modifier.rb +32 -0
  83. data/lib/rubocop/cop/style/word_array.rb +9 -1
  84. data/lib/rubocop/cop/util.rb +14 -0
  85. data/lib/rubocop/cop/variable_inspector.rb +11 -6
  86. data/lib/rubocop/cop/variable_inspector/scope.rb +4 -3
  87. data/lib/rubocop/file_inspector.rb +22 -6
  88. data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
  89. data/lib/rubocop/formatter/colorizable.rb +37 -0
  90. data/lib/rubocop/formatter/disabled_config_formatter.rb +27 -6
  91. data/lib/rubocop/formatter/progress_formatter.rb +1 -1
  92. data/lib/rubocop/formatter/simple_text_formatter.rb +9 -5
  93. data/lib/rubocop/options.rb +19 -4
  94. data/lib/rubocop/target_finder.rb +4 -0
  95. data/lib/rubocop/version.rb +1 -1
  96. data/rubocop-todo.yml +10 -2
  97. data/rubocop.gemspec +3 -2
  98. data/spec/project_spec.rb +12 -7
  99. data/spec/rubocop/cli_spec.rb +262 -99
  100. data/spec/rubocop/config_loader_spec.rb +5 -5
  101. data/spec/rubocop/config_spec.rb +3 -3
  102. data/spec/rubocop/config_store_spec.rb +12 -11
  103. data/spec/rubocop/cop/commissioner_spec.rb +21 -5
  104. data/spec/rubocop/cop/cop_spec.rb +1 -1
  105. data/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +113 -0
  106. data/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +35 -0
  107. data/spec/rubocop/cop/lint/block_alignment_spec.rb +2 -2
  108. data/spec/rubocop/cop/lint/condition_position_spec.rb +49 -0
  109. data/spec/rubocop/cop/lint/else_layout_spec.rb +65 -0
  110. data/spec/rubocop/cop/lint/end_alignment_spec.rb +41 -1
  111. data/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +33 -0
  112. data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +3 -3
  113. data/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +12 -12
  114. data/spec/rubocop/cop/lint/syntax_spec.rb +2 -2
  115. data/spec/rubocop/cop/lint/useless_assignment_spec.rb +72 -54
  116. data/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +48 -0
  117. data/spec/rubocop/cop/offence_spec.rb +1 -1
  118. data/spec/rubocop/cop/rails/default_scope_spec.rb +6 -0
  119. data/spec/rubocop/cop/rails/output_spec.rb +2 -1
  120. data/spec/rubocop/cop/style/align_hash_spec.rb +9 -9
  121. data/spec/rubocop/cop/style/align_parameters_spec.rb +1 -1
  122. data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +5 -0
  123. data/spec/rubocop/cop/style/case_indentation_spec.rb +53 -2
  124. data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +3 -3
  125. data/spec/rubocop/cop/style/documentation_spec.rb +0 -1
  126. data/spec/rubocop/cop/style/dot_position_spec.rb +18 -3
  127. data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +4 -4
  128. data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +13 -0
  129. data/spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb +1 -1
  130. data/spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb +1 -1
  131. data/spec/rubocop/cop/style/hash_syntax_spec.rb +5 -0
  132. data/spec/rubocop/cop/style/{favor_modifier_spec.rb → if_unless_modifier_spec.rb} +4 -111
  133. data/spec/rubocop/cop/style/indentation_consistency_spec.rb +490 -0
  134. data/spec/rubocop/cop/style/indentation_width_spec.rb +19 -91
  135. data/spec/rubocop/cop/style/lambda_call_spec.rb +18 -0
  136. data/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +2 -2
  137. data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +35 -1
  138. data/spec/rubocop/cop/style/method_length_spec.rb +1 -0
  139. data/spec/rubocop/cop/style/method_name_spec.rb +27 -5
  140. data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +4 -4
  141. data/spec/rubocop/cop/style/multiline_if_then_spec.rb +2 -2
  142. data/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +18 -0
  143. data/spec/rubocop/cop/style/{ternary_operator_spec.rb → nested_ternary_operator_spec.rb} +0 -15
  144. data/spec/rubocop/cop/style/numeric_literals_spec.rb +18 -1
  145. data/spec/rubocop/cop/style/one_line_conditional_spec.rb +2 -1
  146. data/spec/rubocop/cop/style/parameter_lists_spec.rb +1 -0
  147. data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +13 -4
  148. data/spec/rubocop/cop/style/raise_args_spec.rb +22 -0
  149. data/spec/rubocop/cop/style/redundant_self_spec.rb +4 -4
  150. data/spec/rubocop/cop/style/regexp_literal_spec.rb +4 -0
  151. data/spec/rubocop/cop/style/space_after_colon_spec.rb +12 -4
  152. data/spec/rubocop/cop/style/space_after_method_name_spec.rb +2 -2
  153. data/spec/rubocop/cop/style/space_around_block_braces_spec.rb +30 -1
  154. data/spec/rubocop/cop/style/{space_around_equals_in_default_parameter_spec.rb → space_around_equals_in_parameter_default_spec.rb} +0 -0
  155. data/spec/rubocop/cop/style/space_around_operators_spec.rb +2 -1
  156. data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +20 -3
  157. data/spec/rubocop/cop/style/string_literals_spec.rb +33 -0
  158. data/spec/rubocop/cop/style/trailing_comma_spec.rb +200 -0
  159. data/spec/rubocop/cop/style/variable_name_spec.rb +27 -3
  160. data/spec/rubocop/cop/style/while_until_modifier_spec.rb +75 -0
  161. data/spec/rubocop/cop/style/word_array_spec.rb +1 -0
  162. data/spec/rubocop/cop/team_spec.rb +1 -1
  163. data/spec/rubocop/cop/variable_inspector/scope_spec.rb +3 -4
  164. data/spec/rubocop/file_inspector_spec.rb +1 -1
  165. data/spec/rubocop/formatter/base_formatter_spec.rb +12 -11
  166. data/spec/rubocop/formatter/colorizable_spec.rb +107 -0
  167. data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +2 -0
  168. data/spec/rubocop/formatter/formatter_set_spec.rb +1 -1
  169. data/spec/rubocop/formatter/json_formatter_spec.rb +4 -3
  170. data/spec/rubocop/formatter/progress_formatter_spec.rb +2 -2
  171. data/spec/rubocop/options_spec.rb +3 -1
  172. data/spec/rubocop/target_finder_spec.rb +13 -11
  173. data/spec/spec_helper.rb +5 -1
  174. data/spec/support/shared_examples.rb +2 -2
  175. data/spec/support/statement_modifier_helper.rb +41 -0
  176. metadata +88 -30
  177. data/lib/rubocop/cop/check_assignment.rb +0 -43
  178. data/lib/rubocop/cop/style/array_syntax.rb +0 -22
  179. data/lib/rubocop/cop/style/autocorrect_alignment.rb +0 -78
  180. data/lib/rubocop/cop/style/code_length.rb +0 -35
  181. data/lib/rubocop/cop/style/configurable_enforced_style.rb +0 -51
  182. data/lib/rubocop/cop/style/configurable_max.rb +0 -17
  183. data/lib/rubocop/cop/style/configurable_naming.rb +0 -41
  184. data/lib/rubocop/cop/style/favor_modifier.rb +0 -118
  185. data/lib/rubocop/cop/style/if_then_else.rb +0 -27
  186. data/lib/rubocop/cop/style/space_after_comma_etc.rb +0 -73
  187. data/lib/rubocop/cop/style/space_inside.rb +0 -33
  188. data/lib/rubocop/cop/style/string_help.rb +0 -30
  189. data/lib/rubocop/cop/style/surrounding_space.rb +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1d53b4bf428418ce94f9957624298881e744d48
4
- data.tar.gz: a8da381882375f2f62d9209a0c8b27bfae1647fe
3
+ metadata.gz: 552c566c61ce3c52d1ce2a3e7eaaf49e44c3713b
4
+ data.tar.gz: bf4a50153a0972e4bc98c07824a4172832167efd
5
5
  SHA512:
6
- metadata.gz: e77ffc73a8976e35a4fe77c8c95c84b9f15e46e83b43f559808736c236b6dbbdf07467c627e3fcce1f3ff730aa75b03222482d00d3da0122efeb3e163fe1fdd9
7
- data.tar.gz: 100c16f188ae13fdbcb70393b966b559a839325a6c0531c2628385910567d6383059d8c049e2fff43857f32f16b319cd15994f3adf13704877daf239f5e62b93
6
+ metadata.gz: 59e5976c14e691499c402cbf1200373c0eace5e5304d6a54af9d976818f56a6d1ed27f4634256fcd32ddbeff428f1f265840150a88cf7ce461caf98d561285af
7
+ data.tar.gz: 43c064daba533bbbfcaaace9f57849db7ebb4b7baa154327f777fcc34eb499139161e5d21fcc28bd42e8309109b63b28f3adceffbf644f5a72ff348d75c14d84
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ doc
12
12
  # bundler
13
13
  .bundle
14
14
  Gemfile.lock
15
+ Gemfile.local
15
16
 
16
17
  # jeweler generated
17
18
  pkg
@@ -1,10 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.9.2
3
4
  - 1.9.3
4
5
  - 2.0.0
5
- - 2.1.0-rc1
6
+ - 2.1.0
6
7
  - jruby-19mode
7
8
  - rbx-2.1.1
9
+ before_install: gem update --remote bundler
8
10
  script:
9
11
  - bundle exec rspec
10
12
  - bundle exec rubocop
@@ -2,6 +2,47 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.17.0 (25/01/2014)
6
+
7
+ ### New features
8
+
9
+ * New cop `ConditionPosition` checks for misplaced conditions in expressions like `if/unless/when/until`. ([@bbatsov][])
10
+ * New cop `ElseLayout` checks for odd arrangement of code in the `else` branch of a conditional expression. ([@bbatsov][])
11
+ * [#694](https://github.com/bbatsov/rubocop/issues/694): Support Ruby 1.9.2 until June 2014. ([@yujinakayama][])
12
+ * [#702](https://github.com/bbatsov/rubocop/issues/702): Improve `rubocop-todo.yml` with comments about offence count, configuration parameters, and auto-correction support. ([@jonas054][])
13
+ * Add new command-line flag `-D/--display-cop-names` to trigger the display of cop names in offence messages. ([@bbatsov][])
14
+ * [#733](https://github.com/bbatsov/rubocop/pull/733): `NumericLiterals` cop does auto-correction. ([@dblock][])
15
+ * [#713](https://github.com/bbatsov/rubocop/issues/713): New cop `TrailingComma` checks for comma after the last item in a hash, array, or method call parameter list. ([@jonas054][])
16
+
17
+ ### Changes
18
+
19
+ * [581](https://github.com/bbatsov/rubocop/pull/581): Extracted a new cop `AmbiguousOperator` from `Syntax` cop. It checks for ambiguous operators in the first argument of a method invocation without parentheses. ([@yujinakayama][])
20
+ * Extracted a new cop `AmbiguousRegexpLiteral` from `Syntax` cop. It checks for ambiguous regexp literals in the first argument of a method invocation without parentheses. ([@yujinakayama][])
21
+ * Extracted a new cop `UselessElseWithoutRescue` from `Syntax` cop. It checks for useless `else` in `begin..end` without `rescue`. ([@yujinakayama][])
22
+ * Extracted a new cop `InvalidCharacterLiteral` from `Syntax` cop. It checks for invalid character literals with a non-escaped whitespace character (e.g. `? `). ([@yujinakayama][])
23
+ * Removed `Syntax` cop from the configuration. It no longer can be disabled and it reports only invalid syntax offences. ([@yujinakayama][])
24
+ * [#688](https://github.com/bbatsov/rubocop/issues/688): Output from `rubocop --show-cops` now looks like a YAML configuration file. The `--show-cops` option takes a comma separated list of cops as optional argument. ([@jonas054][])
25
+ * New cop `IndentationConsistency` extracted from `IndentationWidth`, which has checked two kinds of offences until now. ([@jonas054][])
26
+
27
+ ### Bugs fixed
28
+
29
+ * [#698](https://github.com/bbatsov/rubocop/pull/698): Support Windows paths on command-line. ([@rifraf][])
30
+ * [#498](https://github.com/bbatsov/rubocop/issues/498): Disable terminal ANSI escape sequences when a formatter's output is not a TTY. ([@yujinakayama][])
31
+ * [#703](https://github.com/bbatsov/rubocop/issues/703): BracesAroundHashParameters auto-correction broken with trailing comma. ([@jonas054][])
32
+ * [#709](https://github.com/bbatsov/rubocop/issues/709): When `EndAlignment` has configuration `AlignWith: variable`, it now handles `@@a = if ...` and `a, b = if ...`. ([@jonas054][])
33
+ * `SpaceAroundOperators` now reports an offence for `@@a=0`. ([@jonas054][])
34
+ * [#707](https://github.com/bbatsov/rubocop/issues/707): Fix error on operator assignments in top level scope in `UselessAssignment`. ([@yujinakayama][])
35
+ * Fix a bug where some offences were discarded when any cop that has specific target file path (by `Include` or `Exclude` under each cop configuration) had run. ([@yujinakayama][])
36
+ * [#724](https://github.com/bbatsov/rubocop/issues/724): Accept colons denoting required keyword argument (a new feature in Ruby 2.1) without trailing space in `SpaceAfterColon`. ([@jonas054][])
37
+ * The `--no-color` option works again. ([@jonas054][])
38
+ * [#716](https://github.com/bbatsov/rubocop/issues/716): Fixed a regression in the auto-correction logic of `MethodDefParentheses`. ([@bbatsov][])
39
+ * Inspected projects that lack a `.rubocop.yml` file, and therefore get their configuration from RuboCop's `config/default.yml`, no longer get configuration from RuboCop's `.rubocop.yml` and `rubocop-todo.yml`. ([@jonas054][])
40
+ * [#730](https://github.com/bbatsov/rubocop/issues/730): `EndAlignment` now handles for example `private def some_method`, which is allowed in Ruby 2.1. It requires `end` to be aligned with `private`, not `def`, in such cases. ([@jonas054][])
41
+ * [#744](https://github.com/bbatsov/rubocop/issues/744): Any new offences created by `--auto-correct` are now handled immediately and corrected when possible, so running `--auto-correct` once is enough. ([@jonas054][])
42
+ * [#748](https://github.com/bbatsov/rubocop/pull/748): Auto-correction conflict between `EmptyLinesAroundBody` and `TrailingWhitespace` resolved. ([@jonas054][])
43
+ * `ParenthesesAroundCondition` no longer crashes on parentheses around the condition in a ternary if. ([@jonas054][])
44
+ * [#738](https://github.com/bbatsov/rubocop/issues/738): Fix a false positive in `StringLiterals`. ([@bbatsov][])
45
+
5
46
  ## 0.16.0 (25/12/2013)
6
47
 
7
48
  ### New features
@@ -25,6 +66,7 @@
25
66
  * [#693](https://github.com/bbatsov/rubocop/pull/693): Generation of parameter values (i.e., not only `Enabled: false`) in `rubocop-todo.yml` by the `--auto-gen-config` option is now supported for some cops. ([@jonas054][])
26
67
  * New cop `AccessorMethodName` checks accessor method names for non-idiomatic names like `get_attribute` and `set_attribute`. ([@bbatsov][])
27
68
  * New cop `PredicateName` checks the names of predicate methods for non-idiomatic names like `is_something`, `has_something`, etc. ([@bbatsov][])
69
+ * Support Ruby 2.1 with Parser 2.1. ([@yujinakayama][])
28
70
 
29
71
  ### Changes
30
72
 
@@ -612,3 +654,5 @@
612
654
  [@codez]: https://github.com/codez
613
655
  [@emou]: https://github.com/emou
614
656
  [@skanev]: http://github.com/skanev
657
+ [@claco]: http://github.com/claco
658
+ [@rifraf]: http://github.com/rifraf
@@ -1,11 +1,34 @@
1
- # Contributing to RuboCop
1
+ # Contributing
2
2
 
3
- * Check out the latest master to make sure the feature hasn't been
4
- implemented or the bug hasn't been fixed yet.
5
- * Check out the issue tracker to make sure someone already hasn't
6
- requested it and/or contributed it.
3
+ If you discover issues, have ideas for improvements or new features,
4
+ please report them to the [issue tracker][1] of the repository or
5
+ submit a pull request. Please, try to follow these guidelines when you
6
+ do so.
7
+
8
+ ## Issue reporting
9
+
10
+ * Check that the issue has not already been reported.
11
+ * Check that the issue has not already been fixed in the latest code
12
+ (a.k.a. `master`).
13
+ * Be clear, concise and precise in your description of the problem.
14
+ * Open an issue with a descriptive title and a summary in grammatically correct,
15
+ complete sentences.
16
+ * Include the output of `rubocop -v`:
17
+
18
+ ```
19
+ $ rubocop -V
20
+ 0.16.0 (using Parser 2.1.2, running on ruby 2.0.0 x86_64-darwin12.4.0)
21
+ ```
22
+
23
+ * Include any relevant code to the issue summary.
24
+
25
+ ## Pull requests
26
+
27
+ * Read [how to properly contribute to open source projects on Github][2].
7
28
  * Fork the project.
8
- * Start a feature/bugfix branch.
29
+ * Use a topic/feature branch to easily amend a pull request later, if necessary.
30
+ * Write [good commit messages][3].
31
+ * Use the same coding conventions as the rest of the project.
9
32
  * Commit and push until you are happy with your contribution.
10
33
  * Make sure to add tests for it. This is important so I don't break it
11
34
  in a future version unintentionally.
@@ -14,5 +37,14 @@
14
37
  you want to have your own version, or is otherwise necessary, that
15
38
  is fine, but please isolate to its own commit so I can cherry-pick
16
39
  around it.
17
- * Squash your commits.
18
- * Create a pull-request.
40
+ * Make sure the test suite is passing and the code you wrote doesn't produce
41
+ RuboCop offences.
42
+ * [Squash related commits together][5].
43
+ * Open a [pull request][4] that relates to *only* one subject with a clear title
44
+ and description in grammatically correct, complete sentences.
45
+
46
+ [1]: https://github.com/clojure-emacs/cider/issues
47
+ [2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
48
+ [3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
49
+ [4]: https://help.github.com/articles/using-pull-requests
50
+ [5]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
data/Gemfile CHANGED
@@ -8,3 +8,9 @@ group :test do
8
8
  gem 'racc', platform: :rbx
9
9
  gem 'coveralls', require: false
10
10
  end
11
+
12
+ local_gemfile = 'Gemfile.local'
13
+
14
+ if File.exist?(local_gemfile)
15
+ eval(File.read(local_gemfile)) # rubocop:disable Eval
16
+ end
data/README.md CHANGED
@@ -19,6 +19,43 @@ Most aspects of its behavior can be tweaked via various
19
19
  Apart from reporting problems in your code, RuboCop can also
20
20
  automatically fix some of the problems for you.
21
21
 
22
+ - [Installation](#installation)
23
+ - [Basic Usage](#basic-usage)
24
+ - [Cops](#cops)
25
+ - [Style](#style)
26
+ - [Lint](#lint)
27
+ - [Rails](#rails)
28
+ - [Configuration](#configuration)
29
+ - [Inheritance](#inheritance)
30
+ - [Defaults](#defaults)
31
+ - [Including/Excluding files](#includingexcluding-files)
32
+ - [Automatically Generated Configuration](#automatically-generated-configuration)
33
+ - [Disabling Cops within Source Code](#disabling-cops-within-source-code)
34
+ - [Formatters](#formatters)
35
+ - [Clang Formatter (default)](#clang-formatter-default)
36
+ - [Emacs](#emacs)
37
+ - [Simple](#simple)
38
+ - [File List Formatter](#file-list-formatter)
39
+ - [JSON Formatter](#json-formatter)
40
+ - [OffenceCount Formatter](#offencecount-formatter)
41
+ - [Custom Formatters](#custom-formatters)
42
+ - [Creating Custom Formatter](#creating-custom-formatter)
43
+ - [Using Custom Formatter in Command Line](#using-custom-formatter-in-command-line)
44
+ - [Compatibility](#compatibility)
45
+ - [Editor integration](#editor-integration)
46
+ - [Emacs](#emacs-1)
47
+ - [Vim](#vim)
48
+ - [Sublime Text 2](#sublime-text-2)
49
+ - [Brackets](#brackets)
50
+ - [Other Editors](#other-editors)
51
+ - [Guard integration](#guard-integration)
52
+ - [Rake integration](#rake-integration)
53
+ - [Team](#team)
54
+ - [Contributors](#contributors)
55
+ - [Mailing List](#mailing-list)
56
+ - [Changelog](#changelog)
57
+ - [Copyright](#copyright)
58
+
22
59
  ## Installation
23
60
 
24
61
  **RuboCop**'s installation is pretty standard:
@@ -76,21 +113,22 @@ For more details check the available command-line options:
76
113
  $ rubocop -h
77
114
  ```
78
115
 
79
- Command flag | Description
80
- -----------------------|------------------------------------------------------------
81
- `-v/--version` | Displays the current version and exits
82
- `-V/--verbose-version` | Displays the current version plus the version of Parser and Ruby
83
- `-d/--debug` | Displays some extra debug output
84
- `-c/--config` | Run with specified config file
85
- `-f/--format` | Choose a formatter
86
- `-o/--out` | Write output to a file instead of STDOUT
87
- `-r/--require` | Require Ruby file
88
- `-R/--rails` | Run extra Rails cops
89
- `-l/--lint` | Run only lint cops
90
- `-a/--auto-correct` | Auto-correct certain offences *Note:* Experimental - use with caution
91
- `--only` | Run only the specified cop
92
- `--auto-gen-config` | Generate a configuration file acting as a TODO list
93
- `--show-cops` | Shows available cops and their configuration
116
+ Command flag | Description
117
+ --------------------------|------------------------------------------------------------
118
+ `-v/--version` | Displays the current version and exits
119
+ `-V/--verbose-version` | Displays the current version plus the version of Parser and Ruby
120
+ `-d/--debug` | Displays some extra debug output
121
+ `-D/--display-cop-names` | Displays cop names in offence messages.
122
+ `-c/--config` | Run with specified config file
123
+ `-f/--format` | Choose a formatter
124
+ `-o/--out` | Write output to a file instead of STDOUT
125
+ `-r/--require` | Require Ruby file
126
+ `-R/--rails` | Run extra Rails cops
127
+ `-l/--lint` | Run only lint cops
128
+ `-a/--auto-correct` | Auto-correct certain offences *Note:* Experimental - use with caution
129
+ `--only` | Run only the specified cop
130
+ `--auto-gen-config` | Generate a configuration file acting as a TODO list
131
+ `--show-cops` | Shows available cops and their configuration
94
132
 
95
133
  ### Cops
96
134
 
@@ -199,6 +237,7 @@ AllCops:
199
237
  - db/**
200
238
  - config/**
201
239
  - script/**
240
+ - !ruby/regexp /old_and_unused\.rb$/
202
241
 
203
242
  # other configuration
204
243
  # ...
@@ -324,7 +363,7 @@ rubocop --format emacs test.rb
324
363
  1 file inspected, 3 offences detected
325
364
  ```
326
365
 
327
- ### Simple (default in RuboCop prior to version 0.9)
366
+ ### Simple
328
367
 
329
368
  The name of the formatter says it all :-)
330
369
 
@@ -456,8 +495,14 @@ or absolute path.
456
495
 
457
496
  ## Compatibility
458
497
 
459
- RuboCop supported only MRI 1.9 & MRI 2.0 prior to version 0.8. After
460
- RuboCop 0.8, JRuby and Rubinius in 1.9 modes are also supported.
498
+ RuboCop supports the following Ruby implementations:
499
+
500
+ * MRI 1.9.2 ([until June 2014](https://www.ruby-lang.org/en/news/2013/12/17/maintenance-of-1-8-7-and-1-9-2/))
501
+ * MRI 1.9.3
502
+ * MRI 2.0
503
+ * MRI 2.1
504
+ * JRuby in 1.9 mode
505
+ * Rubinius 2.0+
461
506
 
462
507
  ## Editor integration
463
508
 
@@ -478,9 +523,9 @@ RuboCop and displays the results in Vim.
478
523
  There's also a RuboCop checker in
479
524
  [syntastic](https://github.com/scrooloose/syntastic).
480
525
 
481
- ### Sublime Text 2
526
+ ### Sublime Text
482
527
 
483
- If you're a ST2 user you might find the
528
+ If you're a ST user you might find the
484
529
  [Sublime RuboCop plugin](https://github.com/pderichs/sublime_rubocop)
485
530
  useful.
486
531
 
data/Rakefile CHANGED
@@ -32,5 +32,4 @@ task default: [:spec, :internal_investigation]
32
32
  require 'yard'
33
33
  YARD::Rake::YardocTask.new
34
34
 
35
- require 'rubocop/rake_task'
36
35
  Rubocop::RakeTask.new
@@ -65,8 +65,10 @@ BracesAroundHashParameters:
65
65
 
66
66
  # Indentation of `when`.
67
67
  CaseIndentation:
68
- # Valid values are: case, end
69
68
  IndentWhenRelativeTo: case
69
+ SupportedStyles:
70
+ - case
71
+ - end
70
72
  IndentOneStep: false
71
73
 
72
74
  ClassLength:
@@ -97,7 +99,10 @@ CyclomaticComplexity:
97
99
 
98
100
  # Multi-line method chaining should be done with leading dots.
99
101
  DotPosition:
100
- Style: 'leading'
102
+ Style: leading
103
+ SupportedStyles:
104
+ - leading
105
+ - trailing
101
106
 
102
107
  # Use empty lines between defs.
103
108
  EmptyLineBetweenDefs:
@@ -107,13 +112,15 @@ EmptyLineBetweenDefs:
107
112
 
108
113
  # Align ends correctly.
109
114
  EndAlignment:
110
- # Valid valued are: keyword, variable
111
115
  # The value `keyword` means that `end` should be aligned with the matching
112
116
  # keyword (if, while, etc.).
113
117
  # The value `variable` means that in assignments, `end` should be aligned
114
118
  # with the start of the variable on the left hand side of `=`. In all other
115
119
  # situations, `end` should still be aligned with the keyword.
116
120
  AlignWith: keyword
121
+ SupportedStyles:
122
+ - keyword
123
+ - variable
117
124
 
118
125
  # Checks use of for or each in multiline loops.
119
126
  For:
@@ -242,6 +249,11 @@ SpaceInsideHashLiteralBraces:
242
249
  - space
243
250
  - no_space
244
251
 
252
+ TrailingComma:
253
+ EnforcedStyleForMultiline: no_comma
254
+ SupportedStyles:
255
+ - comma
256
+ - no_comma
245
257
 
246
258
  # TrivialAccessors doesn't require exact name matches and doesn't allow
247
259
  # predicated methods by default.
@@ -13,19 +13,19 @@ Alias:
13
13
  Enabled: true
14
14
 
15
15
  AlignArray:
16
- Description: >
16
+ Description: >-
17
17
  Align the elements of an array literal if they span more than
18
18
  one line.
19
19
  Enabled: true
20
20
 
21
21
  AlignHash:
22
- Description: >
22
+ Description: >-
23
23
  Align the elements of a hash literal if they span more than
24
24
  one line.
25
25
  Enabled: true
26
26
 
27
27
  AlignParameters:
28
- Description: >
28
+ Description: >-
29
29
  Align the parameters of a method call if they span more
30
30
  than one line.
31
31
  Enabled: true
@@ -34,14 +34,14 @@ AndOr:
34
34
  Description: 'Use &&/|| instead of and/or.'
35
35
  Enabled: true
36
36
 
37
- AsciiIdentifiers:
38
- Description: 'Use only ascii symbols in identifiers.'
39
- Enabled: true
40
-
41
37
  AsciiComments:
42
38
  Description: 'Use only ascii symbols in comments.'
43
39
  Enabled: true
44
40
 
41
+ AsciiIdentifiers:
42
+ Description: 'Use only ascii symbols in identifiers.'
43
+ Enabled: true
44
+
45
45
  Attr:
46
46
  Description: 'Checks for uses of Module#attr.'
47
47
  Enabled: true
@@ -50,13 +50,6 @@ BeginBlock:
50
50
  Description: 'Avoid the use of BEGIN blocks.'
51
51
  Enabled: true
52
52
 
53
- Blocks:
54
- Description: >
55
- Avoid using {...} for multi-line blocks (multiline chaining is
56
- always ugly).
57
- Prefer {...} over do...end for single-line blocks.
58
- Enabled: true
59
-
60
53
  BlockComments:
61
54
  Description: 'Do not use block comments.'
62
55
  Enabled: true
@@ -65,6 +58,17 @@ BlockNesting:
65
58
  Description: 'Avoid excessive block nesting'
66
59
  Enabled: true
67
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
+
68
72
  CaseEquality:
69
73
  Description: 'Avoid explicit use of the case equality operator(===).'
70
74
  Enabled: true
@@ -77,14 +81,14 @@ CharacterLiteral:
77
81
  Description: 'Checks for uses of character literals.'
78
82
  Enabled: true
79
83
 
80
- ClassLength:
81
- Description: 'Avoid classes longer than 100 lines of code.'
82
- Enabled: true
83
-
84
84
  ClassAndModuleCamelCase:
85
85
  Description: 'Use CamelCase for classes and modules.'
86
86
  Enabled: true
87
87
 
88
+ ClassLength:
89
+ Description: 'Avoid classes longer than 100 lines of code.'
90
+ Enabled: true
91
+
88
92
  ClassMethods:
89
93
  Description: 'Use self when defining module/class methods.'
90
94
  Enabled: true
@@ -101,6 +105,12 @@ ColonMethodCall:
101
105
  Description: 'Do not use :: for method call.'
102
106
  Enabled: true
103
107
 
108
+ CommentAnnotation:
109
+ Description: >-
110
+ Checks formatting of special comments
111
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
112
+ Enabled: true
113
+
104
114
  ConstantName:
105
115
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
106
116
  Enabled: true
@@ -121,6 +131,10 @@ DotPosition:
121
131
  Description: 'Checks the position of the dot in multi-line method calls.'
122
132
  Enabled: true
123
133
 
134
+ EmptyLineBetweenDefs:
135
+ Description: 'Use empty lines between defs.'
136
+ Enabled: true
137
+
124
138
  EmptyLines:
125
139
  Description: "Don't use several empty lines in a row."
126
140
  Enabled: true
@@ -130,11 +144,7 @@ EmptyLinesAroundAccessModifier:
130
144
  Enabled: true
131
145
 
132
146
  EmptyLinesAroundBody:
133
- Description: "Keeps track of blank lines around expression bodies."
134
- Enabled: true
135
-
136
- EmptyLineBetweenDefs:
137
- Description: 'Use empty lines between defs.'
147
+ Description: "Keeps track of empty lines around expression bodies."
138
148
  Enabled: true
139
149
 
140
150
  EmptyLiteral:
@@ -153,14 +163,6 @@ EndOfLine:
153
163
  Description: 'Use Unix-style line endings.'
154
164
  Enabled: true
155
165
 
156
- EnsureReturn:
157
- Description: 'Never use return in an ensure block.'
158
- Enabled: true
159
-
160
- Eval:
161
- Description: 'The use of eval represents a serious security risk.'
162
- Enabled: true
163
-
164
166
  EvenOdd:
165
167
  Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
166
168
  Enabled: true
@@ -174,7 +176,7 @@ FavorSprintf:
174
176
  Enabled: true
175
177
 
176
178
  FavorUnlessOverNegatedIf:
177
- Description: >
179
+ Description: >-
178
180
  Favor unless over if for negative conditions
179
181
  (or control flow or).
180
182
  Enabled: true
@@ -199,28 +201,28 @@ GlobalVars:
199
201
  Description: 'Do not introduce global variables.'
200
202
  Enabled: true
201
203
 
202
- HandleExceptions:
203
- Description: "Don't suppress exception."
204
- Enabled: true
205
-
206
204
  HashMethods:
207
205
  Description: 'Checks for use of deprecated Hash methods.'
208
206
  Enabled: true
209
207
 
210
208
  HashSyntax:
211
- Description: >
209
+ Description: >-
212
210
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
213
211
  { :a => 1, :b => 2 }.
214
212
  Enabled: true
215
213
 
214
+ IfUnlessModifier:
215
+ Description: >-
216
+ Favor modifier if/unless usage when you have a
217
+ single-line body.
218
+ Enabled: true
219
+
216
220
  IfWithSemicolon:
217
221
  Description: 'Never use if x; .... Use the ternary operator instead.'
218
222
  Enabled: true
219
223
 
220
- IfUnlessModifier:
221
- Description: >
222
- Favor modifier if/unless usage when you have a
223
- single-line body.
224
+ IndentationConsistency:
225
+ Description: 'Keep indentation straight.'
224
226
  Enabled: true
225
227
 
226
228
  IndentationWidth:
@@ -235,18 +237,12 @@ LambdaCall:
235
237
  Description: 'Use lambda.call(...) instead of lambda.(...).'
236
238
  Enabled: true
237
239
 
238
- LineLength:
239
- Description: 'Limit lines to 79 characters.'
240
- Enabled: true
241
-
242
240
  LeadingCommentSpace:
243
241
  Description: 'Comments should start with a space.'
244
242
  Enabled: true
245
243
 
246
- Loop:
247
- Description: >
248
- Use Kernel#loop with break rather than begin/end/until or
249
- begin/end/while for post-loop tests.
244
+ LineLength:
245
+ Description: 'Limit lines to 79 characters.'
250
246
  Enabled: true
251
247
 
252
248
  MethodCallParentheses:
@@ -254,7 +250,7 @@ MethodCallParentheses:
254
250
  Enabled: true
255
251
 
256
252
  MethodDefParentheses:
257
- Description: >
253
+ Description: >-
258
254
  Checks if the method definitions have or don't have
259
255
  parentheses.
260
256
  Enabled: true
@@ -280,7 +276,7 @@ MultilineIfThen:
280
276
  Enabled: true
281
277
 
282
278
  MultilineTernaryOperator:
283
- Description: >
279
+ Description: >-
284
280
  Avoid multi-line ?: (the ternary operator);
285
281
  use if/unless instead.
286
282
  Enabled: true
@@ -298,13 +294,13 @@ Not:
298
294
  Enabled: true
299
295
 
300
296
  NumericLiterals:
301
- Description: >
297
+ Description: >-
302
298
  Add underscores to large numeric literals to improve their
303
299
  readability.
304
300
  Enabled: true
305
301
 
306
302
  OneLineConditional:
307
- Description: >
303
+ Description: >-
308
304
  Favor the ternary operator(?:) over
309
305
  if/then/else/end constructs.
310
306
  Enabled: true
@@ -318,7 +314,7 @@ ParameterLists:
318
314
  Enabled: true
319
315
 
320
316
  ParenthesesAroundCondition:
321
- Description: >
317
+ Description: >-
322
318
  Don't use parentheses around the condition of an
323
319
  if/unless/while.
324
320
  Enabled: true
@@ -347,16 +343,16 @@ RedundantException:
347
343
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
348
344
  Enabled: true
349
345
 
350
- RedundantSelf:
351
- Description: "Don't use self where it's not needed."
352
- Enabled: true
353
-
354
346
  RedundantReturn:
355
347
  Description: "Don't use return where it's not required."
356
348
  Enabled: true
357
349
 
350
+ RedundantSelf:
351
+ Description: "Don't use self where it's not needed."
352
+ Enabled: true
353
+
358
354
  RegexpLiteral:
359
- Description: >
355
+ Description: >-
360
356
  Use %r for regular expressions matching more than
361
357
  `MaxSlashes` '/' characters.
362
358
  Use %r only for regular expressions matching more than
@@ -367,10 +363,6 @@ RescueModifier:
367
363
  Description: 'Avoid using rescue in its modifier form.'
368
364
  Enabled: true
369
365
 
370
- RescueException:
371
- Description: 'Avoid rescuing the Exception class.'
372
- Enabled: true
373
-
374
366
  Semicolon:
375
367
  Description: "Don't use semicolons to terminate expressions."
376
368
  Enabled: true
@@ -387,25 +379,6 @@ SingleLineMethods:
387
379
  Description: 'Avoid single-line methods.'
388
380
  Enabled: true
389
381
 
390
- SpaceAroundOperators:
391
- Description: 'Use spaces around operators.'
392
- Enabled: true
393
-
394
- SpaceAroundBlockBraces:
395
- Description: >
396
- Checks that block braces have or don't have surrounding space.
397
- For blocks taking parameters, checks that the left brace has
398
- or doesn't have trailing space.
399
- Enabled: true
400
-
401
- SpaceInsideParens:
402
- Description: 'No spaces after ( or before ).'
403
- Enabled: true
404
-
405
- SpaceInsideBrackets:
406
- Description: 'No spaces after [ or before ].'
407
- Enabled: true
408
-
409
382
  SpaceAfterColon:
410
383
  Description: 'Use spaces after colons.'
411
384
  Enabled: true
@@ -419,7 +392,7 @@ SpaceAfterControlKeyword:
419
392
  Enabled: true
420
393
 
421
394
  SpaceAfterMethodName:
422
- Description: >
395
+ Description: >-
423
396
  Never put a space between a method name and the opening
424
397
  parenthesis.
425
398
  Enabled: true
@@ -432,20 +405,39 @@ SpaceAfterSemicolon:
432
405
  Description: 'Use spaces after semicolons.'
433
406
  Enabled: true
434
407
 
408
+ SpaceAroundBlockBraces:
409
+ Description: >-
410
+ Checks that block braces have or don't have surrounding space.
411
+ For blocks taking parameters, checks that the left brace has
412
+ or doesn't have trailing space.
413
+ Enabled: true
414
+
435
415
  SpaceAroundEqualsInParameterDefault:
436
- Description: >
416
+ Description: >-
437
417
  Use spaces around the = operator when assigning default
438
418
  values in def params.
439
419
  Enabled: true
440
420
 
421
+ SpaceAroundOperators:
422
+ Description: 'Use spaces around operators.'
423
+ Enabled: true
424
+
441
425
  SpaceBeforeModifierKeyword:
442
426
  Description: 'Put a space before the modifier keyword.'
443
427
  Enabled: true
444
428
 
429
+ SpaceInsideBrackets:
430
+ Description: 'No spaces after [ or before ].'
431
+ Enabled: true
432
+
445
433
  SpaceInsideHashLiteralBraces:
446
434
  Description: "Use spaces inside hash literal braces - or don't."
447
435
  Enabled: true
448
436
 
437
+ SpaceInsideParens:
438
+ Description: 'No spaces after ( or before ).'
439
+ Enabled: true
440
+
449
441
  SpecialGlobalVars:
450
442
  Description: 'Avoid Perl-style global variables.'
451
443
  Enabled: true
@@ -459,7 +451,11 @@ Tab:
459
451
  Enabled: true
460
452
 
461
453
  TrailingBlankLines:
462
- Description: 'Checks for superflous trailing blank lines.'
454
+ Description: 'Checks for superfluous trailing blank lines.'
455
+ Enabled: true
456
+
457
+ TrailingComma:
458
+ Description: 'Checks for trailing comma in parameter lists and literals.'
463
459
  Enabled: true
464
460
 
465
461
  TrailingWhitespace:
@@ -471,13 +467,13 @@ TrivialAccessors:
471
467
  Enabled: true
472
468
 
473
469
  UnlessElse:
474
- Description: >
470
+ Description: >-
475
471
  Never use unless with else. Rewrite these with the positive
476
472
  case first.
477
473
  Enabled: true
478
474
 
479
475
  VariableInterpolation:
480
- Description: >
476
+ Description: >-
481
477
  Don't interpolate global, instance and class variables
482
478
  directly in strings.
483
479
  Enabled: true
@@ -490,8 +486,12 @@ WhenThen:
490
486
  Description: 'Use when x then ... for one-line cases.'
491
487
  Enabled: true
492
488
 
489
+ WhileUntilDo:
490
+ Description: 'Checks for redundant do after while or until.'
491
+ Enabled: true
492
+
493
493
  WhileUntilModifier:
494
- Description: >
494
+ Description: >-
495
495
  Favor modifier while/until usage when you have a
496
496
  single-line body.
497
497
  Enabled: true
@@ -500,16 +500,20 @@ WordArray:
500
500
  Description: 'Use %w or %W for arrays of words.'
501
501
  Enabled: true
502
502
 
503
- WhileUntilDo:
504
- Description: 'Checks for redundant do after while or until.'
505
- Enabled: true
503
+ #################### Lint ################################
504
+ ### Warnings
506
505
 
507
- BracesAroundHashParameters:
508
- Description: 'Enforce braces style inside hash parameters.'
506
+ AmbiguousOperator:
507
+ Description: >-
508
+ Checks for ambiguous operators in the first argument of a
509
+ method invocation without parentheses.
509
510
  Enabled: true
510
511
 
511
- #################### Lint ################################
512
- ### Warnings
512
+ AmbiguousRegexpLiteral:
513
+ Description: >-
514
+ Checks for ambiguous regexp literals in the first argument of
515
+ a method invocation without parenthesis.
516
+ Enabled: true
513
517
 
514
518
  AssignmentInCondition:
515
519
  Description: "Don't use assignment in conditions."
@@ -519,16 +523,18 @@ BlockAlignment:
519
523
  Description: 'Align block ends correctly.'
520
524
  Enabled: true
521
525
 
522
- CommentAnnotation:
523
- Description: >
524
- Checks formatting of special comments
525
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
526
+ ConditionPosition:
527
+ Description: 'Checks for condition placed in a confusing position relative to the keyword.'
526
528
  Enabled: true
527
529
 
528
530
  Debugger:
529
531
  Description: 'Check for debugger calls.'
530
532
  Enabled: true
531
533
 
534
+ ElseLayout:
535
+ Description: 'Check for odd code arrangement in an else block.'
536
+ Enabled: true
537
+
532
538
  EmptyEnsure:
533
539
  Description: 'Checks for empty ensure block.'
534
540
  Enabled: true
@@ -541,26 +547,50 @@ EndInMethod:
541
547
  Description: 'END blocks should not be placed inside method definitions.'
542
548
  Enabled: true
543
549
 
550
+ EnsureReturn:
551
+ Description: 'Never use return in an ensure block.'
552
+ Enabled: true
553
+
554
+ Eval:
555
+ Description: 'The use of eval represents a serious security risk.'
556
+ Enabled: true
557
+
558
+ HandleExceptions:
559
+ Description: "Don't suppress exception."
560
+ Enabled: true
561
+
562
+ InvalidCharacterLiteral:
563
+ Description: >-
564
+ Checks for invalid character literals with a non-escaped
565
+ whitespace character.
566
+ Enabled: true
567
+
544
568
  LiteralInCondition:
545
569
  Description: 'Checks of literals used in conditions.'
546
570
  Enabled: true
547
571
 
572
+ Loop:
573
+ Description: >-
574
+ Use Kernel#loop with break rather than begin/end/until or
575
+ begin/end/while for post-loop tests.
576
+ Enabled: true
577
+
548
578
  ParenthesesAsGroupedExpression:
549
- Description: >
579
+ Description: >-
550
580
  Checks for method calls with a space before the opening
551
581
  parenthesis.
552
582
  Enabled: true
553
583
 
584
+ RescueException:
585
+ Description: 'Avoid rescuing the Exception class.'
586
+ Enabled: true
587
+
554
588
  ShadowingOuterLocalVariable:
555
- Description: >
589
+ Description: >-
556
590
  Do not use the same name as outer local variable
557
591
  for block arguments or block local variables.
558
592
  Enabled: true
559
593
 
560
- Syntax:
561
- Description: 'Reports several basic syntax warnings and invalid syntaxes.'
562
- Enabled: true
563
-
564
594
  UnreachableCode:
565
595
  Description: 'Unreachable code.'
566
596
  Enabled: true
@@ -569,14 +599,18 @@ UselessAssignment:
569
599
  Description: 'Checks for useless assignment to a local variable.'
570
600
  Enabled: true
571
601
 
572
- UselessSetterCall:
573
- Description: 'Checks for useless setter call to a local variable.'
574
- Enabled: true
575
-
576
602
  UselessComparison:
577
603
  Description: 'Checks for comparison of something with itself.'
578
604
  Enabled: true
579
605
 
606
+ UselessElseWithoutRescue:
607
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
608
+ Enabled: true
609
+
610
+ UselessSetterCall:
611
+ Description: 'Checks for useless setter call to a local variable.'
612
+ Enabled: true
613
+
580
614
  Void:
581
615
  Description: 'Possible use of operator/literal/variable in void context.'
582
616
  Enabled: true