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

Let format_offense add variable-width whitespace #8113

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

eugeneius
Copy link
Contributor

Followup to #8069.

This allows expect_offense to be used when the dynamically generated part of the source code is not highlighted by the offense.

I couldn't find a spec in this repo that could be rewritten to use this option, but I have an open PR on RuboCop Rails that would benefit from it: https://github.com/rubocop-hq/rubocop-rails/pull/257/files#diff-d9cf3a5c58c7f3acbad8f9812ca8006bR70


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.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 8, 2020

I like the proposed change.

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.

This looks good to me. Can you rebase with the latest mater branch?

This allows `expect_offense` to be used when the dynamically generated
part of the source code is not highlighted by the offense.
@eugeneius
Copy link
Contributor Author

@koic done! ✅

Copy link
Contributor

@marcandre marcandre left a comment

Choose a reason for hiding this comment

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

Thanks for completing what I should have done; I thought about it only after merging and didn't get back to it 👍

@koic koic merged commit 1f461d4 into rubocop:master Jun 8, 2020
@koic
Copy link
Member

koic commented Jun 8, 2020

Thanks for adding this feature. Can you apply it to https://github.com/rubocop-hq/rubocop-rails/pull/257/files#r436398573 ?

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.

4 participants