-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
158cab0
to
be2f2a8
Compare
There was a problem hiding this 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.
lib/rubocop/sketchup/generator.rb
Outdated
'rubocop', | ||
'sketchup', # We have our cops nested one extra level. | ||
'cop', | ||
snake_case(badge.department.to_s), |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
2bc21d8
to
001356b
Compare
I also updated the RuboCop config to include the latest RuboCop cops.