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

Correct the output path of rake new_cop. #162

Merged
merged 2 commits into from
Mar 20, 2023
Merged

Correct the output path of rake new_cop. #162

merged 2 commits into from
Mar 20, 2023

Conversation

thomthom
Copy link
Member

I also updated the RuboCop config to include the latest RuboCop cops.

@thomthom thomthom requested a review from Eneroth3 March 20, 2023 12:24
@thomthom thomthom force-pushed the dev/cop-generator branch 2 times, most recently from 158cab0 to be2f2a8 Compare March 20, 2023 12:39
Copy link
Contributor

@Eneroth3 Eneroth3 left a comment

Choose a reason for hiding this comment

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

It looks as cops are generated in the wrong location.

'rubocop',
'sketchup', # We have our cops nested one extra level.
'cop',
snake_case(badge.department.to_s),
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this also remove "sketchup_"?

If the command is:

bundle exec rake new_cop[SketchupRequirements/CopName]

The path should be:

lib/rubocop/sketchup/cop/requirements/cop_name.rb

not:

lib/rubocop/sketchup/cop/sketchup_requirements/cop_name.rb

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed! Good catch! I'll fix!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed:

C:\Users\Thomas\SourceTree\rubocop-sketchup>bundle exec rake new_cop[SketchupRequirements/CopName]
[create] lib/rubocop/sketchup/cop/requirements/cop_name.rb
[create] spec/rubocop/cop/sketchup_requirements/cop_name_spec.rb
[modify] A configuration for the cop is added into config/default.yml.
Do 4 steps:
  1. Modify the description of SketchupRequirements/CopName in config/default.yml
  2. Implement your new cop in the generated file!
  3. Commit your new cop with a message such as
     e.g. "Add new `SketchupRequirements/CopName` cop"
  4. Run `bundle exec rake changelog:new` to generate a changelog entry
     for your new cop.

Copy link
Contributor

@Eneroth3 Eneroth3 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

You can try the command and make sure the files are generated in the right locations before merging.

@thomthom thomthom merged commit 7f65afa into main Mar 20, 2023
@Eneroth3 Eneroth3 deleted the dev/cop-generator branch March 30, 2023 12:02
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