Skip to content

Add new Style/HeredocDelimiters cop #4467

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

Merged
merged 2 commits into from
Jun 5, 2017

Conversation

Drenmi
Copy link
Collaborator

@Drenmi Drenmi commented Jun 5, 2017

This change adds a cop for enforcing meaningful heredoc delimiters. It is based on a delimiter blacklist, which by default contains END.

RuboCop had 3,207 offenses, so I separated the cop implementation and fixing of existing offenses into two different commits. 😉

⚠️ Opening the commit which fixes the offenses in GitHub might freeze your browser.


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.
  • Updated cop documentation with rake generate_cops_documentation (required only when you've added a new cop or changed the configuration/documentation of an existing cop).

Sorry, something went wrong.

@Drenmi Drenmi force-pushed the feature/heredoc-delimiters-cop branch from 5b8f763 to c6c4e4c Compare June 5, 2017 08:43
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 5, 2017

One offense in the new cop is failing the build.

@Drenmi Drenmi force-pushed the feature/heredoc-delimiters-cop branch 2 times, most recently from 99af55d to 82d4a6d Compare June 5, 2017 13:36
Drenmi added 2 commits June 5, 2017 21:50
This change adds a cop for enforcing meaningful heredoc delimiters.
It is based on a delimiter blacklist, which by default contains `END`.
@Drenmi Drenmi force-pushed the feature/heredoc-delimiters-cop branch from 82d4a6d to 781fec7 Compare June 5, 2017 13:52
@Drenmi
Copy link
Collaborator Author

Drenmi commented Jun 5, 2017

@bbatsov: Fixed! There was also a new END merged into master after the PR was opened, which caused some serious confusion as to why the build was failing. 😅

@bbatsov bbatsov merged commit 8f37b7f into rubocop:master Jun 5, 2017
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 5, 2017

Awesome work, btw!

@Drenmi Drenmi deleted the feature/heredoc-delimiters-cop branch June 30, 2017 10:44
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

2 participants