Skip to content
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

Switch to voxpupuli-rubocop #458

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
---
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
159 changes: 113 additions & 46 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,37 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-02-09 08:47:26 UTC using RuboCop version 1.50.2.
# on 2024-06-09 12:47:09 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: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequireMFA:
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can work on cleaning this up after the PR got accepted. I didn't want to invest too much time right now.

Exclude:
- 'puppetlabs_spec_helper.gemspec'

# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 60

# Offense count: 3
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 33

# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 19

# Offense count: 11
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 65
- 'Rakefile'

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 277
Lint/MixedRegexpCaptureTypes:
Exclude:
- 'Gemfile'

# Offense count: 3
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
MaxOptionalParameters: 4
Max: 7
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, consistent
Lint/SymbolConversion:
Exclude:
- 'lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb'

# Offense count: 3
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 22
# Offense count: 7
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
Expand All @@ -62,42 +44,74 @@ RSpec/DescribeClass:
- '**/spec/views/**/*'
- 'spec/acceptance/smoke_spec.rb'

# Offense count: 6
# Offense count: 12
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 13

# Offense count: 5
# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Exclude:
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

# Offense count: 7
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive

# Offense count: 5
# Offense count: 8
RSpec/MultipleExpectations:
Max: 3

# Offense count: 7
# Offense count: 14
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 5

# Offense count: 5
# Offense count: 1
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- '**/spec/routing/**/*'
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

# Offense count: 7
RSpec/StubbedMock:
Exclude:
- 'spec/unit/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals_spec.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/fixture_helpers_spec.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

# Offense count: 2
Security/Eval:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CombinableLoops:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'

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

# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
Expand All @@ -111,16 +125,69 @@ Style/GlobalVars:
Exclude:
- 'lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'

# Offense count: 9
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpEscape:
Exclude:
- 'Gemfile'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'Gemfile'
- 'spec/unit/puppetlabs_spec_helper/tasks/fixtures_spec.rb'

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

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
Style/TernaryParentheses:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
- 'spec/watchr.rb'

# Offense count: 12
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArguments:
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
- 'lib/puppetlabs_spec_helper/module_spec_helper.rb'
- 'lib/puppetlabs_spec_helper/tasks/check_symlinks.rb'
- 'spec/spec_helper.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/check_symlinks_spec.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/check_test_file_spec.rb'

# Offense count: 26
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/puppetlabs_spec_helper/rake_tasks.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/check_symlinks_spec.rb'
- 'spec/unit/puppetlabs_spec_helper/tasks/fixture_helpers_spec.rb'
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ group :development do
gem 'rake'
gem 'rspec', '~> 3.1'
gem 'rspec-its', '~> 1.0'
gem 'rubocop', '~> 1.64.0', require: false
gem 'rubocop-rspec', '~> 3.0', require: false
gem 'rubocop-performance', '~> 1.16', require: false

gem 'fakefs'
gem 'yard'
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 @@ end

require 'yard'
YARD::Rake::YardocTask.new

begin
require 'voxpupuli/rubocop/rake'
rescue LoadError
# the voxpupuli-rubocop gem is optional
end
2 changes: 2 additions & 0 deletions puppetlabs_spec_helper.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'rspec-github', '~> 2.0'
spec.add_runtime_dependency 'rspec-puppet', '~> 4.0'

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

spec.requirements << 'puppet, >= 7.0.0'
end
Loading