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 Style/ModuleFunction as unsafe autocorrect #6613

Merged
merged 1 commit into from
Feb 16, 2019

Conversation

dduugg
Copy link
Contributor

@dduugg dduugg commented Dec 28, 2018

This marks the Style/ModuleFunction cop as both Autocorrect: false and SafeAutocorrect: false in the default configuration. This is consistent with the documentation ("These offenses are not auto-corrected since there are different implications to each approach."), although I have slightly reworded it here.

The autocorrect was intentionally omitted when the cop was made configurable (see https://github.com/rubocop-hq/rubocop/pull/3173/files#diff-58bfe8eeff6579e001f02da76228d98fR26) because the styles are not equivalent. See the discussion at rubocop/ruby-style-guide#556 for more details.

I have not added tests b/c this is a configuration change, but happy to do so if you have any suggestions.

Thanks for your consideration.


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 to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • 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.

@dduugg dduugg force-pushed the unsafe-module-function branch 2 times, most recently from 26563f3 to 25cf531 Compare December 28, 2018 19:52
Copy link
Collaborator

@Drenmi Drenmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🚀

@dduugg dduugg force-pushed the unsafe-module-function branch 2 times, most recently from 5794dd9 to dabd3fb Compare January 3, 2019 06:05
@dduugg
Copy link
Contributor Author

dduugg commented Jan 3, 2019

I've resolved the merge conflicts and bumped the VersionChanged to 0.63 since 0.62 was cut yesterday.

@Drenmi
Copy link
Collaborator

Drenmi commented Jan 3, 2019

Could you also move the CHANGELOG entry up from 0.62? 🙏

@dduugg
Copy link
Contributor Author

dduugg commented Jan 3, 2019

@Drenmi done!

@dduugg
Copy link
Contributor Author

dduugg commented Feb 12, 2019

@Drenmi I've rebased this forward in hopes of getting it into the next release. Would love to clear this from my open PRs, please let me know if there's anything I can do to nudge it along. Thanks!

Copy link
Member

@koic koic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it can be merged when CHANGELOG conflict is resolved.

@dduugg
Copy link
Contributor Author

dduugg commented Feb 16, 2019

Thanks @koic, i've resolved the conflict and re-pushed.

@koic koic merged commit ee14e9b into rubocop:master Feb 16, 2019
@koic
Copy link
Member

koic commented Feb 16, 2019

Thank you @dduugg!

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

3 participants