Skip to content

Commit f697d0b

Browse files
author
Ale Paredes
authored
Updated channel and documentation to Rubocop v0.60 (#139)
1 parent 9d00c5e commit f697d0b

File tree

157 files changed

+2892
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+2892
-434
lines changed

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ source 'https://rubygems.org'
44

55
gem "activesupport", require: false
66
gem "mry", "~> 0.52.0", require: false
7-
gem "parser", "~> 2.4.0"
7+
gem "parser"
88
gem "pry", require: false
9-
gem "rubocop", "~> 0.52.1", require: false
9+
gem "rubocop", "~> 0.60", require: false
1010
gem "rubocop-migrations", require: false
1111
gem "rubocop-rspec", require: false
1212
gem "safe_yaml"

Gemfile.lock

+16-14
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ GEM
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
tzinfo (~> 1.1)
9-
ast (2.3.0)
9+
ast (2.4.0)
1010
coderay (1.1.2)
1111
concurrent-ruby (1.0.5)
1212
diff-lcs (1.3)
1313
i18n (0.9.1)
1414
concurrent-ruby (~> 1.0)
15+
jaro_winkler (1.5.1)
1516
method_source (0.9.0)
1617
minitest (5.10.3)
1718
mry (0.52.0.0)
1819
rubocop (>= 0.41.0)
1920
parallel (1.12.1)
20-
parser (2.4.0.2)
21-
ast (~> 2.3)
22-
powerpack (0.1.1)
21+
parser (2.5.3.0)
22+
ast (~> 2.4.0)
23+
powerpack (0.1.2)
2324
pry (0.11.3)
2425
coderay (~> 1.1.0)
2526
method_source (~> 0.9.0)
@@ -38,38 +39,39 @@ GEM
3839
diff-lcs (>= 1.2.0, < 2.0)
3940
rspec-support (~> 3.7.0)
4041
rspec-support (3.7.0)
41-
rubocop (0.52.1)
42+
rubocop (0.60.0)
43+
jaro_winkler (~> 1.5.1)
4244
parallel (~> 1.10)
43-
parser (>= 2.4.0.2, < 3.0)
45+
parser (>= 2.5, != 2.5.1.1)
4446
powerpack (~> 0.1)
4547
rainbow (>= 2.2.2, < 4.0)
4648
ruby-progressbar (~> 1.7)
47-
unicode-display_width (~> 1.0, >= 1.0.1)
49+
unicode-display_width (~> 1.4.0)
4850
rubocop-migrations (0.1.2)
4951
rubocop (~> 0.41)
50-
rubocop-rspec (1.21.0)
51-
rubocop (>= 0.52.0)
52-
ruby-progressbar (1.9.0)
52+
rubocop-rspec (1.30.1)
53+
rubocop (>= 0.60.0)
54+
ruby-progressbar (1.10.0)
5355
safe_yaml (1.0.4)
5456
thread_safe (0.3.6)
5557
tzinfo (1.2.4)
5658
thread_safe (~> 0.1)
57-
unicode-display_width (1.3.0)
59+
unicode-display_width (1.4.0)
5860

5961
PLATFORMS
6062
ruby
6163

6264
DEPENDENCIES
6365
activesupport
6466
mry (~> 0.52.0)
65-
parser (~> 2.4.0)
67+
parser
6668
pry
6769
rake
6870
rspec
69-
rubocop (~> 0.52.1)
71+
rubocop (~> 0.60)
7072
rubocop-migrations
7173
rubocop-rspec
7274
safe_yaml
7375

7476
BUNDLED WITH
75-
1.16.1
77+
1.16.6
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Add a comment describing each gem in your Gemfile.
2+
3+
### Example:
4+
# bad
5+
6+
gem 'foo'
7+
8+
# good
9+
10+
# Helpers for the foo things.
11+
gem 'foo'

config/contents/bundler/insecure_protocol_source.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The symbol argument `:gemcutter`, `:rubygems` and `:rubyforge`
1+
The symbol argument `:gemcutter`, `:rubygems`, and `:rubyforge`
22
are deprecated. So please change your source to URL string that
33
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
44

config/contents/gemspec/duplicated_assignment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ in a gemspec.
33

44
Assigning to an attribute with the same name using `spec.foo =` will be
55
an unintended usage. On the other hand, duplication of methods such
6-
as `spec.requirements`, `spec.add_runtime_dependency` and others are
6+
as `spec.requirements`, `spec.add_runtime_dependency`, and others are
77
permitted because it is the intended use of appending values.
88

99
### Example:

config/contents/layout/align_hash.md

+114-39
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Check that the keys, separators, and values of a multi-line hash
22
literal are aligned according to configuration. The configuration
33
options are:
44

5-
- key (left align keys)
5+
- key (left align keys, one space before hash rockets and values)
66
- separator (align hash rockets and colons, right align keys)
77
- table (left align keys, hash rockets, and values)
88

@@ -14,81 +14,156 @@ can also be configured. The options are:
1414
- ignore_implicit (without curly braces)
1515
- ignore_explicit (with curly braces)
1616

17-
### Example:
18-
19-
# EnforcedHashRocketStyle: key (default)
20-
# EnforcedColonStyle: key (default)
21-
22-
# good
17+
### Example: EnforcedHashRocketStyle: key (default)
18+
# bad
2319
{
24-
foo: bar,
25-
ba: baz
20+
:foo => bar,
21+
:ba => baz
22+
}
23+
{
24+
:foo => bar,
25+
:ba => baz
2626
}
27+
28+
# good
2729
{
2830
:foo => bar,
2931
:ba => baz
3032
}
3133

34+
### Example: EnforcedHashRocketStyle: separator
3235
# bad
3336
{
34-
foo: bar,
35-
ba: baz
37+
:foo => bar,
38+
:ba => baz
3639
}
3740
{
3841
:foo => bar,
39-
:ba => baz
42+
:ba => baz
4043
}
4144

42-
### Example:
43-
44-
# EnforcedHashRocketStyle: separator
45-
# EnforcedColonStyle: separator
46-
47-
#good
48-
{
49-
foo: bar,
50-
ba: baz
51-
}
45+
# good
5246
{
5347
:foo => bar,
5448
:ba => baz
5549
}
5650

57-
#bad
58-
{
59-
foo: bar,
60-
ba: baz
61-
}
51+
### Example: EnforcedHashRocketStyle: table
52+
# bad
6253
{
6354
:foo => bar,
64-
:ba => baz
55+
:ba => baz
6556
}
57+
58+
# good
6659
{
6760
:foo => bar,
6861
:ba => baz
6962
}
7063

71-
### Example:
64+
### Example: EnforcedColonStyle: key (default)
65+
# bad
66+
{
67+
foo: bar,
68+
ba: baz
69+
}
70+
{
71+
foo: bar,
72+
ba: baz
73+
}
7274

73-
# EnforcedHashRocketStyle: table
74-
# EnforcedColonStyle: table
75+
# good
76+
{
77+
foo: bar,
78+
ba: baz
79+
}
7580

76-
#good
81+
### Example: EnforcedColonStyle: separator
82+
# bad
7783
{
7884
foo: bar,
79-
ba: baz
85+
ba: baz
8086
}
87+
88+
# good
8189
{
82-
:foo => bar,
83-
:ba => baz
90+
foo: bar,
91+
ba: baz
8492
}
8593

86-
#bad
94+
### Example: EnforcedColonStyle: table
95+
# bad
8796
{
8897
foo: bar,
8998
ba: baz
9099
}
100+
101+
# good
91102
{
92-
:foo => bar,
93-
:ba => baz
94-
}
103+
foo: bar,
104+
ba: baz
105+
}
106+
107+
### Example: EnforcedLastArgumentHashStyle: always_inspect (default)
108+
# Inspect both implicit and explicit hashes.
109+
110+
# bad
111+
do_something(foo: 1,
112+
bar: 2)
113+
114+
# bad
115+
do_something({foo: 1,
116+
bar: 2})
117+
118+
# good
119+
do_something(foo: 1,
120+
bar: 2)
121+
122+
# good
123+
do_something(
124+
foo: 1,
125+
bar: 2
126+
)
127+
128+
# good
129+
do_something({foo: 1,
130+
bar: 2})
131+
132+
# good
133+
do_something({
134+
foo: 1,
135+
bar: 2
136+
})
137+
138+
### Example: EnforcedLastArgumentHashStyle: always_ignore
139+
# Ignore both implicit and explicit hashes.
140+
141+
# good
142+
do_something(foo: 1,
143+
bar: 2)
144+
145+
# good
146+
do_something({foo: 1,
147+
bar: 2})
148+
149+
### Example: EnforcedLastArgumentHashStyle: ignore_implicit
150+
# Ignore only implicit hashes.
151+
152+
# bad
153+
do_something({foo: 1,
154+
bar: 2})
155+
156+
# good
157+
do_something(foo: 1,
158+
bar: 2)
159+
160+
### Example: EnforcedLastArgumentHashStyle: ignore_explicit
161+
# Ignore only explicit hashes.
162+
163+
# bad
164+
do_something(foo: 1,
165+
bar: 2)
166+
167+
# good
168+
do_something({foo: 1,
169+
bar: 2})
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
This cop checks whether the end keywords are aligned properly for do
2+
end blocks.
3+
4+
Three modes are supported through the `EnforcedStyleAlignWith`
5+
configuration parameter:
6+
7+
`start_of_block` : the `end` shall be aligned with the
8+
start of the line where the `do` appeared.
9+
10+
`start_of_line` : the `end` shall be aligned with the
11+
start of the line where the expression started.
12+
13+
`either` (which is the default) : the `end` is allowed to be in either
14+
location. The autofixer will default to `start_of_line`.
15+
16+
### Example: EnforcedStyleAlignWith: either (default)
17+
# bad
18+
19+
foo.bar
20+
.each do
21+
baz
22+
end
23+
24+
# good
25+
26+
variable = lambda do |i|
27+
i
28+
end
29+
30+
### Example: EnforcedStyleAlignWith: start_of_block
31+
# bad
32+
33+
foo.bar
34+
.each do
35+
baz
36+
end
37+
38+
# good
39+
40+
foo.bar
41+
.each do
42+
baz
43+
end
44+
45+
### Example: EnforcedStyleAlignWith: start_of_line
46+
# bad
47+
48+
foo.bar
49+
.each do
50+
baz
51+
end
52+
53+
# good
54+
55+
foo.bar
56+
.each do
57+
baz
58+
end

config/contents/layout/class_structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ possible to group categories of macros.
9898
end
9999
end
100100
101-
@see https://github.com/bbatsov/ruby-style-guide#consistent-classes
101+
@see https://github.com/rubocop-hq/ruby-style-guide#consistent-classes

0 commit comments

Comments
 (0)