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 rake new_cop create parent directories #4655

Merged
merged 3 commits into from
Aug 15, 2017

Conversation

highb
Copy link
Contributor

@highb highb commented Aug 10, 2017

Prior to this commit if you attempted to make a cop in a new category,
the generator would error out because the directory didn't exist yet.

This commit adds a check for the existence of the parent directory
in the write_unless_file_exists method and will create the directory
using FileUtils.mkdir_p if it doesn't exist.


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).
    • No pre-existing issue that I could find.
  • 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.
    • Not sure if the maintainers want to deal with FakeFS tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • All tests(rake spec) are passing.
  • The new code doesn't generate RuboCop offenses that are checked by rake internal_investigation.
  • 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).

Prior to this commit if you attempted to make a cop in a new category,
the generator would error out because the directory didn't exist yet.

This commit adds a check for the existence of the parent directory
in the `write_unless_file_exists` method and will create the directory
using `FileUtils.mkdir_p` if it doesn't exist.
@highb
Copy link
Contributor Author

highb commented Aug 10, 2017

It looks like the CHANGELOG is failing specs because it doesn't contain a link. Should I open an issue for what I'm seeing and link it?

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 11, 2017

It looks like the CHANGELOG is failing specs because it doesn't contain a link. Should I open an issue for what I'm seeing and link it?

I guess your handle is missing at the bottom of the changelog file.

This commit updates the changelog.
@highb highb force-pushed the new_cop_create_category_if_no_exist branch from d6a4f33 to f3f1d49 Compare August 11, 2017 09:59
Copy link
Collaborator

@pocke pocke left a comment

Choose a reason for hiding this comment

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

👍

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