Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Commit

Permalink
Chefstyle fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Jan 25, 2017
1 parent 79a321d commit 7e945a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ end

group :development do
gem "chef", "~> 12.1"
gem "ronn", "~> 0.7"
gem "chefstyle", "~> 0.4"
gem "ronn", "~> 0.7"
end

group :changelog do
Expand Down
6 changes: 2 additions & 4 deletions features/step_definitions/cookbook_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,10 @@
#{conds.first} node['foo'] == 'bar'
service "apache" do
action :enable
#{
case condition_attribute
#{case condition_attribute
when /(only_if|not_if) block/ then "#{$1} #{blk}"
when /(only_if|not_if) string/ then "#{$1} #{str}"
end
}
end}
end
#{%q{service "httpd" do
action :enable
Expand Down
14 changes: 7 additions & 7 deletions lib/foodcritic/command_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ def initialize(args)
@args = args
@original_args = args.dup
@options = {
fail_tags: ['any'],
fail_tags: ["any"],
tags: [],
include_rules: [],
cookbook_paths: [],
role_paths: [],
environment_paths: [],
exclude_paths: ['test/**/*', 'spec/**/*', 'features/**/*'],
progress: true
exclude_paths: ["test/**/*", "spec/**/*", "features/**/*"],
progress: true,
}
@parser = OptionParser.new do |opts|
opts.banner = "foodcritic [cookbook_paths]"
Expand All @@ -28,9 +28,9 @@ def initialize(args)
"List all enabled rules and their descriptions.") do |t|
@options[:list] = t
end
opts.on('-f', '--epic-fail TAGS',
opts.on("-f", "--epic-fail TAGS",
"Fail the build based on tags. Default of 'any' to fail "\
'on all warnings.') do |t|
"on all warnings.") do |t|
@options[:fail_tags] << t
end
opts.on("-c", "--chef-version VERSION",
Expand Down Expand Up @@ -60,8 +60,8 @@ def initialize(args)
"foodcritic/rules/**/*.rb") do |g|
@options[:search_gems] = true
end
opts.on('-P', '--[no-]progress',
'Show progress of files being checked. default: true') do |q|
opts.on("-P", "--[no-]progress",
"Show progress of files being checked. default: true") do |q|
@options[:progress] = q
end
opts.on("-R", "--role-path PATH",
Expand Down
2 changes: 1 addition & 1 deletion lib/foodcritic/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize(rules = [])
end

def to_s
@rules.sort { |a, b| a.code <=> b.code }.
@rules.sort_by(&:code).
map { |r| r.to_s }.join("\n")
end

Expand Down

0 comments on commit 7e945a9

Please sign in to comment.