rubocop 0.14.1 → 0.15.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 +4 -4
- data/.rubocop.yml +5 -3
- data/CHANGELOG.md +245 -198
- data/README.md +7 -0
- data/Rakefile +5 -1
- data/config/default.yml +27 -4
- data/config/enabled.yml +18 -4
- data/lib/rubocop.rb +13 -1
- data/lib/rubocop/cli.rb +83 -23
- data/lib/rubocop/config.rb +1 -1
- data/lib/rubocop/cop/cop.rb +31 -6
- data/lib/rubocop/cop/lint/block_alignment.rb +11 -8
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +21 -14
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/rails/output.rb +35 -0
- data/lib/rubocop/cop/style/{access_control.rb → access_modifier_indentation.rb} +18 -15
- data/lib/rubocop/cop/style/alias.rb +14 -2
- data/lib/rubocop/cop/style/align_hash.rb +174 -109
- data/lib/rubocop/cop/style/autocorrect_alignment.rb +38 -18
- data/lib/rubocop/cop/style/blocks.rb +4 -6
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +3 -3
- data/lib/rubocop/cop/style/cyclomatic_complexity.rb +46 -0
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +48 -0
- data/lib/rubocop/cop/style/empty_lines_around_body.rb +62 -0
- data/lib/rubocop/cop/style/end_of_line.rb +6 -2
- data/lib/rubocop/cop/style/favor_modifier.rb +11 -1
- data/lib/rubocop/cop/style/final_newline.rb +10 -4
- data/lib/rubocop/cop/style/hash_syntax.rb +32 -21
- data/lib/rubocop/cop/style/leading_comment_space.rb +9 -0
- data/lib/rubocop/cop/style/method_call_parentheses.rb +11 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +11 -15
- data/lib/rubocop/cop/style/redundant_return.rb +7 -4
- data/lib/rubocop/cop/style/redundant_self.rb +3 -3
- data/lib/rubocop/cop/style/signal_exception.rb +4 -2
- data/lib/rubocop/cop/style/space_after_comma_etc.rb +7 -1
- data/lib/rubocop/cop/style/space_after_control_keyword.rb +6 -0
- data/lib/rubocop/cop/style/space_after_method_name.rb +7 -1
- data/lib/rubocop/cop/style/space_after_not.rb +6 -2
- data/lib/rubocop/cop/style/space_around_block_braces.rb +149 -0
- data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +33 -0
- data/lib/rubocop/cop/style/space_around_operators.rb +169 -0
- data/lib/rubocop/cop/style/space_before_modifier_keyword.rb +6 -0
- data/lib/rubocop/cop/style/space_inside.rb +35 -0
- data/lib/rubocop/cop/style/space_inside_brackets.rb +18 -0
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +99 -0
- data/lib/rubocop/cop/style/space_inside_parens.rb +18 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +52 -25
- data/lib/rubocop/cop/style/string_literals.rb +1 -1
- data/lib/rubocop/cop/style/surrounding_space.rb +1 -344
- data/lib/rubocop/cop/style/trailing_blank_lines.rb +17 -5
- data/lib/rubocop/cop/style/trailing_whitespace.rb +9 -5
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -2
- data/lib/rubocop/cop/style/word_array.rb +16 -1
- data/lib/rubocop/cop/team.rb +5 -5
- data/lib/rubocop/cop/util.rb +1 -0
- data/lib/rubocop/formatter/offence_count_formatter.rb +0 -1
- data/lib/rubocop/options.rb +76 -111
- data/lib/rubocop/rake_task.rb +4 -2
- data/lib/rubocop/target_finder.rb +3 -3
- data/lib/rubocop/version.rb +1 -1
- data/spec/rubocop/cli_spec.rb +123 -13
- data/spec/rubocop/config_spec.rb +2 -2
- data/spec/rubocop/cop/lint/rescue_exception_spec.rb +10 -0
- data/spec/rubocop/cop/lint/useless_setter_call_spec.rb +13 -0
- data/spec/rubocop/cop/offence_spec.rb +2 -0
- data/spec/rubocop/cop/rails/output_spec.rb +40 -0
- data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +243 -0
- data/spec/rubocop/cop/style/alias_spec.rb +8 -0
- data/spec/rubocop/cop/style/align_array_spec.rb +12 -0
- data/spec/rubocop/cop/style/align_hash_spec.rb +15 -0
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +7 -4
- data/spec/rubocop/cop/style/cyclomatic_complexity_spec.rb +203 -0
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +56 -0
- data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +87 -0
- data/spec/rubocop/cop/style/end_of_line_spec.rb +17 -8
- data/spec/rubocop/cop/style/favor_modifier_spec.rb +34 -0
- data/spec/rubocop/cop/style/final_newline_spec.rb +5 -0
- data/spec/rubocop/cop/style/hash_syntax_spec.rb +22 -2
- data/spec/rubocop/cop/style/leading_comment_space_spec.rb +5 -0
- data/spec/rubocop/cop/style/method_call_parentheses_spec.rb +39 -4
- data/spec/rubocop/cop/style/numeric_literals_spec.rb +5 -0
- data/spec/rubocop/cop/style/signal_exception_spec.rb +11 -0
- data/spec/rubocop/cop/style/space_after_colon_spec.rb +7 -0
- data/spec/rubocop/cop/style/space_after_comma_spec.rb +5 -0
- data/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +29 -8
- data/spec/rubocop/cop/style/space_after_method_name_spec.rb +15 -0
- data/spec/rubocop/cop/style/space_after_semicolon_spec.rb +5 -0
- data/spec/rubocop/cop/style/space_around_block_braces_spec.rb +68 -0
- data/spec/rubocop/cop/style/space_around_equals_in_default_parameter_spec.rb +5 -0
- data/spec/rubocop/cop/style/space_around_operators_spec.rb +43 -0
- data/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +23 -0
- data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +7 -0
- data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +65 -23
- data/spec/rubocop/cop/style/space_inside_parens_spec.rb +7 -0
- data/spec/rubocop/cop/style/special_global_vars_spec.rb +12 -2
- data/spec/rubocop/cop/style/string_literals_spec.rb +6 -0
- data/spec/rubocop/cop/style/symbol_array_spec.rb +5 -7
- data/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +26 -1
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +7 -0
- data/spec/rubocop/cop/style/trivial_accessors_spec.rb +8 -0
- data/spec/rubocop/cop/style/word_array_spec.rb +33 -2
- data/spec/rubocop/cop/team_spec.rb +4 -4
- data/spec/rubocop/formatter/json_formatter_spec.rb +1 -1
- data/spec/rubocop/options_spec.rb +5 -96
- data/spec/rubocop/processed_source_spec.rb +3 -3
- data/spec/spec_helper.rb +28 -23
- data/spec/support/mri_syntax_checker.rb +20 -16
- metadata +24 -5
- data/spec/rubocop/cop/style/access_control_spec.rb +0 -164
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4147b39dd3f54752faac528951caeb3ccc5492b5
|
4
|
+
data.tar.gz: 5f2818160c6acc8a895a30094b123d795695122d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ff5ec56e71894fea1e05c25ec54fc1bcb942bf97309a7f1724723ad484abc17dced861d3c3d82018d09c189746d95115e210aaa5666b6e9262202dd48dc4c9
|
7
|
+
data.tar.gz: 9039f3082e26b30e4c379ab0ee7263b78eed367dd46ab7170d71049ef621a79b3561e28e0a10d199e795cda699e64e21dd15e28442e56797a19db17f39dd78e9
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,78 +2,132 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.15.0 (06/11/2013)
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
* New cop `Output` checks for calls to print, puts, etc. in Rails. ([@daviddavis][])
|
10
|
+
* New cop `EmptyLinesAroundBody` checks for empty lines around the bodies of class, method and module definitions. ([@bbatsov][])
|
11
|
+
* `LeadingCommentSpace` cop does auto-correction. ([@jonas054][])
|
12
|
+
* `SpaceAfterControlKeyword` cop does auto-correction. ([@jonas054][])
|
13
|
+
* `SpaceAfterColon` cop does auto-correction. ([@jonas054][])
|
14
|
+
* `SpaceAfterComma` cop does auto-correction. ([@jonas054][])
|
15
|
+
* `SpaceAfterSemicolon` cop does auto-correction. ([@jonas054][])
|
16
|
+
* `SpaceAfterMethodName` cop does auto-correction. ([@jonas054][])
|
17
|
+
* `SpaceAroundBlockBraces` cop does auto-correction. ([@jonas054][])
|
18
|
+
* `SpaceAroundEqualsInParameterDefault` cop does auto-correction. ([@jonas054][])
|
19
|
+
* `SpaceAroundOperators` cop does auto-correction. ([@jonas054][])
|
20
|
+
* `SpaceBeforeModifierKeyword` cop does auto-correction. ([@jonas054][])
|
21
|
+
* `SpaceInsideHashLiteralBraces` cop does auto-correction. ([@jonas054][])
|
22
|
+
* `SpaceInsideBrackets` cop does auto-correction. ([@jonas054][])
|
23
|
+
* `SpaceInsideParens` cop does auto-correction. ([@jonas054][])
|
24
|
+
* `TrailingWhitespace` cop does auto-correction. ([@jonas054][])
|
25
|
+
* `TrailingBlankLines` cop does auto-correction. ([@jonas054][])
|
26
|
+
* `FinalNewline` cop does auto-correction. ([@jonas054][])
|
27
|
+
* New cop `CyclomaticComplexity` checks the cyclomatic complexity of methods against a configurable max value. ([@jonas054][])
|
28
|
+
* [#594](https://github.com/bbatsov/rubocop/pull/594): New parameter `EnforcedStyleForEmptyBraces` with values `space` and `no_space` (default) added to `SpaceAroundBlockBraces`. ([@jonas054][])
|
29
|
+
* [#603](https://github.com/bbatsov/rubocop/pull/603): New parameter `MinSize` added to `WordArray` to allow small string arrays, retaining the default (0). ([@claco][])
|
30
|
+
|
31
|
+
### Changes
|
32
|
+
|
33
|
+
* [#557](https://github.com/bbatsov/rubocop/pull/557): Configuration files for excluded files are no longer loaded. ([@jonas054][])
|
34
|
+
* [#571](https://github.com/bbatsov/rubocop/pull/571): The default rake task now runs RuboCop over itself! ([@nevir][])
|
35
|
+
* Encoding errors are reported as fatal offences rather than printed with red text. ([@jonas054][])
|
36
|
+
* `AccessControl` cop is now configurable with the `EnforcedStyle` option. ([@sds][])
|
37
|
+
* Split `AccessControl` cop to `AccessModifierIndentation` and `EmptyLinesAroundAccessModifier`. ([@bbatsov][])
|
38
|
+
* [#594](https://github.com/bbatsov/rubocop/pull/594): Add configuration parameter `EnforcedStyleForEmptyBraces` to `SpaceInsideHashLiteralBraces` cop, and change `EnforcedStyleIsWithSpaces` (values `true`, `false`) to `EnforcedStyle` (values `space`, `no_space`) ([@jonas054][])
|
39
|
+
* Coverage builds linked from the README page are enabled again. ([@jonas054][])
|
40
|
+
|
41
|
+
### Bugs fixed
|
42
|
+
|
43
|
+
* [#561](https://github.com/bbatsov/rubocop/pull/561): Handle properly negative literals in `NumericLiterals` cop. ([@bbatsov][])
|
44
|
+
* [#567](https://github.com/bbatsov/rubocop/pull/567): Register an offence when the last hash parameter has braces in `BracesAroundHashParameters` cop. ([@dblock][])
|
45
|
+
* `StringLiterals` cop no longer reports errors for character literals such as ?/. That should be done only by the `CharacterLiterals` cop. ([@jonas054][])
|
46
|
+
* Made auto-correct much less likely to crash due to conflicting corrections ("clobbering"). ([@jonas054][])
|
47
|
+
* [#565](https://github.com/bbatsov/rubocop/pull/565): `$GLOBAL_VAR from English library` should no longer be inserted when autocorrecting short-form global variables like `$!`. ([@nevir][])
|
48
|
+
* [#566](https://github.com/bbatsov/rubocop/pull/566): Methods that just assign a splat to an ivar are no longer considered trivial writers. ([@nevir][])
|
49
|
+
* [#585](https://github.com/bbatsov/rubocop/pull/585): `MethodCallParentheses` should allow methods starting with uppercase letter. ([@bbatsov][])
|
50
|
+
* [#574](https://github.com/bbatsov/rubocop/issues/574): Fix error on multiple-assignment with non-array right hand side in `UselessSetterCall`. ([@yujinakayama][])
|
51
|
+
* [#576](https://github.com/bbatsov/rubocop/issues/576): Output config validation warning to STDERR so that it won't be mixed up with formatter's output. ([@yujinakayama][])
|
52
|
+
* [#599](https://github.com/bbatsov/rubocop/pull/599): `EndOfLine` cop is operational again. ([@jonas054][])
|
53
|
+
* [#604](https://github.com/bbatsov/rubocop/issues/604): Fix error on implicit match conditionals (e.g. `if /pattern/; end`) in `FavorModifier`. ([@yujinakayama][])
|
54
|
+
* [#600](https://github.com/bbatsov/rubocop/pull/600): Don't require an empty line for access modifiers at the beginning of class/module body. ([@bbatsov][])
|
55
|
+
* [#608](https://github.com/bbatsov/rubocop/pull/608): `RescueException` no longer crashes when the namespace of a rescued class is in a local variable. ([@jonas054][])
|
56
|
+
* [#173](https://github.com/bbatsov/rubocop/issues/173): Allow the use of `alias` in the body of an `instance_exec`. ([@bbatsov][])
|
57
|
+
* [#554](https://github.com/bbatsov/rubocop/issues/554): Handle properly multi-line arrays with comments in them in `WordArray` ([@bbatsov][])
|
58
|
+
|
5
59
|
## 0.14.1 (10/10/2013)
|
6
60
|
|
7
61
|
### New features
|
8
62
|
|
9
|
-
* [#551](https://github.com/bbatsov/rubocop/pull/551)
|
10
|
-
* New cop `SpaceAfterNot` tracks redundant space after the `!` operator.
|
63
|
+
* [#551](https://github.com/bbatsov/rubocop/pull/551): New cop `BracesAroundHashParameters` checks for braces in function calls with hash parameters. ([@dblock][])
|
64
|
+
* New cop `SpaceAfterNot` tracks redundant space after the `!` operator. ([@bbatsov][])
|
11
65
|
|
12
66
|
### Bugs fixed
|
13
67
|
|
14
|
-
* Fix bug concerning table and separator alignment of multi-line hash with multiple keys on the same line.
|
15
|
-
* Fix a bug where `ClassLength` counted lines of inner classes/modules
|
16
|
-
* Fix a false positive for namespace class in `Documentation
|
17
|
-
* Fix "Parser::Source::Range spans more than one line" bug in clang formatter
|
18
|
-
* [#552](https://github.com/bbatsov/rubocop/pull/552)
|
68
|
+
* Fix bug concerning table and separator alignment of multi-line hash with multiple keys on the same line. ([@jonas054][])
|
69
|
+
* [#550](https://github.com/bbatsov/rubocop/pull/550): Fix a bug where `ClassLength` counted lines of inner classes/modules. ([@yujinakayama][])
|
70
|
+
* [#550](https://github.com/bbatsov/rubocop/pull/550): Fix a false positive for namespace class in `Documentation`. ([@yujinakayama][])
|
71
|
+
* [#556](https://github.com/bbatsov/rubocop/pull/556): Fix "Parser::Source::Range spans more than one line" bug in clang formatter. ([@yujinakayama][])
|
72
|
+
* [#552](https://github.com/bbatsov/rubocop/pull/552): `RaiseArgs` allows exception constructor calls with more than one 1 argument. ([@bbatsov][])
|
19
73
|
|
20
74
|
## 0.14.0 (07/10/2013)
|
21
75
|
|
22
76
|
### New features
|
23
77
|
|
24
|
-
* [#491](https://github.com/bbatsov/rubocop/issues/491)
|
25
|
-
* [#456](https://github.com/bbatsov/rubocop/issues/456)
|
26
|
-
* [#501](https://github.com/bbatsov/rubocop/issues/501)
|
27
|
-
* [#501](https://github.com/bbatsov/rubocop/issues/501)
|
28
|
-
* [#501](https://github.com/bbatsov/rubocop/issues/501)
|
29
|
-
* New cop `ClassLength` checks for overly long class definitions
|
30
|
-
* New cop `Debugger` checks for forgotten calls to debugger or pry
|
31
|
-
* New cop `RedundantException` checks for code like `raise RuntimeError, message
|
32
|
-
* [#526](https://github.com/bbatsov/rubocop/issues/526)
|
78
|
+
* [#491](https://github.com/bbatsov/rubocop/issues/491): New cop `MethodCalledOnDoEndBlock` keeps track of methods called on `do`...`end` blocks.
|
79
|
+
* [#456](https://github.com/bbatsov/rubocop/issues/456): New configuration parameter `AllCops`/`RunRailsCops` can be set to `true` for a project, removing the need to give the `-R`/`--rails` option with every invocation of `rubocop`.
|
80
|
+
* [#501](https://github.com/bbatsov/rubocop/issues/501): `simple`/`clang`/`progress`/`emacs` formatters now print `[Corrected]` along with offence message when the offence is automatically corrected.
|
81
|
+
* [#501](https://github.com/bbatsov/rubocop/issues/501): `simple`/`clang`/`progress` formatters now print count of auto-corrected offences in the final summary.
|
82
|
+
* [#501](https://github.com/bbatsov/rubocop/issues/501): `json` formatter now outputs `corrected` key with boolean value in offence objects whether the offence is automatically corrected.
|
83
|
+
* New cop `ClassLength` checks for overly long class definitions.
|
84
|
+
* New cop `Debugger` checks for forgotten calls to debugger or pry.
|
85
|
+
* New cop `RedundantException` checks for code like `raise RuntimeError, message`.
|
86
|
+
* [#526](https://github.com/bbatsov/rubocop/issues/526): New cop `RaiseArgs` checks the args passed to `raise/fail`.
|
33
87
|
|
34
88
|
### Changes
|
35
89
|
|
36
90
|
* Cop `MethodAndVariableSnakeCase` replaced by `MethodName` and `VariableName`, both having the configuration parameter `EnforcedStyle` with values `snake_case` (default) and `camelCase`.
|
37
|
-
* [#519](https://github.com/bbatsov/rubocop/issues/519)
|
38
|
-
* [#520](https://github.com/bbatsov/rubocop/issues/520)
|
39
|
-
* [#528](https://github.com/bbatsov/rubocop/issues/528)
|
40
|
-
* [#524](https://github.com/bbatsov/rubocop/issues/524)
|
41
|
-
* [#525](https://github.com/bbatsov/rubocop/issues/525)
|
91
|
+
* [#519](https://github.com/bbatsov/rubocop/issues/519): `HashSyntax` cop is now configurable and can enforce the use of the classic hash rockets syntax.
|
92
|
+
* [#520](https://github.com/bbatsov/rubocop/issues/520): `StringLiterals` cop is now configurable and can enforce either single-quoted or double-quoted strings.
|
93
|
+
* [#528](https://github.com/bbatsov/rubocop/issues/528): Added a config option to `RedundantReturn` to allow a `return` with multiple values.
|
94
|
+
* [#524](https://github.com/bbatsov/rubocop/issues/524): Added a config option to `Semicolon` to allow the use of `;` as an expression separator.
|
95
|
+
* [#525](https://github.com/bbatsov/rubocop/issues/525): `SignalException` cop is now configurable and can enforce the semantic rule or an exclusive use of `raise` or `fail`.
|
42
96
|
* `LambdaCall` is now configurable and enforce either `Proc#call` or `Proc#()`.
|
43
|
-
* [#529](https://github.com/bbatsov/rubocop/issues/529)
|
44
|
-
* [#529](https://github.com/bbatsov/rubocop/issues/529)
|
45
|
-
* Support Parser 2.0.0 (non-beta)
|
97
|
+
* [#529](https://github.com/bbatsov/rubocop/issues/529): Added config option `EnforcedStyle` to `SpaceAroundBraces`.
|
98
|
+
* [#529](https://github.com/bbatsov/rubocop/issues/529): Changed config option `NoSpaceBeforeBlockParameters` to `SpaceBeforeBlockParameters`.
|
99
|
+
* Support Parser 2.0.0 (non-beta).
|
46
100
|
|
47
101
|
### Bugs fixed
|
48
102
|
|
49
|
-
* [#514](https://github.com/bbatsov/rubocop/issues/514)
|
50
|
-
* [#496](https://github.com/bbatsov/rubocop/issues/496)
|
51
|
-
* [#502](https://github.com/bbatsov/rubocop/issues/502)
|
52
|
-
* [#448](https://github.com/bbatsov/rubocop/issues/448)
|
53
|
-
* [#493](https://github.com/bbatsov/rubocop/issues/493)
|
103
|
+
* [#514](https://github.com/bbatsov/rubocop/issues/514): Fix alignment of the hash containing different key lengths in one line.
|
104
|
+
* [#496](https://github.com/bbatsov/rubocop/issues/496): Fix corner case crash in `AlignHash` cop: single key/value pair when configuration is `table` for '=>' and `separator` for `:`.
|
105
|
+
* [#502](https://github.com/bbatsov/rubocop/issues/502): Don't check non-decimal literals with `NumericLiterals`.
|
106
|
+
* [#448](https://github.com/bbatsov/rubocop/issues/448): Fix auto-correction of parameters spanning more than one line in `AlignParameters` cop.
|
107
|
+
* [#493](https://github.com/bbatsov/rubocop/issues/493): Support disabling `Syntax` offences with `warning` severity.
|
54
108
|
* Fix bug appearing when there were different values for the `AllCops`/`RunRailsCops` configuration parameter in different directories.
|
55
|
-
* [#512](https://github.com/bbatsov/rubocop/issues/512)
|
56
|
-
* [#515](https://github.com/bbatsov/rubocop/issues/515)
|
57
|
-
* [#516](https://github.com/bbatsov/rubocop/issues/516)
|
58
|
-
* [#527](https://github.com/bbatsov/rubocop/issues/527)
|
109
|
+
* [#512](https://github.com/bbatsov/rubocop/issues/512): Fix bug causing crash in `AndOr` auto-correction.
|
110
|
+
* [#515](https://github.com/bbatsov/rubocop/issues/515): Fix bug causing `AlignParameters` and `AlignArray` auto-correction to destroy code.
|
111
|
+
* [#516](https://github.com/bbatsov/rubocop/issues/516): Fix bug causing `RedundantReturn` auto-correction to produce invalid code.
|
112
|
+
* [#527](https://github.com/bbatsov/rubocop/issues/527): Handle `!=` expressions in `EvenOdd` cop.
|
59
113
|
* `SignalException` cop now finds `raise` calls anywhere, not only in `begin` sections.
|
60
|
-
* [#538](https://github.com/bbatsov/rubocop/issues/538)
|
114
|
+
* [#538](https://github.com/bbatsov/rubocop/issues/538): Fix bug causing `Blocks` auto-correction to produce invalid code.
|
61
115
|
|
62
116
|
## 0.13.1 (19/09/2013)
|
63
117
|
|
64
118
|
### New features
|
65
119
|
|
66
120
|
* `HashSyntax` cop does auto-correction.
|
67
|
-
* Allow calls to self to fix name clash with argument
|
121
|
+
* [#484](https://github.com/bbatsov/rubocop/pull/484): Allow calls to self to fix name clash with argument.
|
68
122
|
* Renamed `SpaceAroundBraces` to `SpaceAroundBlockBraces`.
|
69
123
|
* `SpaceAroundBlockBraces` now has a `NoSpaceBeforeBlockParameters` config option to enforce a style for blocks with parameters like `{|foo| puts }`.
|
70
|
-
* New cop `LambdaCall` tracks uses of the obscure `lambda.(...)` syntax
|
124
|
+
* New cop `LambdaCall` tracks uses of the obscure `lambda.(...)` syntax.
|
71
125
|
|
72
126
|
### Bugs fixed
|
73
127
|
|
74
128
|
* Fix crash on empty input file in `FinalNewline`.
|
75
|
-
* [#485](https://github.com/bbatsov/rubocop/issues/485)
|
76
|
-
* [#497](https://github.com/bbatsov/rubocop/issues/497)
|
129
|
+
* [#485](https://github.com/bbatsov/rubocop/issues/485): Fix crash on multiple-assignment and op-assignment in `UselessSetterCall`.
|
130
|
+
* [#497](https://github.com/bbatsov/rubocop/issues/497): Fix crash in `UselessComparison` and `NilComparison`.
|
77
131
|
|
78
132
|
## 0.13.0 (13/09/2013)
|
79
133
|
|
@@ -81,7 +135,7 @@
|
|
81
135
|
|
82
136
|
* New configuration parameter `AllowAdjacentOneLineDefs` for `EmptyLineBetweenDefs`.
|
83
137
|
* New cop `MultilineBlockChain` keeps track of chained blocks spanning multiple lines.
|
84
|
-
* `RedundantSelf` cop does auto-correction
|
138
|
+
* `RedundantSelf` cop does auto-correction.
|
85
139
|
* `AvoidPerlBackrefs` cop does auto-correction.
|
86
140
|
* `AvoidPerlisms` cop does auto-correction.
|
87
141
|
* `RedundantReturn` cop does auto-correction.
|
@@ -95,87 +149,81 @@
|
|
95
149
|
|
96
150
|
### Changes
|
97
151
|
|
98
|
-
* [#447](https://github.com/bbatsov/rubocop/issues/447)
|
152
|
+
* [#447](https://github.com/bbatsov/rubocop/issues/447): `BlockAlignment` cop now allows `end` to be aligned with the start of the line containing `do`.
|
99
153
|
* `SymbolName` now has an `AllowDots` config option to allow symbols like `:'whatever.submit_button'`.
|
100
|
-
* [#469](https://github.com/bbatsov/rubocop/issues/469)
|
101
|
-
* [#469](https://github.com/bbatsov/rubocop/issues/469)
|
102
|
-
* [#458](https://github.com/bbatsov/rubocop/issues/458)
|
103
|
-
* [#466](https://github.com/bbatsov/rubocop/issues/466)
|
104
|
-
* Added a config option `AllowedVariables` to `AvoidGlobalVars` to allow users to whitelist certain global variables
|
105
|
-
* Renamed `AvoidGlobalVars` to `GlobalVars
|
106
|
-
* Renamed `AvoidPerlisms` to `SpecialGlobalVars
|
107
|
-
* Renamed `AvoidFor` to `For
|
108
|
-
* Renamed `AvoidClassVars` to `ClassVars
|
109
|
-
* Renamed `AvoidPerlBackrefs` to `PerlBackrefs
|
154
|
+
* [#469](https://github.com/bbatsov/rubocop/issues/469): Extracted useless setter call tracking part of `UselessAssignment` cop to `UselessSetterCall`.
|
155
|
+
* [#469](https://github.com/bbatsov/rubocop/issues/469): Merged `UnusedLocalVariable` cop into `UselessAssignment`.
|
156
|
+
* [#458](https://github.com/bbatsov/rubocop/issues/458): The merged `UselessAssignment` cop now has advanced logic that tracks not only assignment at the end of the method but also every assignment in every scope.
|
157
|
+
* [#466](https://github.com/bbatsov/rubocop/issues/466): Allow built-in JRuby global vars in `AvoidGlobalVars`.
|
158
|
+
* Added a config option `AllowedVariables` to `AvoidGlobalVars` to allow users to whitelist certain global variables.
|
159
|
+
* Renamed `AvoidGlobalVars` to `GlobalVars`.
|
160
|
+
* Renamed `AvoidPerlisms` to `SpecialGlobalVars`.
|
161
|
+
* Renamed `AvoidFor` to `For`.
|
162
|
+
* Renamed `AvoidClassVars` to `ClassVars`.
|
163
|
+
* Renamed `AvoidPerlBackrefs` to `PerlBackrefs`.
|
110
164
|
* `NumericLiterals` now accepts a config param `MinDigits` - the minimal number of digits in the integer portion of number for the cop to check it.
|
111
165
|
|
112
166
|
### Bugs fixed
|
113
167
|
|
114
|
-
* [#449](https://github.com/bbatsov/rubocop/issues/449)
|
168
|
+
* [#449](https://github.com/bbatsov/rubocop/issues/449): Remove whitespaces between condition and `do` with `WhileUntilDo` auto-correction.
|
115
169
|
* Continue with file inspection after parser warnings. Give up only on syntax errors.
|
116
170
|
* Don’t trigger the HashSyntax cop on digit-starting keys.
|
117
171
|
* Fix crashes while inspecting class definition subclassing another class stored in a local variable in `UselessAssignment` (formerly of `UnusedLocalVariable`) and `ShadowingOuterLocalVariable` (like `clazz = Array; class SomeClass < clazz; end`).
|
118
|
-
* [#463](https://github.com/bbatsov/rubocop/issues/463)
|
172
|
+
* [#463](https://github.com/bbatsov/rubocop/issues/463): Do not warn if using destructuring in second `reduce` argument (`ReduceArguments`).
|
119
173
|
|
120
174
|
## 0.12.0 (23/08/2013)
|
121
175
|
|
122
176
|
### New features
|
123
177
|
|
124
|
-
* [#439](https://github.com/bbatsov/rubocop/issues/439) Added formatter 'OffenceCount' which outputs a summary list of cops and their offence count
|
178
|
+
* [#439](https://github.com/bbatsov/rubocop/issues/439) Added formatter 'OffenceCount' which outputs a summary list of cops and their offence count.
|
125
179
|
* [#395](https://github.com/bbatsov/rubocop/issues/395) Added `--show-cops` option to show available cops.
|
126
|
-
* New cop `NilComparison` keeps track of comparisons like `== nil
|
127
|
-
* New cop `EvenOdd` keeps track of occasions where `Fixnum#even?` or `Fixnum#odd?` should have been used (like `x % 2 == 0`)
|
180
|
+
* New cop `NilComparison` keeps track of comparisons like `== nil`.
|
181
|
+
* New cop `EvenOdd` keeps track of occasions where `Fixnum#even?` or `Fixnum#odd?` should have been used (like `x % 2 == 0`).
|
128
182
|
* New cop `IndentationWidth` checks for files using indentation that is not two spaces.
|
129
183
|
* New cop `SpaceAfterMethodName` keeps track of method definitions with a space between the method name and the opening parenthesis.
|
130
184
|
* New cop `ParenthesesAsGroupedExpression` keeps track of method calls with a space before the opening parenthesis.
|
131
185
|
* New cop `HashMethods` keeps track of uses of deprecated `Hash` methods.
|
132
186
|
* New Rails cop `HasAndBelongsToMany` checks for uses of `has_and_belongs_to_many`.
|
133
187
|
* New Rails cop `ReadAttribute` tracks uses of `read_attribute`.
|
134
|
-
* `Attr` cop does auto-correction
|
135
|
-
* `CollectionMethods` cop does auto-correction
|
136
|
-
* `SignalException` cop does auto-correction
|
137
|
-
* `EmptyLiteral` cop does auto-correction
|
138
|
-
* `MethodCallParentheses` cop does auto-correction
|
139
|
-
* `DefWithParentheses` cop does auto-correction
|
140
|
-
* `DefWithoutParentheses` cop does auto-correction
|
188
|
+
* `Attr` cop does auto-correction.
|
189
|
+
* `CollectionMethods` cop does auto-correction.
|
190
|
+
* `SignalException` cop does auto-correction.
|
191
|
+
* `EmptyLiteral` cop does auto-correction.
|
192
|
+
* `MethodCallParentheses` cop does auto-correction.
|
193
|
+
* `DefWithParentheses` cop does auto-correction.
|
194
|
+
* `DefWithoutParentheses` cop does auto-correction.
|
141
195
|
|
142
196
|
### Changes
|
143
197
|
|
144
198
|
* Dropped `-s`/`--silent` option. Now `progress`/`simple`/`clang` formatters always report summary and `emacs`/`files` formatters no longer report.
|
145
|
-
* Dropped the `LineContinuation` cop
|
199
|
+
* Dropped the `LineContinuation` cop.
|
146
200
|
|
147
201
|
### Bugs fixed
|
148
202
|
|
149
|
-
* [#432](https://github.com/bbatsov/rubocop/issues/432)
|
150
|
-
* [#434](https://github.com/bbatsov/rubocop/issues/434)
|
203
|
+
* [#432](https://github.com/bbatsov/rubocop/issues/432): Fix false positive for constant assignments when rhs is a method call with block in `ConstantName`.
|
204
|
+
* [#434](https://github.com/bbatsov/rubocop/issues/434): Support classes and modules defined with `Class.new`/`Module.new` in `AccessControl`.
|
151
205
|
* Fix which ranges are highlighted in reports from IfUnlessModifier, WhileUntilModifier, and MethodAndVariableSnakeCase cop.
|
152
|
-
* [#438](https://github.com/bbatsov/rubocop/issues/438)
|
206
|
+
* [#438](https://github.com/bbatsov/rubocop/issues/438): Accept setting attribute on method argument in `UselessAssignment`.
|
153
207
|
|
154
208
|
## 0.11.1 (12/08/2013)
|
155
209
|
|
156
210
|
### Changes
|
157
211
|
|
158
|
-
* [#425](https://github.com/bbatsov/rubocop/issues/425)
|
159
|
-
ColonMethodCalls` now allows
|
160
|
-
constructor methods (like `Nokogiri::HTML()` to be called with double colon.
|
212
|
+
* [#425](https://github.com/bbatsov/rubocop/issues/425): `ColonMethodCalls` now allows constructor methods (like `Nokogiri::HTML()` to be called with double colon.
|
161
213
|
|
162
214
|
### Bugs fixed
|
163
215
|
|
164
|
-
* [#427](https://github.com/bbatsov/rubocop/issues/427)
|
165
|
-
* [#429](https://github.com/bbatsov/rubocop/issues/429)
|
166
|
-
* Fixed `AsciiComments` offence reporting
|
167
|
-
* Fixed `BlockComments` offence reporting
|
216
|
+
* [#427](https://github.com/bbatsov/rubocop/issues/427): FavorUnlessOverNegatedIf triggered when using elsifs.
|
217
|
+
* [#429](https://github.com/bbatsov/rubocop/issues/429): Fix `LeadingCommentSpace` offence reporting.
|
218
|
+
* Fixed `AsciiComments` offence reporting.
|
219
|
+
* Fixed `BlockComments` offence reporting.
|
168
220
|
|
169
221
|
## 0.11.0 (09/08/2013)
|
170
222
|
|
171
223
|
### New features
|
172
224
|
|
173
|
-
* [#421](https://github.com/bbatsov/rubocop/issues/421) - `
|
174
|
-
|
175
|
-
whitelist (such as `to_s` and `to_hash`)
|
176
|
-
* New option `--auto-gen-config` outputs RuboCop configuration that disables all
|
177
|
-
cops that detect any offences (for
|
178
|
-
[#369](https://github.com/bbatsov/rubocop/issues/369)).
|
225
|
+
* [#421](https://github.com/bbatsov/rubocop/issues/421): `TrivialAccessors` now ignores methods on user-configurable whitelist (such as `to_s` and `to_hash`).
|
226
|
+
* [#369](https://github.com/bbatsov/rubocop/issues/369): New option `--auto-gen-config` outputs RuboCop configuration that disables all cops that detect any offences.
|
179
227
|
* The list of annotation keywords recognized by the `CommentAnnotation` cop is now configurable.
|
180
228
|
* Configuration file names are printed as they are loaded in `--debug` mode.
|
181
229
|
* Auto-correct support added in `AlignParameters` cop.
|
@@ -186,26 +234,26 @@
|
|
186
234
|
|
187
235
|
### Bugs fixed
|
188
236
|
|
189
|
-
* [#374](https://github.com/bbatsov/rubocop/issues/374)
|
190
|
-
* [#373](https://github.com/bbatsov/rubocop/issues/373) and [#376](https://github.com/bbatsov/rubocop/issues/376)
|
191
|
-
* `RedundantSelf` now allows `self.` followed by any ruby keyword
|
192
|
-
* [#391](https://github.com/bbatsov/rubocop/issues/391)
|
193
|
-
* [#394](https://github.com/bbatsov/rubocop/issues/394)
|
194
|
-
* [#390](https://github.com/bbatsov/rubocop/issues/390)
|
195
|
-
* [#400](https://github.com/bbatsov/rubocop/issues/400)
|
196
|
-
* [#399](https://github.com/bbatsov/rubocop/issues/399)
|
237
|
+
* [#374](https://github.com/bbatsov/rubocop/issues/374): Fixed error at post condition loop (`begin-end-while`, `begin-end-until`) in `UnusedLocalVariable` and `ShadowingOuterLocalVariable`.
|
238
|
+
* [#373](https://github.com/bbatsov/rubocop/issues/373) and [#376](https://github.com/bbatsov/rubocop/issues/376): allow braces around multi-line blocks if `do`-`end` would change the meaning of the code.
|
239
|
+
* `RedundantSelf` now allows `self.` followed by any ruby keyword.
|
240
|
+
* [#391](https://github.com/bbatsov/rubocop/issues/391): Fix bug in counting slashes in a regexp.
|
241
|
+
* [#394](https://github.com/bbatsov/rubocop/issues/394): `DotPosition` cop handles correctly code like `l.(1)`.
|
242
|
+
* [#390](https://github.com/bbatsov/rubocop/issues/390): `CommentAnnotation` cop allows keywords (e.g. Review, Optimize) if they just begin a sentence.
|
243
|
+
* [#400](https://github.com/bbatsov/rubocop/issues/400): Fix bug concerning nested defs in `EmptyLineBetweenDefs` cop.
|
244
|
+
* [#399](https://github.com/bbatsov/rubocop/issues/399): Allow assignment inside blocks in `AssignmentInCondition` cop.
|
197
245
|
* Fix bug in favor_modifier.rb regarding missed offences after else etc.
|
198
|
-
* [#393](https://github.com/bbatsov/rubocop/issues/393)
|
199
|
-
* [#389](https://github.com/bbatsov/rubocop/issues/389)
|
200
|
-
* [#387](https://github.com/bbatsov/rubocop/issues/387)
|
201
|
-
* [#398](https://github.com/bbatsov/rubocop/issues/398)
|
202
|
-
* [#283](https://github.com/bbatsov/rubocop/issues/283)
|
246
|
+
* [#393](https://github.com/bbatsov/rubocop/issues/393): Retract support for multiline chaining of blocks (which fixed [#346](https://github.com/bbatsov/rubocop/issues/346)), thus rejecting issue 346.
|
247
|
+
* [#389](https://github.com/bbatsov/rubocop/issues/389): Ignore symbols that are arguments to Module#private_constant in `SymbolName` cop.
|
248
|
+
* [#387](https://github.com/bbatsov/rubocop/issues/387): Do autocorrect in `AndOr` cop only if it does not change the meaning of the code.
|
249
|
+
* [#398](https://github.com/bbatsov/rubocop/issues/398): Don't display blank lines in the output of the clang formatter.
|
250
|
+
* [#283](https://github.com/bbatsov/rubocop/issues/283): Refine `StringLiterals` string content check.
|
203
251
|
|
204
252
|
## 0.10.0 (17/07/2013)
|
205
253
|
|
206
254
|
### New features
|
207
255
|
|
208
|
-
* New cop `RedundantReturn` tracks redundant `return`s in method bodies
|
256
|
+
* New cop `RedundantReturn` tracks redundant `return`s in method bodies.
|
209
257
|
* New cop `RedundantBegin` tracks redundant `begin` blocks in method definitions.
|
210
258
|
* New cop `RedundantSelf` tracks redundant uses of `self`.
|
211
259
|
* New cop `EmptyEnsure` tracks empty `ensure` blocks.
|
@@ -217,27 +265,25 @@
|
|
217
265
|
|
218
266
|
* `TrivialAccessors` now has an `ExactNameMatch` config option (related to [#308](https://github.com/bbatsov/rubocop/issues/308)).
|
219
267
|
* `TrivialAccessors` now has an `ExcludePredicates` config option (related to [#326](https://github.com/bbatsov/rubocop/issues/326)).
|
220
|
-
* Cops don't inherit from `Parser::AST::Rewriter` anymore. All 3rd party Cops should remove the call to `super` in their
|
221
|
-
callbacks. If you implement your own processing you need to define the `#investigate` method instead of `#inspect`. Refer to
|
222
|
-
the documentation of `Cop::Commissioner` and `Cop::Cop` classes for more information.
|
268
|
+
* Cops don't inherit from `Parser::AST::Rewriter` anymore. All 3rd party Cops should remove the call to `super` in their callbacks. If you implement your own processing you need to define the `#investigate` method instead of `#inspect`. Refer to the documentation of `Cop::Commissioner` and `Cop::Cop` classes for more information.
|
223
269
|
* `EndAlignment` cop split into `EndAlignment` and `BlockAlignment` cops.
|
224
270
|
|
225
271
|
### Bugs fixed
|
226
272
|
|
227
|
-
* [#288](https://github.com/bbatsov/rubocop/issues/288)
|
228
|
-
* `TrivialAccessors` now detects class attributes as well as instance attributes
|
229
|
-
* [#338](https://github.com/bbatsov/rubocop/issues/338)
|
230
|
-
* [#345](https://github.com/bbatsov/rubocop/issues/345)
|
231
|
-
* [#340](https://github.com/bbatsov/rubocop/issues/340)
|
232
|
-
* [#349](https://github.com/bbatsov/rubocop/issues/349)
|
233
|
-
* [#346](https://github.com/bbatsov/rubocop/issues/346)
|
234
|
-
* [#350](https://github.com/bbatsov/rubocop/issues/350)
|
235
|
-
* [#356](https://github.com/bbatsov/rubocop/issues/350)
|
273
|
+
* [#288](https://github.com/bbatsov/rubocop/issues/288): work with absolute Excludes paths internally (2nd fix for this issue).
|
274
|
+
* `TrivialAccessors` now detects class attributes as well as instance attributes.
|
275
|
+
* [#338](https://github.com/bbatsov/rubocop/issues/338): fix end alignment of blocks in chained assignments.
|
276
|
+
* [#345](https://github.com/bbatsov/rubocop/issues/345): add `$SAFE` to the list of built-in global variables.
|
277
|
+
* [#340](https://github.com/bbatsov/rubocop/issues/340): override config parameters rather than merging them.
|
278
|
+
* [#349](https://github.com/bbatsov/rubocop/issues/349): fix false positive for `CharacterLiteral` (`%w(?)`).
|
279
|
+
* [#346](https://github.com/bbatsov/rubocop/issues/346): support method chains for block end alignment checks.
|
280
|
+
* [#350](https://github.com/bbatsov/rubocop/issues/350): support line breaks between variables on left hand side for block end alignment checks.
|
281
|
+
* [#356](https://github.com/bbatsov/rubocop/issues/350): allow safe assignment in `ParenthesesAroundCondition`.
|
236
282
|
|
237
283
|
### Misc
|
238
284
|
|
239
|
-
* Improved performance on Ruby 1.9 by about 20
|
240
|
-
* Improved overall performance by about 35
|
285
|
+
* Improved performance on Ruby 1.9 by about 20%.
|
286
|
+
* Improved overall performance by about 35%.
|
241
287
|
|
242
288
|
## 0.9.1 (05/07/2013)
|
243
289
|
|
@@ -253,33 +299,30 @@
|
|
253
299
|
|
254
300
|
### Bugs fixed
|
255
301
|
|
256
|
-
* [#318](https://github.com/bbatsov/rubocop/issues/318)
|
257
|
-
* [#317](https://github.com/bbatsov/rubocop/issues/317)
|
258
|
-
* [#321](https://github.com/bbatsov/rubocop/issues/321)
|
259
|
-
* [#322](https://github.com/bbatsov/rubocop/issues/322)
|
260
|
-
* [#316](https://github.com/bbatsov/rubocop/issues/316)
|
261
|
-
* [#327](https://github.com/bbatsov/rubocop/issues/327)
|
262
|
-
* [#332](https://github.com/bbatsov/rubocop/issues/332)
|
263
|
-
* [#333](https://github.com/bbatsov/rubocop/issues/333)
|
302
|
+
* [#318](https://github.com/bbatsov/rubocop/issues/318): correct some special cases of block end alignment.
|
303
|
+
* [#317](https://github.com/bbatsov/rubocop/issues/317): fix a false positive in `LiteralInCondition`.
|
304
|
+
* [#321](https://github.com/bbatsov/rubocop/issues/321): Ignore variables whose name start with `_` in `ShadowingOuterLocalVariable`.
|
305
|
+
* [#322](https://github.com/bbatsov/rubocop/issues/322): Fix exception of `UnusedLocalVariable` and `ShadowingOuterLocalVariable` when inspecting keyword splat argument.
|
306
|
+
* [#316](https://github.com/bbatsov/rubocop/issues/316): Correct nested postfix unless in `MultilineIfThen`.
|
307
|
+
* [#327](https://github.com/bbatsov/rubocop/issues/327): Fix false offences for block expression that span on two lines in `EndAlignment`.
|
308
|
+
* [#332](https://github.com/bbatsov/rubocop/issues/332): Fix exception of `UnusedLocalVariable` and `ShadowingOuterLocalVariable` when inspecting named captures.
|
309
|
+
* [#333](https://github.com/bbatsov/rubocop/issues/333): Fix a case that `EnsureReturn` throws an exception when ensure has no body.
|
264
310
|
|
265
311
|
## 0.9.0 (01/07/2013)
|
266
312
|
|
267
313
|
### New features
|
268
314
|
|
269
315
|
* Introduced formatter feature, enables custom formatted output and multiple outputs.
|
270
|
-
* Added progress formatter and now it's the default. (`--format progress`)
|
271
|
-
* Added JSON formatter. (`--format json`)
|
272
|
-
* Added clang style formatter showing the offending source
|
273
|
-
code. (`--format clang`). The `clang` formatter marks a whole range
|
274
|
-
rather than just the starting position, to indicate more clearly
|
275
|
-
where the problem is.
|
316
|
+
* Added progress formatter and now it's the default. (`--format progress`).
|
317
|
+
* Added JSON formatter. (`--format json`).
|
318
|
+
* Added clang style formatter showing the offending source. code. (`--format clang`). The `clang` formatter marks a whole range rather than just the starting position, to indicate more clearly where the problem is.
|
276
319
|
* Added `-f`/`--format` option to specify formatter.
|
277
320
|
* Added `-o`/`--out` option to specify output file for each formatter.
|
278
321
|
* Added `-r/--require` option to inject external Ruby code into RuboCop.
|
279
322
|
* Added `-V/--verbose-version` option that displays Parser version and Ruby version as well.
|
280
323
|
* Added `-R/--rails` option that enables extra Rails-specific cops.
|
281
324
|
* Added support for auto-correction of some offences with `-a`/`--auto-correct`.
|
282
|
-
* New cop `CaseEquality` checks for explicit use of
|
325
|
+
* New cop `CaseEquality` checks for explicit use of `===`.
|
283
326
|
* New cop `AssignmentInCondition` checks for assignment in conditions.
|
284
327
|
* New cop `EndAlignment` tracks misaligned `end` keywords.
|
285
328
|
* New cop `Void` tracks uses of literals/variables/operators in possibly void context.
|
@@ -300,7 +343,7 @@
|
|
300
343
|
|
301
344
|
### Changes
|
302
345
|
|
303
|
-
* Deprecated `-e`/`--emacs` option. (Use `--format emacs` instead)
|
346
|
+
* Deprecated `-e`/`--emacs` option. (Use `--format emacs` instead).
|
304
347
|
* Made `progress` formatter the default.
|
305
348
|
* Most formatters (`progress`, `simple` and `clang`) now print relative file paths if the paths are under the current working directory.
|
306
349
|
* Migrate all cops to new namespaces. `Rubocop::Cop::Lint` is for cops that emit warnings. `Rubocop::Cop::Style` is for cops that do not belong in other namespaces.
|
@@ -309,21 +352,21 @@
|
|
309
352
|
|
310
353
|
### Bugs fixed
|
311
354
|
|
312
|
-
* [#239](https://github.com/bbatsov/rubocop/issues/239)
|
313
|
-
* [#233](https://github.com/bbatsov/rubocop/issues/233)
|
355
|
+
* [#239](https://github.com/bbatsov/rubocop/issues/239): fixed double quotes false positives.
|
356
|
+
* [#233](https://github.com/bbatsov/rubocop/issues/233): report syntax cop offences.
|
314
357
|
* Fix off-by-one error in favor_modifier.
|
315
|
-
* [#229](https://github.com/bbatsov/rubocop/issues/229)
|
316
|
-
* [#235](https://github.com/bbatsov/rubocop/issues/235)
|
317
|
-
* [#246](https://github.com/bbatsov/rubocop/issues/246)
|
358
|
+
* [#229](https://github.com/bbatsov/rubocop/issues/229): recognize a line with CR+LF as a blank line in AccessControl cop.
|
359
|
+
* [#235](https://github.com/bbatsov/rubocop/issues/235): handle multiple constant assignment in ConstantName cop.
|
360
|
+
* [#246](https://github.com/bbatsov/rubocop/issues/246): correct handling of unicode escapes within double quotes.
|
318
361
|
* Fix crashes in Blocks, CaseEquality, CaseIndentation, ClassAndModuleCamelCase, ClassMethods, CollectionMethods, and ColonMethodCall.
|
319
|
-
* [#263](https://github.com/bbatsov/rubocop/issues/263)
|
320
|
-
* [#271](https://github.com/bbatsov/rubocop/issues/271)
|
321
|
-
* [#270](https://github.com/bbatsov/rubocop/issues/270)
|
322
|
-
* [#288](https://github.com/bbatsov/rubocop/issues/288)
|
323
|
-
* [#276](https://github.com/bbatsov/rubocop/issues/276)
|
324
|
-
* [#292](https://github.com/bbatsov/rubocop/issues/292)
|
325
|
-
* Fix crashes in WordArray on arrays of character literals such as `[?\r, ?\n]
|
326
|
-
* Fix crashes in Documentation on empty modules
|
362
|
+
* [#263](https://github.com/bbatsov/rubocop/issues/263): do not check for space around operators called with method syntax.
|
363
|
+
* [#271](https://github.com/bbatsov/rubocop/issues/271): always allow line breaks inside hash literal braces.
|
364
|
+
* [#270](https://github.com/bbatsov/rubocop/issues/270): fixed a false positive in ParenthesesAroundCondition.
|
365
|
+
* [#288](https://github.com/bbatsov/rubocop/issues/288): get config parameter AllCops/Excludes from highest config file in path.
|
366
|
+
* [#276](https://github.com/bbatsov/rubocop/issues/276): let columns start at 1 instead of 0 in all output of column numbers.
|
367
|
+
* [#292](https://github.com/bbatsov/rubocop/issues/292): don't check non-regular files (like sockets, etc).
|
368
|
+
* Fix crashes in WordArray on arrays of character literals such as `[?\r, ?\n]`.
|
369
|
+
* Fix crashes in Documentation on empty modules.
|
327
370
|
|
328
371
|
## 0.8.3 (18/06/2013)
|
329
372
|
|
@@ -335,40 +378,39 @@
|
|
335
378
|
|
336
379
|
### New features
|
337
380
|
|
338
|
-
* New cop `BlockNesting` checks for excessive block nesting
|
381
|
+
* New cop `BlockNesting` checks for excessive block nesting.
|
339
382
|
|
340
383
|
### Bug fixes
|
341
384
|
|
342
385
|
* Correct calculation of whether a modifier version of a conditional statement will fit.
|
343
386
|
* Fix an error in `MultilineIfThen` cop that occurred in some special cases.
|
344
|
-
* [#231](https://github.com/bbatsov/rubocop/issues/231)
|
387
|
+
* [#231](https://github.com/bbatsov/rubocop/issues/231): fix a false positive for modifier if.
|
345
388
|
|
346
389
|
## 0.8.1 (05/30/2013)
|
347
390
|
|
348
391
|
### New features
|
349
392
|
|
350
|
-
* New cop `Proc` tracks uses of `Proc.new
|
393
|
+
* New cop `Proc` tracks uses of `Proc.new`.
|
351
394
|
|
352
395
|
### Changes
|
353
396
|
|
354
397
|
* Renamed `NewLambdaLiteral` to `Lambda`.
|
355
|
-
* Aligned the `Lambda` cop more closely to the style guide - it now
|
356
|
-
allows the use of `lambda` for multi-line blocks.
|
398
|
+
* Aligned the `Lambda` cop more closely to the style guide - it now allows the use of `lambda` for multi-line blocks.
|
357
399
|
|
358
400
|
### Bugs fixed
|
359
401
|
|
360
|
-
* [#210](https://github.com/bbatsov/rubocop/issues/210)
|
361
|
-
* [#211](https://github.com/bbatsov/rubocop/issues/211)
|
362
|
-
* [#215](https://github.com/bbatsov/rubocop/issues/215)
|
363
|
-
* [#213](https://github.com/bbatsov/rubocop/issues/213)
|
364
|
-
* [#214](https://github.com/bbatsov/rubocop/issues/214)
|
402
|
+
* [#210](https://github.com/bbatsov/rubocop/issues/210): fix a false positive for double quotes in regexp literals.
|
403
|
+
* [#211](https://github.com/bbatsov/rubocop/issues/211): fix a false positive for `initialize` method looking like a trivial writer.
|
404
|
+
* [#215](https://github.com/bbatsov/rubocop/issues/215): Fixed a lot of modifier `if/unless/while/until` issues.
|
405
|
+
* [#213](https://github.com/bbatsov/rubocop/issues/213): Make sure even disabled cops get their configuration set.
|
406
|
+
* [#214](https://github.com/bbatsov/rubocop/issues/214): Fix SpaceInsideHashLiteralBraces to handle string interpolation right.
|
365
407
|
|
366
408
|
## 0.8.0 (05/28/2013)
|
367
409
|
|
368
410
|
### Changes
|
369
411
|
|
370
|
-
* Folded `ArrayLiteral` and `HashLiteral` into `EmptyLiteral` cop
|
371
|
-
* The maximum number of params `ParameterLists` accepts in now configurable
|
412
|
+
* Folded `ArrayLiteral` and `HashLiteral` into `EmptyLiteral` cop.
|
413
|
+
* The maximum number of params `ParameterLists` accepts in now configurable.
|
372
414
|
* Reworked `SymbolSnakeCase` into `SymbolName`, which has an option `AllowCamelCase` enabled by default.
|
373
415
|
* Migrated from `Ripper` to the portable [Parser](https://github.com/whitequark/parser).
|
374
416
|
|
@@ -382,34 +424,34 @@
|
|
382
424
|
|
383
425
|
### Bugs fixed
|
384
426
|
|
385
|
-
* [#155](https://github.com/bbatsov/rubocop/issues/155) 'Do not use semicolons to terminate expressions.' is not implemented correctly
|
427
|
+
* [#155](https://github.com/bbatsov/rubocop/issues/155) 'Do not use semicolons to terminate expressions.' is not implemented correctly.
|
386
428
|
* `OpMethod` now handles definition of unary operators without crashing.
|
387
429
|
* `SymbolSnakeCase` now handles aliasing of operators without crashing.
|
388
430
|
* `RescueException` now handles the splat operator `*` in a `rescue` clause without crashing.
|
389
|
-
* [#159](https://github.com/bbatsov/rubocop/issues/159) AvoidFor cop misses many violations
|
431
|
+
* [#159](https://github.com/bbatsov/rubocop/issues/159) AvoidFor cop misses many violations.
|
390
432
|
|
391
433
|
## 0.7.1 (05/11/2013)
|
392
434
|
|
393
435
|
### Bugs fixed
|
394
436
|
|
395
|
-
* Added missing files to the gemspec
|
437
|
+
* Added missing files to the gemspec.
|
396
438
|
|
397
439
|
## 0.7.0 (05/11/2013)
|
398
440
|
|
399
441
|
### New features
|
400
442
|
|
401
|
-
* Added ability to include or exclude files/directories through `.rubocop.yml
|
443
|
+
* Added ability to include or exclude files/directories through `.rubocop.yml`.
|
402
444
|
* Added option --only for running a single cop.
|
403
|
-
* Relax semicolon rule for one line methods, classes and modules
|
445
|
+
* Relax semicolon rule for one line methods, classes and modules.
|
404
446
|
* Configuration files, such as `.rubocop.yml`, can now include configuration from other files through the `inherit_from` directive. All configuration files implicitly inherit from `config/default.yml`.
|
405
|
-
* New cop `ClassMethods` checks for uses for class/module names in definitions of class/module methods
|
406
|
-
* New cop `SingleLineMethods` checks for methods implemented on a single line
|
407
|
-
* New cop `FavorJoin` checks for usages of `Array#*` with a string argument
|
408
|
-
* New cop `BlockComments` tracks uses of block comments(`=begin/=end` comments)
|
409
|
-
* New cop `EmptyLines` tracks consecutive blank lines
|
447
|
+
* New cop `ClassMethods` checks for uses for class/module names in definitions of class/module methods.
|
448
|
+
* New cop `SingleLineMethods` checks for methods implemented on a single line.
|
449
|
+
* New cop `FavorJoin` checks for usages of `Array#*` with a string argument.
|
450
|
+
* New cop `BlockComments` tracks uses of block comments(`=begin/=end` comments).
|
451
|
+
* New cop `EmptyLines` tracks consecutive blank lines.
|
410
452
|
* New cop `WordArray` tracks arrays of words.
|
411
|
-
* [#108](https://github.com/bbatsov/rubocop/issues/108) New cop `SpaceInsideHashLiteralBraces` checks for spaces inside hash literal braces - style is configurable
|
412
|
-
* New cop `LineContinuation` tracks uses of the line continuation character (`\`)
|
453
|
+
* [#108](https://github.com/bbatsov/rubocop/issues/108) New cop `SpaceInsideHashLiteralBraces` checks for spaces inside hash literal braces - style is configurable.
|
454
|
+
* New cop `LineContinuation` tracks uses of the line continuation character (`\`).
|
413
455
|
* New cop `SymbolArray` tracks arrays of symbols.
|
414
456
|
* Print warnings for unrecognized names in configuration files.
|
415
457
|
* New cop `TrivialAccessors` tracks method definitions that could be automatically generated with `attr_*` methods.
|
@@ -422,37 +464,37 @@
|
|
422
464
|
|
423
465
|
### Bugs fixed
|
424
466
|
|
425
|
-
* [#101](https://github.com/bbatsov/rubocop/issues/101) `SpaceAroundEqualsInParameterDefault` doesn't work properly with empty string
|
426
|
-
* Fix `BraceAfterPercent` for `%W`, `%i` and `%I` and added more tests
|
427
|
-
* Fix a false positive in the `Alias` cop. `:alias` is no longer treated as keyword
|
428
|
-
* `ArrayLiteral` now properly detects `Array.new
|
429
|
-
* `HashLiteral` now properly detects `Hash.new
|
467
|
+
* [#101](https://github.com/bbatsov/rubocop/issues/101) `SpaceAroundEqualsInParameterDefault` doesn't work properly with empty string.
|
468
|
+
* Fix `BraceAfterPercent` for `%W`, `%i` and `%I` and added more tests.
|
469
|
+
* Fix a false positive in the `Alias` cop. `:alias` is no longer treated as keyword.
|
470
|
+
* `ArrayLiteral` now properly detects `Array.new`.
|
471
|
+
* `HashLiteral` now properly detects `Hash.new`.
|
430
472
|
* `VariableInterpolation` now detects regexp back references and doesn't crash.
|
431
|
-
* Don't generate pathnames like some/project//some.rb
|
432
|
-
* [#151](https://github.com/bbatsov/rubocop/issues/151) Don't print the unrecognized cop warning several times for the same `.rubocop.yml
|
473
|
+
* Don't generate pathnames like some/project//some.rb.
|
474
|
+
* [#151](https://github.com/bbatsov/rubocop/issues/151) Don't print the unrecognized cop warning several times for the same `.rubocop.yml`.
|
433
475
|
|
434
476
|
### Misc
|
435
477
|
|
436
|
-
* Renamed `Indentation` cop to `CaseIndentation` to avoid confusion
|
437
|
-
* Renamed `EmptyLines` cop to `EmptyLineBetweenDefs` to avoid confusion
|
478
|
+
* Renamed `Indentation` cop to `CaseIndentation` to avoid confusion.
|
479
|
+
* Renamed `EmptyLines` cop to `EmptyLineBetweenDefs` to avoid confusion.
|
438
480
|
|
439
481
|
## 0.6.1 (04/28/2013)
|
440
482
|
|
441
483
|
### New features
|
442
484
|
|
443
|
-
* Split `AsciiIdentifiersAndComments` cop in two separate cops
|
485
|
+
* Split `AsciiIdentifiersAndComments` cop in two separate cops.
|
444
486
|
|
445
487
|
### Bugs fixed
|
446
488
|
|
447
|
-
* [#90](https://github.com/bbatsov/rubocop/issues/90) Two cops crash when scanning code using `super
|
448
|
-
* [#93](https://github.com/bbatsov/rubocop/issues/93) Issue with `whitespace?': undefined method
|
449
|
-
* [#97](https://github.com/bbatsov/rubocop/issues/97) Build fails
|
450
|
-
* [#100](https://github.com/bbatsov/rubocop/issues/100) `OpMethod` cop doesn't work if method arg is not in braces
|
451
|
-
* `SymbolSnakeCase` now tracks Ruby 1.9 hash labels as well as regular symbols
|
489
|
+
* [#90](https://github.com/bbatsov/rubocop/issues/90) Two cops crash when scanning code using `super`.
|
490
|
+
* [#93](https://github.com/bbatsov/rubocop/issues/93) Issue with `whitespace?': undefined method`.
|
491
|
+
* [#97](https://github.com/bbatsov/rubocop/issues/97) Build fails.
|
492
|
+
* [#100](https://github.com/bbatsov/rubocop/issues/100) `OpMethod` cop doesn't work if method arg is not in braces.
|
493
|
+
* `SymbolSnakeCase` now tracks Ruby 1.9 hash labels as well as regular symbols.
|
452
494
|
|
453
495
|
### Misc
|
454
496
|
|
455
|
-
* [#88](https://github.com/bbatsov/rubocop/issues/88) Abort gracefully when interrupted with Ctrl-C
|
497
|
+
* [#88](https://github.com/bbatsov/rubocop/issues/88) Abort gracefully when interrupted with Ctrl-C.
|
456
498
|
* No longer crashes on bugs within cops. Now problematic checks are skipped and a message is displayed.
|
457
499
|
* Replaced `Term::ANSIColor` with `Rainbow`.
|
458
500
|
* Add an option to disable colors in the output.
|
@@ -462,17 +504,15 @@
|
|
462
504
|
|
463
505
|
### New features
|
464
506
|
|
465
|
-
* New cop `ReduceArguments` tracks argument names in reduce calls
|
466
|
-
* New cop `MethodLength` tracks number of LOC (lines of code) in methods
|
507
|
+
* New cop `ReduceArguments` tracks argument names in reduce calls.
|
508
|
+
* New cop `MethodLength` tracks number of LOC (lines of code) in methods.
|
467
509
|
* New cop `RescueModifier` tracks uses of `rescue` in modifier form.
|
468
510
|
* New cop `PercentLiterals` tracks uses of `%q`, `%Q`, `%s` and `%x`.
|
469
|
-
* New cop `BraceAfterPercent` tracks uses of % literals with
|
470
|
-
delimiters other than ().
|
511
|
+
* New cop `BraceAfterPercent` tracks uses of % literals with delimiters other than ().
|
471
512
|
* Support for disabling cops locally in a file with rubocop:disable comments.
|
472
513
|
* New cop `EnsureReturn` tracks usages of `return` in `ensure` blocks.
|
473
514
|
* New cop `HandleExceptions` tracks suppressed exceptions.
|
474
|
-
* New cop `AsciiIdentifiersAndComments` tracks uses of non-ascii
|
475
|
-
characters in identifiers and comments.
|
515
|
+
* New cop `AsciiIdentifiersAndComments` tracks uses of non-ascii characters in identifiers and comments.
|
476
516
|
* New cop `RescueException` tracks uses of rescuing the `Exception` class.
|
477
517
|
* New cop `ArrayLiteral` tracks uses of Array.new.
|
478
518
|
* New cop `HashLiteral` tracks uses of Hash.new.
|
@@ -482,31 +522,38 @@
|
|
482
522
|
|
483
523
|
### Bugs fixed
|
484
524
|
|
485
|
-
* [#62](https://github.com/bbatsov/rubocop/issues/62)
|
486
|
-
* [#65](https://github.com/bbatsov/rubocop/issues/65)
|
487
|
-
* [#66](https://github.com/bbatsov/rubocop/issues/66)
|
488
|
-
* [#70](https://github.com/bbatsov/rubocop/issues/70)
|
489
|
-
* [#64](https://github.com/bbatsov/rubocop/issues/64)
|
490
|
-
* [#75](https://github.com/bbatsov/rubocop/issues/75)
|
491
|
-
* [#79](https://github.com/bbatsov/rubocop/issues/79)
|
525
|
+
* [#62](https://github.com/bbatsov/rubocop/issues/62): Config files in ancestor directories are ignored if another exists in home directory.
|
526
|
+
* [#65](https://github.com/bbatsov/rubocop/issues/65): Suggests to convert symbols `:==`, `:<=>` and the like to snake_case.
|
527
|
+
* [#66](https://github.com/bbatsov/rubocop/issues/66): Does not crash on unreadable or unparseable files.
|
528
|
+
* [#70](https://github.com/bbatsov/rubocop/issues/70): Support `alias` with bareword arguments.
|
529
|
+
* [#64](https://github.com/bbatsov/rubocop/issues/64): Performance issue with Bundler.
|
530
|
+
* [#75](https://github.com/bbatsov/rubocop/issues/75): Make it clear that some global variables require the use of the English library.
|
531
|
+
* [#79](https://github.com/bbatsov/rubocop/issues/79): Ternary operator missing whitespace detection.
|
492
532
|
|
493
533
|
### Misc
|
494
534
|
|
495
|
-
* Dropped Jeweler for gem release management since it's no longer
|
496
|
-
actively maintained.
|
535
|
+
* Dropped Jeweler for gem release management since it's no longer actively maintained.
|
497
536
|
* Handle pluralization properly in the final summary.
|
498
537
|
|
499
538
|
## 0.5.0 (04/17/2013)
|
500
539
|
|
501
540
|
### New features
|
502
541
|
|
503
|
-
* New cop `FavorSprintf` that checks for usages of `String
|
504
|
-
* New cop `Semicolon` that checks for usages of `;` as expression separator
|
505
|
-
* New cop `VariableInterpolation` that checks for variable interpolation in double quoted strings
|
506
|
-
* New cop `Alias` that checks for uses of the keyword `alias
|
507
|
-
* Automatically detect extensionless Ruby files with shebangs when search for Ruby source files in a directory
|
542
|
+
* New cop `FavorSprintf` that checks for usages of `String#%`.
|
543
|
+
* New cop `Semicolon` that checks for usages of `;` as expression separator.
|
544
|
+
* New cop `VariableInterpolation` that checks for variable interpolation in double quoted strings.
|
545
|
+
* New cop `Alias` that checks for uses of the keyword `alias`.
|
546
|
+
* Automatically detect extensionless Ruby files with shebangs when search for Ruby source files in a directory.
|
508
547
|
|
509
548
|
### Bugs fixed
|
510
549
|
|
511
|
-
* [#59](https://github.com/bbatsov/rubocop/issues/59)
|
512
|
-
* [#42](https://github.com/bbatsov/rubocop/issues/42)
|
550
|
+
* [#59](https://github.com/bbatsov/rubocop/issues/59): Interpolated variables not enclosed in braces are not noticed.
|
551
|
+
* [#42](https://github.com/bbatsov/rubocop/issues/42): Received malformed format string ArgumentError from rubocop.
|
552
|
+
|
553
|
+
[@bbatsov]: https://github.com/bbatsov
|
554
|
+
[@jonas054]: https://github.com/jonas054
|
555
|
+
[@yujinakayama]: https://github.com/yujinakayama
|
556
|
+
[@dblock]: https://github.com/dblock
|
557
|
+
[@nevir]: https://github.com/nevir
|
558
|
+
[@daviddavis]: https://github.com/daviddavis
|
559
|
+
[@sds]: https://github.com/sds
|