Skip to content

Commit

Permalink
Update rubocop to 1.34.1 (#329)
Browse files Browse the repository at this point in the history
- General bundle update.
- Update the docs too.
  • Loading branch information
BrianHawley authored Aug 15, 2022
1 parent 7091222 commit b4bce16
Showing 5 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
gem "activesupport", require: false
gem "parser"
gem "pry", require: false
gem "rubocop", "1.33.0", require: false
gem "rubocop", "1.34.1", require: false
gem "rubocop-i18n", require: false
gem "rubocop-graphql", require: false
gem "rubocop-minitest", require: false
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ GEM
method_source (1.0.0)
minitest (5.16.2)
parallel (1.22.1)
parser (3.1.2.0)
parser (3.1.2.1)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
@@ -39,14 +39,14 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.33.0)
rubocop (1.34.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.19.1, < 2.0)
rubocop-ast (>= 1.20.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
@@ -91,7 +91,7 @@ DEPENDENCIES
pry
rake
rspec
rubocop (= 1.33.0)
rubocop (= 1.34.1)
rubocop-graphql
rubocop-i18n
rubocop-minitest
6 changes: 6 additions & 0 deletions config/contents/lint/empty_conditional_body.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@ Checks for the presence of `if`, `elsif` and `unless` branches without a body.

NOTE: empty `else` branches are handled by `Style/EmptyElse`.

### Safety:

Autocorrection for this cop is not safe. The conditions for empty branches that
the autocorrection removes may have side effects, or the logic in subsequent
branches may change due to the removal of a previous condition.

### Example:
# bad
if condition
15 changes: 15 additions & 0 deletions config/contents/lint/shadowed_exception.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,14 @@ Checks for a rescued exception that get shadowed by a
less specific exception being rescued before a more specific
exception is rescued.

An exception is considered shadowed if it is rescued after its
ancestor is, or if it and its ancestor are both rescued in the
same `rescue` statement. In both cases, the more specific rescue is
unnecessary because it is covered by rescuing the less specific
exception. (ie. `rescue Exception, StandardError` has the same behavior
whether `StandardError` is included or not, because all `StandardError`s
are rescued by `rescue Exception`).

### Example:

# bad
@@ -14,6 +22,13 @@ exception is rescued.
handle_standard_error
end

# bad
begin
something
rescue Exception, StandardError
handle_error
end

# good

begin
10 changes: 9 additions & 1 deletion config/contents/style/numeric_literals.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Checks for big numeric literals without _ between groups
Checks for big numeric literals without `_` between groups
of digits in them.

Additional allowed patterns can be added by adding regexps to
the `AllowedPatterns` configuration. All regexps are treated
as anchored even if the patterns do not contain anchors (so
`\d{4}_\d{4}` will allow `1234_5678` but not `1234_5678_9012`).

NOTE: Even if `AllowedPatterns` are given, autocorrection will
only correct to the standard pattern of an `_` every 3 digits.

### Example:

# bad

0 comments on commit b4bce16

Please sign in to comment.