Skip to content

Commit

Permalink
Add missing documentation change
Browse files Browse the repository at this point in the history
It looks like we forgot to run `rake update_cops_documentation` in the
pull request #10697. I don't know how CI didn't catch this.
  • Loading branch information
bquorning committed Jun 16, 2022
1 parent d19f902 commit a6f4163
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/cops.adoc
Expand Up @@ -313,6 +313,7 @@ In the following section you find all available cops:
* xref:cops_lint.adoc#linturiregexp[Lint/UriRegexp]
* xref:cops_lint.adoc#lintuselessaccessmodifier[Lint/UselessAccessModifier]
* xref:cops_lint.adoc#lintuselessassignment[Lint/UselessAssignment]
* xref:cops_lint.adoc#lintuselesselsewithoutrescue[Lint/UselessElseWithoutRescue]
* xref:cops_lint.adoc#lintuselessmethoddefinition[Lint/UselessMethodDefinition]
* xref:cops_lint.adoc#lintuselessruby2keywords[Lint/UselessRuby2Keywords]
* xref:cops_lint.adoc#lintuselesssettercall[Lint/UselessSetterCall]
Expand Down
42 changes: 42 additions & 0 deletions docs/modules/ROOT/pages/cops_lint.adoc
Expand Up @@ -6446,6 +6446,48 @@ end

* https://rubystyle.guide#underscore-unused-vars

== Lint/UselessElseWithoutRescue

|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

| Enabled
| Yes
| No
| 0.17
| <<next>>
|===

Checks for useless `else` in `begin..end` without `rescue`.

NOTE: This syntax is no longer valid on Ruby 2.6 or higher.

=== Examples

[source,ruby]
----
# bad
begin
do_something
else
do_something_else # This will never be run.
end
----

[source,ruby]
----
# good
begin
do_something
rescue
handle_errors
else
do_something_else
end
----

== Lint/UselessMethodDefinition

|===
Expand Down

0 comments on commit a6f4163

Please sign in to comment.