Skip to content

Commit

Permalink
switch to voxpupuli-rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 13, 2024
1 parent 6b4029d commit 8f88f1d
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 41 deletions.
16 changes: 4 additions & 12 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
---
inherit_from: .rubocop_todo.yml

require:
- rubocop-performance
- rubocop-rspec

AllCops:
Exclude:
- Gemfile
- Rakefile
- spec/fixtures/**/*
- vendor/bundle/**/*
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: '2.7'
inherit_gem:
voxpupuli-rubocop: rubocop.yml


# Disabled
Style/ClassAndModuleChildren:
Expand Down
209 changes: 186 additions & 23 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,93 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-04-18 09:21:48 UTC using RuboCop version 1.50.2.
# on 2024-06-13 10:03:20 UTC using RuboCop version 1.63.5.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 4
# Configuration parameters: Severity, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/DuplicatedGem:
Exclude:
- 'spec/fixtures/module/Gemfile'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'spec/fixtures/module/Gemfile'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequireMFA:
Layout/HeredocIndentation:
Exclude:
- 'puppet-modulebuilder.gemspec'
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Exclude:
- 'puppet-modulebuilder.gemspec'
- 'Rakefile'

# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 31
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingEmptyLines:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 2
Lint/MixedRegexpCaptureTypes:
Exclude:
- 'Gemfile'
- 'spec/fixtures/module/Gemfile'

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 255
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 6
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 25
# Offense count: 13
# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# Configuration parameters: MinSize.
Performance/CollectionLiteralInLoop:
Exclude:
- 'spec/acceptance/puppet/modulebuilder/builder_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Performance/StringIdentifierArgument:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 4
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
Expand Down Expand Up @@ -82,14 +128,131 @@ RSpec/NamedSubject:
RSpec/NestedGroups:
Max: 5

# Offense count: 33
# Offense count: 32
RSpec/SubjectStub:
Exclude:
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'

# Offense count: 9
# Offense count: 1
Security/Eval:
Exclude:
- 'spec/fixtures/module/Gemfile'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Security/JSONLoad:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, conditionals
Style/AndOr:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Style/FetchEnvVar:
Exclude:
- 'Gemfile'
- 'spec/fixtures/module/Gemfile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'spec/fixtures/module/Gemfile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
# SupportedShorthandSyntax: always, never, either, consistent
Style/HashSyntax:
Exclude:
- 'Gemfile'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Exclude:
- 'spec/fixtures/module/Gemfile'
- 'spec/fixtures/module/Rakefile'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantInterpolation:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpEscape:
Exclude:
- 'Gemfile'
- 'spec/fixtures/module/Gemfile'
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'Gemfile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'spec/fixtures/module/Rakefile'

# Offense count: 49
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'spec/fixtures/module/Gemfile'
- 'spec/fixtures/module/Rakefile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'lib/puppet/modulebuilder/builder.rb'
- 'spec/spec_helper.rb'
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'

# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/puppet/modulebuilder/builder.rb'
- 'spec/fixtures/module/Rakefile'
- 'spec/unit/puppet/modulebuilder/builder_spec.rb'

# Offense count: 12
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 188
Max: 255
6 changes: 0 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ group :development do
gem 'rake'
gem 'rspec', '~> 3.1'

gem 'rubocop', '~> 1.50.0', require: false
gem 'rubocop-performance', '~> 1.16', require: false
gem 'rubocop-rspec', '~> 2.19', require: false
gem 'rubocop-factory_bot', '!= 2.26.0', require: false
gem 'rubocop-rspec_rails', '!= 2.29.0', require: false

gem 'simplecov'
gem 'simplecov-console'

Expand Down
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ RSpec::Core::RakeTask.new(:acceptance) do |t|
end

task default: [:spec, :acceptance]

begin
require 'voxpupuli/rubocop/rake'
rescue LoadError
# the voxpupuli-rubocop gem is optional
end
2 changes: 2 additions & 0 deletions puppet-modulebuilder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'minitar', '~> 0.9'
spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 2.0.0'

spec.add_development_dependency 'voxpupuli-rubocop', '~> 2.7.0'

spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
end

0 comments on commit 8f88f1d

Please sign in to comment.