Skip to content
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

With --fail-level A ignore non-correctable offenses at :info severity #12091

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

naveg
Copy link
Contributor

@naveg naveg commented Aug 1, 2023

The current implementation of --fail-level autocorrect fails for all
offenses, no matter what. Notably, this includes non-correctable
offenses with the :info severity.

Change the implementation to only fail:

  • Any correctable offense, regardless of severity
  • Non-correctable offenses with severity :refactor (the default) or
    higher

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@naveg naveg force-pushed the naveg/fail-level-autocorrect branch from aa1b9cb to 06eb546 Compare August 1, 2023 22:18
@naveg naveg marked this pull request as ready for review August 1, 2023 22:52
@naveg naveg force-pushed the naveg/fail-level-autocorrect branch from 06eb546 to 11417cd Compare August 1, 2023 23:06
@naveg
Copy link
Contributor Author

naveg commented Aug 4, 2023

@bbatsov @koic any thoughts on this?

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 5, 2023

@naveg The proposed changes make sense, but they have to be clearly documented. I doubt many people will manage to infer this by themselves.

The current implementation of `--fail-level autocorrect` fails for all
offenses, no matter what. Notably, this includes non-correctable
offenses with the :info severity.

Change the implementation to only fail:
* Any _correctable_ offense, regardless of severity
* Non-correctable offenses with severity :refactor (the default) or
  higher
@naveg naveg force-pushed the naveg/fail-level-autocorrect branch from 11417cd to 817b3d2 Compare August 5, 2023 19:15
@naveg
Copy link
Contributor Author

naveg commented Aug 5, 2023

Thanks @bbatsov - I updated the documentation for the --fail-level argument, which discusses the autocorrect option.

@bbatsov bbatsov merged commit c078235 into rubocop:master Aug 9, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants