Skip to content

Commit d4ea5be

Browse files
authored
Add channel/rubocop-1-11-0 (#279)
* Update rubocop to v1.11.0 * Update scraped documentation
1 parent 9b1400f commit d4ea5be

File tree

10 files changed

+85
-15
lines changed

10 files changed

+85
-15
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ gem "activesupport", require: false
66
gem "mry", require: false
77
gem "parser"
88
gem "pry", require: false
9-
gem "rubocop", "1.10.0", require: false
9+
gem "rubocop", "1.11.0", require: false
1010
gem "rubocop-i18n", require: false
1111
gem "rubocop-graphql", require: false
1212
gem "rubocop-minitest", require: false

Gemfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ GEM
1818
mry (0.78.0.0)
1919
rubocop (>= 0.41.0)
2020
parallel (1.20.1)
21-
parser (3.0.0.0)
21+
parser (3.0.1.1)
2222
ast (~> 2.4.1)
2323
pry (0.13.1)
2424
coderay (~> 1.1)
2525
method_source (~> 1.0)
2626
rack (2.2.3)
2727
rainbow (3.0.0)
2828
rake (13.0.1)
29-
regexp_parser (2.0.3)
30-
rexml (3.2.4)
29+
regexp_parser (2.1.1)
30+
rexml (3.2.5)
3131
rspec (3.9.0)
3232
rspec-core (~> 3.9.0)
3333
rspec-expectations (~> 3.9.0)
@@ -41,7 +41,7 @@ GEM
4141
diff-lcs (>= 1.2.0, < 2.0)
4242
rspec-support (~> 3.9.0)
4343
rspec-support (3.9.3)
44-
rubocop (1.10.0)
44+
rubocop (1.11.0)
4545
parallel (~> 1.10)
4646
parser (>= 3.0.0.0)
4747
rainbow (>= 2.2.2, < 4.0)
@@ -50,8 +50,8 @@ GEM
5050
rubocop-ast (>= 1.2.0, < 2.0)
5151
ruby-progressbar (~> 1.7)
5252
unicode-display_width (>= 1.4.0, < 3.0)
53-
rubocop-ast (1.4.1)
54-
parser (>= 2.7.1.5)
53+
rubocop-ast (1.7.0)
54+
parser (>= 3.0.1.1)
5555
rubocop-graphql (0.9.0)
5656
rubocop (>= 0.87, < 2)
5757
rubocop-i18n (3.0.0)
@@ -93,7 +93,7 @@ DEPENDENCIES
9393
pry
9494
rake
9595
rspec
96-
rubocop (= 1.10.0)
96+
rubocop (= 1.11.0)
9797
rubocop-graphql
9898
rubocop-i18n
9999
rubocop-minitest

config/contents/bundler/duplicated_gem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A Gem's requirements should be listed only once in a Gemfile.
2525
if Dir.exist?(local)
2626
gem 'rubocop', path: local
2727
elsif ENV['RUBOCOP_VERSION'] == 'master'
28-
gem 'rubocop', git: 'https://github.com/rubocop-hq/rubocop.git'
28+
gem 'rubocop', git: 'https://github.com/rubocop/rubocop.git'
2929
else
3030
gem 'rubocop', '~> 0.90.0'
3131
end

config/contents/layout/extra_spacing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ This cop checks for extra/unnecessary whitespace.
66
name = "RuboCop"
77
# Some comment and an empty line
88

9-
website += "/rubocop-hq/rubocop" unless cond
9+
website += "/rubocop/rubocop" unless cond
1010
puts "rubocop" if debug
1111

1212
# bad for any configuration
1313
set_app("RuboCop")
14-
website = "https://github.com/rubocop-hq/rubocop"
14+
website = "https://github.com/rubocop/rubocop"
1515

1616
# good only if AllowBeforeTrailingComments is true
1717
object.method(arg) # this is a comment

config/contents/lint/debugger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Specific default groups can be disabled if necessary:
1111
----
1212
Lint/Debugger:
1313
WebConsole: ~
14-
---
14+
----
1515

1616

1717
### Example:

config/contents/lint/duplicate_branch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ as offenses if they return a constant value.
6969
else 250
7070
end
7171

72-
### Example: IgnoreLiteralBranches: true
72+
### Example: IgnoreConstantBranches: true
7373
# good
7474
case size
7575
when "small" then SMALL_SIZE

config/contents/style/endless_method.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ for single-lined method bodies, or disallow endless methods.
66
Other method definition types are not considered by this cop.
77

88
The supported styles are:
9+
910
* allow_single_line (default) - only single line endless method definitions are allowed.
1011
* allow_always - all endless method definitions are allowed.
1112
* disallow - all endless method definitions are disallowed.

config/contents/style/hash_conversion.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
This cop checks the usage of pre-2.1 `Hash[args]` method of converting enumerables and
22
sequences of values to hashes.
33

4+
Correction code from splat argument (`Hash[*ary]`) is not simply determined. For example,
5+
`Hash[*ary]` can be replaced with `ary.each_slice(2).to_h` but it will be complicated.
6+
So, `AllowSplatArgument` option is true by default to allow splat argument for simple code.
7+
48
### Example:
59
# bad
610
Hash[ary]
@@ -12,4 +16,12 @@ sequences of values to hashes.
1216
Hash[key1, value1, key2, value2]
1317

1418
# good
15-
{key1 => value1, key2 => value2}
19+
{key1 => value1, key2 => value2}
20+
21+
### Example: AllowSplatArgument: true (default)
22+
# good
23+
Hash[*ary]
24+
25+
### Example: AllowSplatArgument: false
26+
# bad
27+
Hash[*ary]

config/contents/style/symbol_proc.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
Use symbols as procs when possible.
22

3+
If you prefer a style that allows block for method with arguments,
4+
please set `true` to `AllowMethodsWithArguments`.
5+
36
### Example:
47
# bad
58
something.map { |s| s.upcase }
69
something.map { _1.upcase }
710

811
# good
9-
something.map(&:upcase)
12+
something.map(&:upcase)
13+
14+
### Example: AllowMethodsWithArguments: false (default)
15+
# bad
16+
something.do_something(foo) { |o| o.bar }
17+
18+
# good
19+
something.do_something(foo, &:bar)
20+
21+
### Example: AllowMethodsWithArguments: true
22+
# good
23+
something.do_something(foo) { |o| o.bar }
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
This cop checks for the use of logical operators in an `unless` condition.
2+
It discourages such code, as the condition becomes more difficult
3+
to read and understand.
4+
5+
This cop supports two styles:
6+
- `forbid_mixed_logical_operators` (default)
7+
- `forbid_logical_operators`
8+
9+
`forbid_mixed_logical_operators` style forbids the use of more than one type
10+
of logical operators. This makes the `unless` condition easier to read
11+
because either all conditions need to be met or any condition need to be met
12+
in order for the expression to be truthy or falsey.
13+
14+
`forbid_logical_operators` style forbids any use of logical operator.
15+
This makes it even more easy to read the `unless` condition as
16+
there is only one condition in the expression.
17+
18+
### Example: EnforcedStyle: forbid_mixed_logical_operators (default)
19+
# bad
20+
return unless a || b && c
21+
return unless a && b || c
22+
return unless a && b and c
23+
return unless a || b or c
24+
return unless a && b or c
25+
return unless a || b and c
26+
27+
# good
28+
return unless a && b && c
29+
return unless a || b || c
30+
return unless a and b and c
31+
return unless a or b or c
32+
return unless a?
33+
34+
### Example: EnforcedStyle: forbid_logical_operators
35+
# bad
36+
return unless a || b
37+
return unless a && b
38+
return unless a or b
39+
return unless a and b
40+
41+
# good
42+
return unless a
43+
return unless a?

0 commit comments

Comments
 (0)