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

Make Style/ModuleFunction configurable with different styles #3173

Merged
merged 1 commit into from
May 28, 2016
Merged

Make Style/ModuleFunction configurable with different styles #3173

merged 1 commit into from
May 28, 2016

Conversation

tjwp
Copy link
Contributor

@tjwp tjwp commented May 27, 2016

The two supported styles are: module_function and extend_self.

Offenses are not auto-corrected since the two styles have
slightly different semantics.

The default style still recommends module_function instead
of extend self.

Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Used the same coding conventions as the rest of the project.
  • 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.
  • All tests are passing.
  • The new code doesn't generate RuboCop offenses.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

' module_function',
' def test; end',
'end'])
expect(cop.messages).to eq([described_class::EXTEND_SELF_MSG])
Copy link
Collaborator

Choose a reason for hiding this comment

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

You checked the highlights for the other config, but not here.

@bbatsov
Copy link
Collaborator

bbatsov commented May 28, 2016

Apart from my small remark - you should squash your commits together.

The two supported styles are: module_function and extend_self.

Offenses are not auto-corrected since the two styles have
slightly different semantics.

The default style still recommends `module_function` instead
of `extend self`.
@tjwp
Copy link
Contributor Author

tjwp commented May 28, 2016

Added highlight check and squashed. Thanks!

@bbatsov bbatsov merged commit 5a63260 into rubocop:master May 28, 2016
@bbatsov
Copy link
Collaborator

bbatsov commented May 28, 2016

👍

Neodelf pushed a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016
…#3173)

The two supported styles are: module_function and extend_self.

Offenses are not auto-corrected since the two styles have
slightly different semantics.

The default style still recommends `module_function` instead
of `extend self`.
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