-
Notifications
You must be signed in to change notification settings - Fork 23
Upgrading to cookstyle #316
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
Conversation
- Updated Gemfile to remove chefstyle gem - Updated .rubocop.yml to require cookstyle instead of chefstyle - Updated Rakefile to use cookstyle with --chefstyle flag for backwards compatibility - Fixed cookstyle offenses (indentation, alignment, heredoc formatting) - Reduced from 124 files to 18 files by using --chefstyle flag Signed-off-by: nikhil2611 <ngupta@progress.com>
ee63389 to
c7cbb9d
Compare
Signed-off-by: nikhil2611 <ngupta@progress.com>
Signed-off-by: nikhil2611 <ngupta@progress.com>
Simplecov Report
|
Rakefile
Outdated
| @@ -45,13 +43,12 @@ namespace :style do | |||
| }) | |||
|
|
|||
| desc "Run Chef Ruby style checks" | |||
| RuboCop::RakeTask.new(:chefstyle) do |t| | |||
| t.requires = ["chefstyle"] | |||
| t.patterns = `rubocop --list-target-files`.split("\n").reject { |f| f =~ ignore_dirs } | |||
| t.options = ["--display-cop-names"] | |||
| task :chefstyle do | |||
| require "rubocop" | |||
| patterns = `rubocop --list-target-files`.split("\n").reject { |f| f =~ ignore_dirs } | |||
| sh "cookstyle --chefstyle --display-cop-names #{patterns.join(" ")}" | |||
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.
instead of needing all this complexity with the ignore_dirs move it to .rubocop.yml file exclude section.
AllCops:
Include:
- "**/*.rb"
Exclude:
- "lib/chef-cli/skeletons/code_generator"
- "spec/unit/fixtures/chef-runner-cookbooks"
- " spec/unit/fixtures/cookbook_cache"
- " spec/unit/fixtures/example_cookbook"
- " spec/unit/fixtures/example_cookbook_metadata_json_only"
- " spec/unit/fixtures/example_cookbook_no_metadata"
- " spec/unit/fixtures/local_path_cookbooks"
- Moved all ignore patterns from Rakefile to .rubocop.yml Exclude section - Simplified chefstyle task to use direct cookstyle command with --chefstyle flag - Removed ignore_dirs complexity as suggested by @Stromweld - Both style:cookstyle and style:chefstyle tasks working correctly Signed-off-by: nikhil2611 <ngupta@progress.com>
This auto-generated file should not be tracked (already in .gitignore). The stale 78.39% value was causing confusion - actual coverage is 98.44%. Signed-off-by: nikhil2611 <ngupta@progress.com>
|
|
Closing this PR as we have added the changes in separate PR - #318 |



Description
Moving away from chefstyle to cookstyle
Related Issue
Types of changes
Checklist:
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above.