Skip to content

update rubocop to v 1.48.1 #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'https://rubygems.org'
gem "activesupport", require: false
gem "parser"
gem "pry", require: false
gem "rubocop", "1.39.0", require: false
gem "rubocop", "1.48.1", require: false
gem "rubocop-i18n", require: false
gem "rubocop-graphql", require: false
gem "rubocop-minitest", require: false
Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ GEM
diff-lcs (1.5.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
json (2.6.2)
json (2.6.3)
method_source (1.0.0)
minitest (5.16.3)
parallel (1.22.1)
parser (3.1.2.1)
parser (3.2.1.1)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rack (3.0.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.0)
regexp_parser (2.7.0)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand All @@ -39,18 +39,18 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.39.0)
rubocop (1.48.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.23.0, < 2.0)
rubocop-ast (>= 1.26.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.27.0)
parser (>= 3.2.1.0)
rubocop-graphql (0.18.0)
rubocop (>= 0.87, < 2)
rubocop-i18n (3.0.0)
Expand All @@ -76,11 +76,11 @@ GEM
rubocop (>= 0.90.0)
rubocop-thread_safety (0.4.4)
rubocop (>= 0.53.0)
ruby-progressbar (1.11.0)
ruby-progressbar (1.13.0)
test-prof (1.0.11)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0)
unicode-display_width (2.4.2)

PLATFORMS
ruby
Expand All @@ -91,7 +91,7 @@ DEPENDENCIES
pry
rake
rspec
rubocop (= 1.39.0)
rubocop (= 1.48.1)
rubocop-graphql
rubocop-i18n
rubocop-minitest
Expand Down
63 changes: 63 additions & 0 deletions config/contents/gemspec/development_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Enforce that development dependencies for a gem are specified in
`Gemfile`, rather than in the `gemspec` using
`add_development_dependency`. Alternatively, using `EnforcedStyle:
gemspec`, enforce that all dependencies are specified in `gemspec`,
rather than in `Gemfile`.

### Example: EnforcedStyle: Gemfile (default)
# Specify runtime dependencies in your gemspec,
# but all other dependencies in your Gemfile.

# bad
# example.gemspec
s.add_development_dependency "foo"

# good
# Gemfile
gem "foo"

# good
# gems.rb
gem "foo"

# good (with AllowedGems: ["bar"])
# example.gemspec
s.add_development_dependency "bar"

### Example: EnforcedStyle: gems.rb
# Specify runtime dependencies in your gemspec,
# but all other dependencies in your Gemfile.
#
# Identical to `EnforcedStyle: Gemfile`, but with a different error message.
# Rely on Bundler/GemFilename to enforce the use of `Gemfile` vs `gems.rb`.

# bad
# example.gemspec
s.add_development_dependency "foo"

# good
# Gemfile
gem "foo"

# good
# gems.rb
gem "foo"

# good (with AllowedGems: ["bar"])
# example.gemspec
s.add_development_dependency "bar"

### Example: EnforcedStyle: gemspec
# Specify all dependencies in your gemspec.

# bad
# Gemfile
gem "foo"

# good
# example.gemspec
s.add_development_dependency "foo"

# good (with AllowedGems: ["bar"])
# Gemfile
gem "bar"
2 changes: 0 additions & 2 deletions config/contents/layout/class_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,3 @@ automatically.
def some_private_method
end
end

@see https://rubystyle.guide#consistent-classes
35 changes: 34 additions & 1 deletion config/contents/layout/first_array_element_line_break.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
Checks for a line break before the first element in a
multi-line array.

### Example:
### Example: AllowMultilineFinalElement: false (default)

# bad
[ :a,
:b]

# bad
[ :a, {
:b => :c
}]

# good
[:a, :b]

# good
[
:a,
:b]

# good
[
:a, {
:b => :c
}]

### Example: AllowMultilineFinalElement: true

# bad
[ :a,
:b]

# good
[ :a, {
:b => :c
}]

# good
[
:a,
:b]

# good
[:a, :b]
43 changes: 41 additions & 2 deletions config/contents/layout/first_hash_element_line_break.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,52 @@
Checks for a line break before the first element in a
multi-line hash.

### Example:
### Example: AllowMultilineFinalElement: false (default)

# bad
{ a: 1,
b: 2}

# bad
{ a: 1, b: {
c: 3
}}

# good
{
a: 1,
b: 2 }

# good
{
a: 1, b: {
c: 3
}}

### Example: AllowMultilineFinalElement: true

# bad
{ a: 1,
b: 2}

# bad
{ a: 1,
b: {
c: 3
}}

# good
{ a: 1, b: {
c: 3
}}

# good
{
a: 1,
b: 2 }
b: 2 }

# good
{
a: 1, b: {
c: 3
}}
55 changes: 54 additions & 1 deletion config/contents/layout/first_method_argument_line_break.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,70 @@
Checks for a line break before the first argument in a
multi-line method call.

### Example:
### Example: AllowMultilineFinalElement: false (default)

# bad
method(foo, bar,
baz)

# bad
method(foo, bar, {
baz: "a",
qux: "b",
})

# good
method(
foo, bar,
baz)

# good
method(
foo, bar, {
baz: "a",
qux: "b",
})

# ignored
method foo, bar,
baz

### Example: AllowMultilineFinalElement: true

# bad
method(foo, bar,
baz)

# bad
method(foo,
bar,
{
baz: "a",
qux: "b",
}
)

# good
method(foo, bar, {
baz: "a",
qux: "b",
})

# good
method(
foo, bar,
baz)

# good
method(
foo,
bar,
{
baz: "a",
qux: "b",
}
)

# ignored
method foo, bar,
baz
47 changes: 45 additions & 2 deletions config/contents/layout/first_method_parameter_line_break.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,57 @@
Checks for a line break before the first parameter in a
multi-line method parameter definition.

### Example:
### Example: AllowMultilineFinalElement: false (default)

# bad
def method(foo, bar,
baz)
do_something
end

# bad
def method(foo, bar, baz = {
:a => "b",
})
do_something
end

# good
def method(
foo, bar,
baz)
do_something
end

# good
def method(
foo, bar, baz = {
:a => "b",
})
do_something
end

# ignored
def method foo,
bar
do_something
end

### Example: AllowMultilineFinalElement: true

# bad
def method(foo, bar,
baz)
do_something
end

# good
def method(foo, bar, baz = {
:a => "b",
})
do_something
end

# good
def method(
foo, bar,
Expand All @@ -20,4 +63,4 @@ multi-line method parameter definition.
def method foo,
bar
do_something
end
end
Loading