Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #11120] Fix an incorrect autocorrect for `Lint/RedundantRequireS…
…tatement` Fixes #11120. This PR fixes an incorrect autocorrect for `Lint/RedundantRequireStatement` when using redundant `require` with modifier form. For example, in essential it is unknown how many times `do_something` will be executed when `require 'enumerator' while do_something`. So it does not autocorrects when modifier form is used to avoid side effects.
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_an_incorrect_autocorrect_for_lint_redundant_require_statement.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#11120](https://github.com/rubocop/rubocop/issues/11120): Fix an incorrect autocorrect for `Lint/RedundantRequireStatement` when using redundant `require` with modifier form. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters