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

Mark Performance/Sum auto-correction as unsafe and extend documentation #270

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

leoarnold
Copy link
Contributor

@leoarnold leoarnold commented Nov 16, 2021

The documentaion of Performance/Sum talked about setting
SafeAutoCorrect: true for the cop, but Rubocop complained:

Warning: Performance/Sum does not support SafeAutoCorrect parameter.

Supported parameters are:

  - Enabled

so we add the SafeAutoCorrect option to the cop's defaults
and thereby mark it as (partially) unsafe.

This is NOT a change in behavior: The cop will still perform all
safe auto-corrections when using -a, and also (by default)
perform all unsafe auto-corrections when using -A.

Furthermore we extend the documentation in order to make it even more
clear in which cases auto-correction is unsafe, and why.


Before submitting the PR make sure the following are checked:

  • 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.
  • 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.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@leoarnold leoarnold changed the title Mark Performance/Sum auto-correction as unsafe and extend documenta… Mark Performance/Sum auto-correction as unsafe and extend documentation Nov 16, 2021
@leoarnold leoarnold force-pushed the leoarnold/sum-doc branch 2 times, most recently from 4331292 to 00df7fb Compare November 16, 2021 03:03
@koic
Copy link
Member

koic commented Nov 16, 2021

Can you rebase with the latest master branch to resolve conflicts?

…tion

The documentaion of `Performance/Sum` talked about setting
`SafeAutoCorrect: true` for the cop, but Rubocop complained:

```
Warning: Performance/Sum does not support SafeAutoCorrect parameter.

Supported parameters are:

  - Enabled

```

so we add the `SafeAutoCorrect` option to the cop's defaults
and thereby mark it as (partially) unsafe.

This is NOT a change in behavior: The cop will still perform all
safe auto-corrections when using `-a`, and also (by default)
perform all unsafe auto-corrections when using `-A`.

Furthermore we extend the documentation in order to make it even more
clear in _which_ cases auto-correction is unsafe, and _why_.
@leoarnold
Copy link
Contributor Author

@koic Done.

@koic
Copy link
Member

koic commented Nov 16, 2021

Thanks!

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.

2 participants