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 cop names more flexible in CommentConfig lines #3250

Merged
merged 1 commit into from
Jun 28, 2016
Merged

Make cop names more flexible in CommentConfig lines #3250

merged 1 commit into from
Jun 28, 2016

Conversation

tjwp
Copy link
Contributor

@tjwp tjwp commented Jun 27, 2016

#3201 introduced support for arbitrary comments after cop names.

However, the previous regexp for cop names was roughly [\w/]+. The new regexp for a cop name is
([A-Z][a-z]+/)?(?:[A-Z][a-z]+)+.

This regexp is too restrictive for some existing custom cops. All of the cops in rubocop-rspec are in a RSpec department that does not match this regexp.

This change makes the cop name regexp ([A-Z]\w+/)?(?:[A-Z]\w+) to allow better back compatibility with existing custom cops.

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).
  • 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.

@tjwp
Copy link
Contributor Author

tjwp commented Jun 28, 2016

Rebased

@bbatsov bbatsov merged commit dd8b7c1 into rubocop:master Jun 28, 2016
@tjwp
Copy link
Contributor Author

tjwp commented Jun 28, 2016

@bbatsov Is there any plan for a 0.41.2 release with this change and #3248?

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