rubocop 0.30.0 → 0.30.1
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/CHANGELOG.md +23 -0
- data/lib/rubocop/config.rb +12 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +6 -4
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +5 -4
- data/lib/rubocop/cop/performance/detect.rb +6 -2
- data/lib/rubocop/cop/performance/sample.rb +50 -24
- data/lib/rubocop/cop/rails/date.rb +4 -5
- data/lib/rubocop/cop/rails/time_zone.rb +47 -10
- data/lib/rubocop/cop/style/documentation.rb +6 -7
- data/lib/rubocop/cop/style/hash_syntax.rb +6 -1
- data/lib/rubocop/cop/style/indentation_width.rb +2 -0
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +2 -0
- data/lib/rubocop/cop/style/trailing_blank_lines.rb +11 -2
- data/lib/rubocop/cop/style/trailing_comma.rb +8 -1
- data/lib/rubocop/version.rb +1 -1
- data/relnotes/v0.30.1.md +102 -0
- data/rubocop.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ac3af5a6e2843d6162ca7003c8c634ea775ab8
|
4
|
+
data.tar.gz: 405ae47879512a38f71b7a976f81e630ff747733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad617b327afb98f2fbde6d7422101e68c75a67035ea58a10cde649d24d92ff3d24200fd298a76a08d8ec2501751c0d42f106a834f96ac32cfb6246766a5bd10b
|
7
|
+
data.tar.gz: 3bfc81a422483a54281b50576fe7a9fec0545bb74cc05b93ba5aa76e2a4372ac7759180e200d951cbd5b99c928373ff0b4e23cbd0788163f6bd53e25101abeb0
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,29 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.30.1 (21/04/2015)
|
6
|
+
|
7
|
+
### Bugs fixed
|
8
|
+
|
9
|
+
* [#1691](https://github.com/bbatsov/rubocop/issues/1691): For assignments with line break after `=`, use `keyword` alignment in `EndAlignment` regardless of configured style. ([@jonas054][])
|
10
|
+
* [#1769](https://github.com/bbatsov/rubocop/issues/1769): Fix bug where `LiteralInInterpolation` registers an offense for interpolation of `__LINE__`. ([@rrosenblum][])
|
11
|
+
* [#1773](https://github.com/bbatsov/rubocop/pull/1773): Fix typo ('strptime' -> 'strftime') in `Rails/TimeZone`. ([@palkan][])
|
12
|
+
* [#1777](https://github.com/bbatsov/rubocop/pull/1777): Fix offense message from Rails/TimeZone. ([@mzp][])
|
13
|
+
* [#1784](https://github.com/bbatsov/rubocop/pull/1784): Add an explicit error message when config contains an empty section. ([@bankair][])
|
14
|
+
* [#1791](https://github.com/bbatsov/rubocop/pull/1791): Fix autocorrection of `PercentLiteralDelimiters` with no content. ([@cshaffer][])
|
15
|
+
* Fix handling of `while` and `until` with assignment in `IndentationWidth`. ([@lumeet][])
|
16
|
+
* [#1793](https://github.com/bbatsov/rubocop/pull/1793): Fix bug in `TrailingComma` that caused `,` in comment to count as a trailing comma. ([@jonas054][])
|
17
|
+
* [#1765](https://github.com/bbatsov/rubocop/pull/1765): Update 1.9 hash to stop triggering when the symbol is not valid in the 1.9 hash syntax. ([@crimsonknave][])
|
18
|
+
* [#1806](https://github.com/bbatsov/rubocop/issues/1806): Require a newer version of `parser` and use its corrected solution for comment association in `Style/Documentation`. ([@jonas054][])
|
19
|
+
* [#1792](https://github.com/bbatsov/rubocop/issues/1792): Fix bugs in `Sample` that did not account for array selectors with a range and passing random to shuffle. ([@rrosenblum][])
|
20
|
+
* [#1770](https://github.com/bbatsov/rubocop/pull/1770): Add more acceptable methods to `Rails/TimeZone` (`utc`, `localtime`, `to_i`, `iso8601` etc). ([@palkan][])
|
21
|
+
* [#1795](https://github.com/bbatsov/rubocop/pull/1795): Fix bug in `TrailingBlankLines` that caused a crash for files containing only newlines. ([@renuo][])
|
22
|
+
|
5
23
|
## 0.30.0 (06/04/2015)
|
6
24
|
|
7
25
|
### New features
|
8
26
|
|
27
|
+
* [#1767](https://github.com/bbatsov/rubocop/pull/1767): Do not register offenses on non-enumerable select/find_all by `Performance/Detect`. ([@palkan][])
|
9
28
|
* [#1600](https://github.com/bbatsov/rubocop/issues/1600): Add `line_count_based` and `semantic` styles to the `BlockDelimiters` (formerly `Blocks`) cop. ([@clowder][], [@mudge][])
|
10
29
|
* [#1712](https://github.com/bbatsov/rubocop/pull/1712): Set `Offense#corrected?` to `true`, `false`, or `nil` when it was, wasn't, or can't be auto-corrected, respectively. ([@vassilevsky][])
|
11
30
|
* [#1669](https://github.com/bbatsov/rubocop/pull/1669): Add command-line switch `--display-style-guide`. ([@marxarelli][])
|
@@ -1332,3 +1351,7 @@
|
|
1332
1351
|
[@ypresto]: https://github.com/ypresto
|
1333
1352
|
[@clowder]: https://github.com/clowder
|
1334
1353
|
[@mudge]: https://github.com/mudge
|
1354
|
+
[@mzp]: https://github.com/mzp
|
1355
|
+
[@bankair]: https://github.com/bankair
|
1356
|
+
[@crimsonknave]: https://github.com/crimsonknave
|
1357
|
+
[@renuo]: https://github.com/renuo
|
data/lib/rubocop/config.rb
CHANGED
@@ -26,11 +26,14 @@ module RuboCop
|
|
26
26
|
|
27
27
|
def make_excludes_absolute
|
28
28
|
keys.each do |key|
|
29
|
+
validate_section_presence(key)
|
29
30
|
next unless self[key]['Exclude']
|
30
31
|
|
31
32
|
self[key]['Exclude'].map! do |exclude_elem|
|
32
33
|
if exclude_elem.is_a?(String) && !exclude_elem.start_with?('/')
|
33
|
-
File.
|
34
|
+
File.expand_path(
|
35
|
+
File.join(base_dir_for_path_parameters, exclude_elem)
|
36
|
+
)
|
34
37
|
else
|
35
38
|
exclude_elem
|
36
39
|
end
|
@@ -172,8 +175,16 @@ module RuboCop
|
|
172
175
|
|
173
176
|
private
|
174
177
|
|
178
|
+
def validate_section_presence(name)
|
179
|
+
return unless @hash.key?(name) && @hash[name].nil?
|
180
|
+
fail ValidationError,
|
181
|
+
"empty section #{name} found " \
|
182
|
+
"in #{loaded_path || self}"
|
183
|
+
end
|
184
|
+
|
175
185
|
def validate_parameter_names(valid_cop_names)
|
176
186
|
valid_cop_names.each do |name|
|
187
|
+
validate_section_presence(name)
|
177
188
|
@hash[name].each_key do |param|
|
178
189
|
next if COMMON_PARAMS.include?(param) ||
|
179
190
|
ConfigLoader.default_configuration[name].key?(param)
|
@@ -20,8 +20,6 @@ module RuboCop
|
|
20
20
|
include EndKeywordAlignment
|
21
21
|
include IfNode
|
22
22
|
|
23
|
-
MSG = '`end` at %d, %d is not aligned with `%s` at %d, %d'
|
24
|
-
|
25
23
|
def on_class(node)
|
26
24
|
check_offset_of_node(node)
|
27
25
|
end
|
@@ -55,8 +53,8 @@ module RuboCop
|
|
55
53
|
return unless [:if, :while, :until].include?(rhs.type)
|
56
54
|
return if ternary_op?(rhs)
|
57
55
|
|
58
|
-
|
59
|
-
|
56
|
+
expr = node.loc.expression
|
57
|
+
if style == :variable && !line_break_before_keyword?(expr, rhs)
|
60
58
|
range = Parser::Source::Range.new(expr.source_buffer,
|
61
59
|
expr.begin_pos,
|
62
60
|
rhs.loc.keyword.end_pos)
|
@@ -69,6 +67,10 @@ module RuboCop
|
|
69
67
|
check_offset(rhs, range.source, offset)
|
70
68
|
ignore_node(rhs) # Don't check again.
|
71
69
|
end
|
70
|
+
|
71
|
+
def line_break_before_keyword?(whole_expression, rhs)
|
72
|
+
rhs.loc.keyword.line > whole_expression.line
|
73
|
+
end
|
72
74
|
end
|
73
75
|
end
|
74
76
|
end
|
@@ -18,8 +18,7 @@ module RuboCop
|
|
18
18
|
node.children.select { |n| n.type == :begin }.each do |begin_node|
|
19
19
|
final_node = begin_node.children.last
|
20
20
|
next unless final_node
|
21
|
-
|
22
|
-
next if special_string?(final_node)
|
21
|
+
next if special_keyword?(final_node)
|
23
22
|
next unless LITERALS.include?(final_node.type)
|
24
23
|
|
25
24
|
add_offense(final_node, :expression)
|
@@ -28,8 +27,10 @@ module RuboCop
|
|
28
27
|
|
29
28
|
private
|
30
29
|
|
31
|
-
def
|
32
|
-
|
30
|
+
def special_keyword?(node)
|
31
|
+
# handle strings like __FILE__
|
32
|
+
(node.type == :str && !node.loc.respond_to?(:begin)) ||
|
33
|
+
node.loc.expression.is?('__LINE__')
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
@@ -28,9 +28,13 @@ module RuboCop
|
|
28
28
|
return unless second_method == :first || second_method == :last
|
29
29
|
return if receiver.nil?
|
30
30
|
|
31
|
-
receiver, _args,
|
31
|
+
receiver, _args, body = *receiver if receiver.block_type?
|
32
|
+
|
33
|
+
_, first_method, args = *receiver
|
34
|
+
|
35
|
+
# check that we have usual block or block pass
|
36
|
+
return if body.nil? && (args.nil? || !args.block_pass_type?)
|
32
37
|
|
33
|
-
_, first_method = *receiver
|
34
38
|
return unless SELECT_METHODS.include?(first_method)
|
35
39
|
|
36
40
|
range = receiver.loc.selector.join(node.loc.selector)
|
@@ -11,47 +11,73 @@ module RuboCop
|
|
11
11
|
# [1, 2, 3].shuffle.first
|
12
12
|
# [1, 2, 3].shuffle.last
|
13
13
|
# [1, 2, 3].shuffle[0]
|
14
|
+
# [1, 2, 3].shuffle[0, 3]
|
15
|
+
# [1, 2, 3].shuffle(random: Random.new(1))
|
14
16
|
#
|
15
17
|
# # good
|
16
18
|
# [1, 2, 3].sample
|
19
|
+
# [1, 2, 3].sample(3)
|
20
|
+
# [1, 2, 3].sample(random: Random.new(1))
|
17
21
|
class Sample < Cop
|
18
|
-
MSG = 'Use `sample` instead of `shuffle
|
19
|
-
|
20
|
-
ARRAY_SELECTORS = [:first, :last, :[]]
|
22
|
+
MSG = 'Use `sample` instead of `shuffle%s`.'
|
23
|
+
RANGE_TYPES = [:irange, :erange]
|
21
24
|
|
22
25
|
def on_send(node)
|
23
|
-
|
24
|
-
return unless
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
format(MSG_SELECTOR, selector.loc.expression.source)
|
26
|
+
_receiver, method, params, = *node
|
27
|
+
return unless method == :shuffle
|
28
|
+
_receiver, _method, params, = *node.parent if params.nil?
|
29
|
+
|
30
|
+
message = if params && params.lvar_type?
|
31
|
+
format(MSG, shuffle_params(node))
|
32
|
+
elsif node.parent
|
33
|
+
_params, selector = *node.parent
|
34
|
+
if selector == :[]
|
35
|
+
format(MSG, node.parent.loc.selector.source)
|
36
|
+
else
|
37
|
+
format(MSG, ".#{node.parent.loc.selector.source}")
|
38
|
+
end
|
37
39
|
else
|
38
|
-
format(MSG,
|
40
|
+
format(MSG, shuffle_params(node))
|
39
41
|
end
|
40
42
|
|
41
|
-
add_offense(node,
|
43
|
+
add_offense(node, range_of_shuffle(node), message)
|
42
44
|
end
|
43
45
|
|
44
46
|
def autocorrect(node)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
_receiver, _method, params, selector = *node
|
48
|
+
_receiver, _method, params, selector = *node.parent if params.nil?
|
49
|
+
|
50
|
+
return if params && RANGE_TYPES.include?(params.type)
|
51
|
+
|
52
|
+
range = if params && (params.hash_type? || params.lvar_type?)
|
53
|
+
range_of_shuffle(node)
|
54
|
+
else
|
55
|
+
Parser::Source::Range.new(node.loc.expression.source_buffer,
|
56
|
+
node.loc.selector.begin_pos,
|
57
|
+
node.parent.loc.selector.end_pos)
|
58
|
+
end
|
50
59
|
|
51
60
|
@corrections << lambda do |corrector|
|
52
61
|
corrector.replace(range, 'sample')
|
62
|
+
return if selector.nil?
|
63
|
+
corrector.insert_after(range, "(#{selector.loc.expression.source})")
|
53
64
|
end
|
54
65
|
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def range_of_shuffle(node)
|
70
|
+
Parser::Source::Range.new(node.loc.expression.source_buffer,
|
71
|
+
node.loc.selector.begin_pos,
|
72
|
+
node.loc.selector.end_pos)
|
73
|
+
end
|
74
|
+
|
75
|
+
def shuffle_params(node)
|
76
|
+
params = Parser::Source::Range.new(node.loc.expression.source_buffer,
|
77
|
+
node.loc.selector.end_pos,
|
78
|
+
node.loc.expression.end_pos)
|
79
|
+
params.source
|
80
|
+
end
|
55
81
|
end
|
56
82
|
end
|
57
83
|
end
|
@@ -70,7 +70,7 @@ module RuboCop
|
|
70
70
|
chain = extract_method_chain(node)
|
71
71
|
return if (chain & bad_days).empty?
|
72
72
|
|
73
|
-
method_name =
|
73
|
+
method_name = (chain & bad_days).join('.')
|
74
74
|
|
75
75
|
add_offense(node, :selector,
|
76
76
|
format(MSG,
|
@@ -81,10 +81,9 @@ module RuboCop
|
|
81
81
|
|
82
82
|
def extract_method_chain(node)
|
83
83
|
chain = []
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
p = p.parent
|
84
|
+
while !node.nil? && node.send_type?
|
85
|
+
chain << extract_method(node)
|
86
|
+
node = node.parent
|
88
87
|
end
|
89
88
|
chain
|
90
89
|
end
|
@@ -31,9 +31,15 @@ module RuboCop
|
|
31
31
|
|
32
32
|
MSG = 'Do not use `%s` without zone. Use `%s` instead.'
|
33
33
|
|
34
|
+
MSG_LOCALTIME = 'Do not use `Time.localtime` without offset or zone.'
|
35
|
+
|
34
36
|
TIMECLASS = [:Time, :DateTime]
|
35
37
|
|
36
|
-
DANGER_METHODS = [:now, :local, :new, :
|
38
|
+
DANGER_METHODS = [:now, :local, :new, :strftime, :parse, :at]
|
39
|
+
|
40
|
+
ACCEPTED_METHODS = [:in_time_zone, :utc,
|
41
|
+
:iso8601, :jisx0301, :rfc3339,
|
42
|
+
:to_i, :to_f]
|
37
43
|
|
38
44
|
def on_const(node)
|
39
45
|
_module, klass = *node
|
@@ -47,24 +53,25 @@ module RuboCop
|
|
47
53
|
|
48
54
|
def check_time_node(klass, node)
|
49
55
|
chain = extract_method_chain(node)
|
50
|
-
return if (chain
|
51
|
-
!(chain & good_methods).empty?
|
56
|
+
return if danger_chain?(chain)
|
52
57
|
|
53
|
-
|
58
|
+
return check_localtime(node) if need_check_localtime?(chain)
|
59
|
+
|
60
|
+
method_name = (chain & DANGER_METHODS).join('.')
|
61
|
+
safe_method_name = safe_method(method_name, node)
|
54
62
|
|
55
63
|
add_offense(node, :selector,
|
56
64
|
format(MSG,
|
57
65
|
"#{klass}.#{method_name}",
|
58
|
-
"
|
66
|
+
"Time.zone.#{safe_method_name}")
|
59
67
|
)
|
60
68
|
end
|
61
69
|
|
62
70
|
def extract_method_chain(node)
|
63
71
|
chain = []
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
p = p.parent
|
72
|
+
while !node.nil? && node.send_type?
|
73
|
+
chain << extract_method(node)
|
74
|
+
node = node.parent
|
68
75
|
end
|
69
76
|
chain
|
70
77
|
end
|
@@ -84,8 +91,38 @@ module RuboCop
|
|
84
91
|
receiver == node
|
85
92
|
end
|
86
93
|
|
94
|
+
def safe_method(method_name, node)
|
95
|
+
_receiver, _method_name, *args = *node
|
96
|
+
return method_name unless method_name == 'new'
|
97
|
+
|
98
|
+
if args.empty?
|
99
|
+
'now'
|
100
|
+
else
|
101
|
+
'local'
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def check_localtime(node)
|
106
|
+
selector_node = node
|
107
|
+
while !node.nil? && node.send_type?
|
108
|
+
break if extract_method(node) == :localtime
|
109
|
+
node = node.parent
|
110
|
+
end
|
111
|
+
_receiver, _method, args = *node
|
112
|
+
|
113
|
+
add_offense(selector_node, :selector, MSG_LOCALTIME) if args.nil?
|
114
|
+
end
|
115
|
+
|
116
|
+
def danger_chain?(chain)
|
117
|
+
(chain & DANGER_METHODS).empty? || !(chain & good_methods).empty?
|
118
|
+
end
|
119
|
+
|
120
|
+
def need_check_localtime?(chain)
|
121
|
+
(style == :acceptable) && chain.include?(:localtime)
|
122
|
+
end
|
123
|
+
|
87
124
|
def good_methods
|
88
|
-
style == :always ? [:zone] : [:zone
|
125
|
+
style == :always ? [:zone] : [:zone] + ACCEPTED_METHODS
|
89
126
|
end
|
90
127
|
end
|
91
128
|
end
|
@@ -83,16 +83,15 @@ module RuboCop
|
|
83
83
|
comment_line =~ /^\s*#/
|
84
84
|
end
|
85
85
|
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# :
|
86
|
+
# First checks if the :nodoc: comment is associated with the
|
87
|
+
# class/module. Unless the element is tagged with :nodoc:, the search
|
88
|
+
# proceeds to check its ancestors for :nodoc: all.
|
89
|
+
# Note: How end-of-line comments are associated with code changed in
|
90
|
+
# parser-2.2.0.4.
|
90
91
|
def nodoc?(node, ast_with_comments, require_all = false)
|
91
92
|
return false unless node
|
92
|
-
nodoc_node = node.children.
|
93
|
+
nodoc_node = node.children.first
|
93
94
|
return false unless nodoc_node
|
94
|
-
|
95
|
-
nodoc_node = nodoc_node.children.first while nodoc_node.type == :begin
|
96
95
|
comment = ast_with_comments[nodoc_node].first
|
97
96
|
|
98
97
|
if comment && comment.loc.line == node.loc.line
|
@@ -96,7 +96,12 @@ module RuboCop
|
|
96
96
|
return false unless key.sym_type?
|
97
97
|
|
98
98
|
sym_name = key.loc.expression.source
|
99
|
-
sym_name
|
99
|
+
valid_19_syntax_symbol?(sym_name)
|
100
|
+
end
|
101
|
+
|
102
|
+
def valid_19_syntax_symbol?(sym_name)
|
103
|
+
sym_name.sub!(/\A:/, '')
|
104
|
+
RuboCop::ProcessedSource.new("{ #{sym_name}: :foo }").valid_syntax?
|
100
105
|
end
|
101
106
|
|
102
107
|
def check(pairs, delim, msg)
|
@@ -16,8 +16,7 @@ module RuboCop
|
|
16
16
|
# followed by some data to read. If so, we don't check it because
|
17
17
|
# there could be good reasons why it needs to end with a certain
|
18
18
|
# number of newlines.
|
19
|
-
|
20
|
-
return if extra.strip.start_with?('__END__')
|
19
|
+
return if ends_in_end?(processed_source)
|
21
20
|
|
22
21
|
whitespace_at_end = sb.source[/\s*\Z/]
|
23
22
|
blank_lines = whitespace_at_end.count("\n") - 1
|
@@ -37,6 +36,16 @@ module RuboCop
|
|
37
36
|
|
38
37
|
private
|
39
38
|
|
39
|
+
def ends_in_end?(processed_source)
|
40
|
+
sb = processed_source.buffer
|
41
|
+
|
42
|
+
return true if sb.source.strip.start_with?('__END__')
|
43
|
+
return false if processed_source.tokens.empty?
|
44
|
+
|
45
|
+
extra = sb.source[processed_source.tokens.last.pos.end_pos..-1]
|
46
|
+
extra.strip.start_with?('__END__')
|
47
|
+
end
|
48
|
+
|
40
49
|
def message(wanted_blank_lines, blank_lines)
|
41
50
|
case blank_lines
|
42
51
|
when -1
|
@@ -78,7 +78,7 @@ module RuboCop
|
|
78
78
|
comma_offset = after_last_item.source =~ /,/
|
79
79
|
should_have_comma =
|
80
80
|
[:comma, :consistent_comma].include?(style) && multiline?(node)
|
81
|
-
if comma_offset
|
81
|
+
if comma_offset && !inside_comment?(after_last_item, comma_offset)
|
82
82
|
unless should_have_comma
|
83
83
|
extra_info = case style
|
84
84
|
when :comma
|
@@ -97,6 +97,13 @@ module RuboCop
|
|
97
97
|
end
|
98
98
|
# rubocop:enable Metrics/MethodLength
|
99
99
|
|
100
|
+
def inside_comment?(range, comma_offset)
|
101
|
+
processed_source.comments.any? do |comment|
|
102
|
+
comment_offset = comment.loc.expression.begin_pos - range.begin_pos
|
103
|
+
comment_offset >= 0 && comment_offset < comma_offset
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
100
107
|
def heredoc?(source_after_last_item)
|
101
108
|
source_after_last_item =~ /\w/
|
102
109
|
end
|
data/lib/rubocop/version.rb
CHANGED
data/relnotes/v0.30.1.md
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
Enjoy all those bug-fixes!
|
2
|
+
|
3
|
+
### Bugs fixed
|
4
|
+
|
5
|
+
* [#1691](https://github.com/bbatsov/rubocop/issues/1691): For assignments with line break after `=`, use `keyword` alignment in `EndAlignment` regardless of configured style. ([@jonas054][])
|
6
|
+
* [#1769](https://github.com/bbatsov/rubocop/issues/1769): Fix bug where `LiteralInInterpolation` registers an offense for interpolation of `__LINE__`. ([@rrosenblum][])
|
7
|
+
* [#1773](https://github.com/bbatsov/rubocop/pull/1773): Fix typo ('strptime' -> 'strftime') in `Rails/TimeZone`. ([@palkan][])
|
8
|
+
* [#1777](https://github.com/bbatsov/rubocop/pull/1777): Fix offense message from Rails/TimeZone. ([@mzp][])
|
9
|
+
* [#1784](https://github.com/bbatsov/rubocop/pull/1784): Add an explicit error message when config contains an empty section. ([@bankair][])
|
10
|
+
* [#1791](https://github.com/bbatsov/rubocop/pull/1791): Fix autocorrection of `PercentLiteralDelimiters` with no content. ([@cshaffer][])
|
11
|
+
* Fix handling of `while` and `until` with assignment in `IndentationWidth`. ([@lumeet][])
|
12
|
+
* [#1793](https://github.com/bbatsov/rubocop/pull/1793): Fix bug in `TrailingComma` that caused `,` in comment to count as a trailing comma. ([@jonas054][])
|
13
|
+
* [#1765](https://github.com/bbatsov/rubocop/pull/1765): Update 1.9 hash to stop triggering when the symbol is not valid in the 1.9 hash syntax. ([@crimsonknave][])
|
14
|
+
* [#1806](https://github.com/bbatsov/rubocop/issues/1806): Require a newer version of `parser` and use its corrected solution for comment association in `Style/Documentation`. ([@jonas054][])
|
15
|
+
* [#1792](https://github.com/bbatsov/rubocop/issues/1792): Fix bugs in `Sample` that did not account for array selectors with a range and passing random to shuffle. ([@rrosenblum][])
|
16
|
+
* [#1770](https://github.com/bbatsov/rubocop/pull/1770): Add more acceptable methods to `Rails/TimeZone` (`utc`, `localtime`, `to_i`, `iso8601` etc). ([@palkan][])
|
17
|
+
* [#1795](https://github.com/bbatsov/rubocop/pull/1795): Fix bug in `TrailingBlankLines` that caused a crash for files containing only newlines. ([@renuo][])
|
18
|
+
|
19
|
+
[@bbatsov]: https://github.com/bbatsov
|
20
|
+
[@jonas054]: https://github.com/jonas054
|
21
|
+
[@yujinakayama]: https://github.com/yujinakayama
|
22
|
+
[@dblock]: https://github.com/dblock
|
23
|
+
[@nevir]: https://github.com/nevir
|
24
|
+
[@daviddavis]: https://github.com/daviddavis
|
25
|
+
[@sds]: https://github.com/sds
|
26
|
+
[@fancyremarker]: https://github.com/fancyremarker
|
27
|
+
[@sinisterchipmunk]: https://github.com/sinisterchipmunk
|
28
|
+
[@vonTronje]: https://github.com/vonTronje
|
29
|
+
[@agrimm]: https://github.com/agrimm
|
30
|
+
[@pmenglund]: https://github.com/pmenglund
|
31
|
+
[@chulkilee]: https://github.com/chulkilee
|
32
|
+
[@codez]: https://github.com/codez
|
33
|
+
[@emou]: https://github.com/emou
|
34
|
+
[@skanev]: http://github.com/skanev
|
35
|
+
[@claco]: http://github.com/claco
|
36
|
+
[@rifraf]: http://github.com/rifraf
|
37
|
+
[@scottmatthewman]: https://github.com/scottmatthewman
|
38
|
+
[@ma2gedev]: http://github.com/ma2gedev
|
39
|
+
[@jeremyolliver]: https://github.com/jeremyolliver
|
40
|
+
[@hannestyden]: https://github.com/hannestyden
|
41
|
+
[@geniou]: https://github.com/geniou
|
42
|
+
[@jkogara]: https://github.com/jkogara
|
43
|
+
[@tmorris-fiksu]: https://github.com/tmorris-fiksu
|
44
|
+
[@mockdeep]: https://github.com/mockdeep
|
45
|
+
[@hiroponz]: https://github.com/hiroponz
|
46
|
+
[@tamird]: https://github.com/tamird
|
47
|
+
[@fshowalter]: https://github.com/fshowalter
|
48
|
+
[@cschramm]: https://github.com/cschramm
|
49
|
+
[@bquorning]: https://github.com/bquorning
|
50
|
+
[@bcobb]: https://github.com/bcobb
|
51
|
+
[@irrationalfab]: https://github.com/irrationalfab
|
52
|
+
[@tommeier]: https://github.com/tommeier
|
53
|
+
[@sfeldon]: https://github.com/sfeldon
|
54
|
+
[@biinari]: https://github.com/biinari
|
55
|
+
[@barunio]: https://github.com/barunio
|
56
|
+
[@molawson]: https://github.com/molawson
|
57
|
+
[@wndhydrnt]: https://github.com/wndhydrnt
|
58
|
+
[@ggilder]: https://github.com/ggilder
|
59
|
+
[@salbertson]: https://github.com/salbertson
|
60
|
+
[@camilleldn]: https://github.com/camilleldn
|
61
|
+
[@mcls]: https://github.com/mcls
|
62
|
+
[@yous]: https://github.com/yous
|
63
|
+
[@vrthra]: https://github.com/vrthra
|
64
|
+
[@SkuliOskarsson]: https://github.com/SkuliOskarsson
|
65
|
+
[@jspanjers]: https://github.com/jspanjers
|
66
|
+
[@sch1zo]: https://github.com/sch1zo
|
67
|
+
[@smangelsdorf]: https://github.com/smangelsdorf
|
68
|
+
[@mvz]: https://github.com/mvz
|
69
|
+
[@jfelchner]: https://github.com/jfelchner
|
70
|
+
[@janraasch]: https://github.com/janraasch
|
71
|
+
[@jcarbo]: https://github.com/jcarbo
|
72
|
+
[@oneamtu]: https://github.com/oneamtu
|
73
|
+
[@toy]: https://github.com/toy
|
74
|
+
[@Koronen]: https://github.com/Koronen
|
75
|
+
[@blainesch]: https://github.com/blainesch
|
76
|
+
[@marxarelli]: https://github.com/marxarelli
|
77
|
+
[@katieschilling]: https://github.com/katieschilling
|
78
|
+
[@kakutani]: https://github.com/kakutani
|
79
|
+
[@rrosenblum]: https://github.com/rrosenblum
|
80
|
+
[@mattjmcnaughton]: https://github.com/mattjmcnaughton
|
81
|
+
[@huerlisi]: https://github.com/huerlisi
|
82
|
+
[@volkert]: https://github.com/volkert
|
83
|
+
[@lumeet]: https://github.com/lumeet
|
84
|
+
[@mmozuras]: https://github.com/mmozuras
|
85
|
+
[@d4rk5eed]: https://github.com/d4rk5eed
|
86
|
+
[@cshaffer]: https://github.com/cshaffer
|
87
|
+
[@eitoball]: https://github.com/eitoball
|
88
|
+
[@iainbeeston]: https://github.com/iainbeeston
|
89
|
+
[@pimterry]: https://github.com/pimterry
|
90
|
+
[@palkan]: https://github.com/palkan
|
91
|
+
[@jdoconnor]: https://github.com/jdoconnor
|
92
|
+
[@meganemura]: https://github.com/meganemura
|
93
|
+
[@zvkemp]: https://github.com/zvkemp
|
94
|
+
[@vassilevsky]: https://github.com/vassilevsky
|
95
|
+
[@gerry3]: https://github.com/gerry3
|
96
|
+
[@ypresto]: https://github.com/ypresto
|
97
|
+
[@clowder]: https://github.com/clowder
|
98
|
+
[@mudge]: https://github.com/mudge
|
99
|
+
[@mzp]: https://github.com/mzp
|
100
|
+
[@bankair]: https://github.com/bankair
|
101
|
+
[@crimsonknave]: https://github.com/crimsonknave
|
102
|
+
[@renuo]: https://github.com/renuo
|
data/rubocop.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.summary = 'Automatic Ruby code style checking tool.'
|
40
40
|
|
41
41
|
s.add_runtime_dependency('rainbow', '>= 1.99.1', '< 3.0')
|
42
|
-
s.add_runtime_dependency('parser', '>= 2.2.
|
42
|
+
s.add_runtime_dependency('parser', '>= 2.2.2.1', '< 3.0')
|
43
43
|
s.add_runtime_dependency('powerpack', '~> 0.1')
|
44
44
|
s.add_runtime_dependency('astrolabe', '~> 1.3')
|
45
45
|
s.add_runtime_dependency('ruby-progressbar', '~> 1.4')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.30.
|
4
|
+
version: 0.30.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-04-
|
13
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rainbow
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.2.
|
41
|
+
version: 2.2.2.1
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '3.0'
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: 2.2.
|
51
|
+
version: 2.2.2.1
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
@@ -501,6 +501,7 @@ files:
|
|
501
501
|
- relnotes/v0.29.0.md
|
502
502
|
- relnotes/v0.29.1.md
|
503
503
|
- relnotes/v0.30.0.md
|
504
|
+
- relnotes/v0.30.1.md
|
504
505
|
- rubocop.gemspec
|
505
506
|
homepage: http://github.com/bbatsov/rubocop
|
506
507
|
licenses:
|