Skip to content

Commit

Permalink
Merge pull request #110 from chef/rubocop_1.1
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Nov 5, 2020
2 parents 5a9d289 + f657c2a commit e3f3a13
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 78 deletions.
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task :vendor do
require "rubocop"
require "yaml" unless defined?(YAML)
cfg = RuboCop::Cop::Cop.all.each_with_object({}) { |cop, acc| acc[cop.cop_name] = { "Enabled" => false } unless cop.cop_name.start_with?("Chef") }
File.open(dst.join("disable_all.yml"), "w") { |fh| fh.write cfg.to_yaml }
File.open(dst.join("disable_all.yml"), "w") { |fh| fh.write YAML.dump(cfg) }

sh %{git add #{dst}/{upstream,disable_all}.yml}
sh %{git commit -m "Vendor rubocop-#{upstream.version} upstream configuration."}
Expand Down Expand Up @@ -48,8 +48,8 @@ task :validate_config do

RuboCop::Cop::Chef.constants.each do |dep|
RuboCop::Cop::Chef.const_get(dep).constants.each do |cop|
unless config["#{dep}/#{cop}"]
puts "Error: #{dep}/#{cop} not found in config/chefstyle.yml"
unless config["Chef/#{dep}/#{cop}"]
puts "Error: Chef/#{dep}/#{cop} not found in config/chefstyle.yml"
status = 1
end
end
Expand Down
8 changes: 4 additions & 4 deletions config/chefstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -669,26 +669,26 @@ Style/ExpandPathArguments:
Lint/RedundantSafeNavigation:
Enabled: true

ChefRuby/Ruby27KeywordArgumentWarnings:
Chef/Ruby/Ruby27KeywordArgumentWarnings:
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
Enabled: true
VersionAdded: '1.3.0'

ChefRuby/UnlessDefinedRequire:
Chef/Ruby/UnlessDefinedRequire:
Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
Enabled: true
VersionAdded: '1.3.0'
Include:
- 'lib/**/*'

ChefRuby/GemspecRequireRubygems:
Chef/Ruby/GemspecRequireRubygems:
Description: Rubygems does not need to be required in a Gemspec
Enabled: true
VersionAdded: '1.3.0'
Include:
- '**/*.gemspec'

ChefRuby/RequireNetHttps:
Chef/Ruby/RequireNetHttps:
Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
Enabled: true
VersionAdded: '1.3.0'
20 changes: 20 additions & 0 deletions config/disable_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ Lint/DuplicateHashKey:
Enabled: false
Lint/DuplicateMethods:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement:
Enabled: false
Lint/DuplicateRequire:
Enabled: false
Lint/DuplicateRescueException:
Expand All @@ -245,6 +247,8 @@ Lint/EachWithObjectArgument:
Enabled: false
Lint/ElseLayout:
Enabled: false
Lint/EmptyBlock:
Enabled: false
Lint/EmptyConditionalBody:
Enabled: false
Lint/EmptyEnsure:
Expand Down Expand Up @@ -303,6 +307,8 @@ Lint/NestedPercentLiteral:
Enabled: false
Lint/NextWithoutAccumulator:
Enabled: false
Lint/NoReturnInBeginEndBlocks:
Enabled: false
Lint/NonDeterministicRequireOrder:
Enabled: false
Lint/NonLocalExitFromIterator:
Expand Down Expand Up @@ -373,6 +379,8 @@ Lint/SuppressedException:
Enabled: false
Lint/Syntax:
Enabled: false
Lint/ToEnumArguments:
Enabled: false
Lint/ToJSON:
Enabled: false
Lint/TopLevelReturnWithArgument:
Expand All @@ -383,6 +391,8 @@ Lint/UnderscorePrefixedVariableName:
Enabled: false
Lint/UnifiedInteger:
Enabled: false
Lint/UnmodifiedReduceAccumulator:
Enabled: false
Lint/UnreachableCode:
Enabled: false
Lint/UnreachableLoop:
Expand Down Expand Up @@ -467,6 +477,8 @@ Style/Alias:
Enabled: false
Style/AndOr:
Enabled: false
Style/ArgumentsForwarding:
Enabled: false
Style/ArrayCoercion:
Enabled: false
Style/ArrayJoin:
Expand Down Expand Up @@ -505,6 +517,8 @@ Style/ClassMethodsDefinitions:
Enabled: false
Style/ClassVars:
Enabled: false
Style/CollectionCompact:
Enabled: false
Style/CollectionMethods:
Enabled: false
Style/ColonMethodCall:
Expand Down Expand Up @@ -537,6 +551,8 @@ Style/DocumentationMethod:
Enabled: false
Style/Documentation:
Enabled: false
Style/DocumentDynamicEvalDefinition:
Enabled: false
Style/DoubleCopDisableDirective:
Enabled: false
Style/DoubleNegation:
Expand Down Expand Up @@ -677,6 +693,8 @@ Style/MutableConstant:
Enabled: false
Style/NegatedIf:
Enabled: false
Style/NegatedIfElseCondition:
Enabled: false
Style/NegatedUnless:
Enabled: false
Style/NegatedWhile:
Expand Down Expand Up @@ -807,6 +825,8 @@ Style/Strip:
Enabled: false
Style/StructInheritance:
Enabled: false
Style/SwapValues:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/SymbolLiteral:
Expand Down
Loading

0 comments on commit e3f3a13

Please sign in to comment.