diff --git a/.rubocop.yml b/.rubocop.yml index 4fe2cd8..7d1cb37 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,7 @@ --- -require: +inherit_from: .rubocop_todo.yml + +plugins: - rubocop-rake - rubocop-rspec @@ -41,4 +43,5 @@ Style/IfUnlessModifier: Metrics/BlockLength: Enabled: false -inherit_from: .rubocop_todo.yml +Layout/LineLength: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a6ef207..b7eeed2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by -# `rubocop --auto-gen-config` -# on 2024-07-08 09:49:39 UTC using RuboCop version 1.50.2. +# `rubocop --auto-gen-config --no-auto-gen-timestamp` +# using RuboCop version 1.81.1. # 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 @@ -63,10 +63,3 @@ RSpec/MultipleExpectations: Style/MixinUsage: Exclude: - 'lib/voxpupuli/test/facts.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. -# URISchemes: http, https -Layout/LineLength: - Max: 136 diff --git a/rubocop.yml b/rubocop.yml index 56c65f9..edea3c2 100644 --- a/rubocop.yml +++ b/rubocop.yml @@ -1,12 +1,12 @@ # This is a shared config for easy consumption in other modules, without having # to sync over a large file -require: +plugins: - rubocop-rspec - rubocop-rake AllCops: - # Puppetserver 7 uses Jruby 9.3 which is compatible to C Ruby 2.6 - TargetRubyVersion: 2.6 + # OpenVox Server 8 uses JRuby 9.4 which is compatible to MRI Ruby 3.1 + TargetRubyVersion: 3.1 DisplayCopNames: true ExtraDetails: true DisplayStyleGuide: true @@ -445,10 +445,13 @@ Style/PercentLiteralDelimiters: Style/PerlBackrefs: Enabled: True -Naming/PredicateName: +Naming/PredicatePrefix: Enabled: True AllowedMethods: ['is_a?', 'is_to_s'] +Naming/PredicateMethod: + Enabled: false + Style/RedundantException: Enabled: True @@ -557,7 +560,12 @@ Style/FormatStringToken: # This is useful, but sometimes a little too picky about where unit tests files # are located. -RSpec/FilePath: + +# old cop: RSpec/FilePath +RSpec/SpecFilePathFormat: + Enabled: false + +RSpec/SpecFilePathSuffix: Enabled: false # Leaving these enabled creates too much busy work @@ -662,8 +670,6 @@ RSpec/IdenticalEqualityAssertion: # new in 2.4 Enabled: true RSpec/SubjectDeclaration: # new in 2.5 Enabled: true -RSpec/Rails/AvoidSetupHook: # new in 2.4 - Enabled: true RSpec/ImplicitSubject: Enabled: false # new configurations since rubocop 1.50.0 diff --git a/voxpupuli-test.gemspec b/voxpupuli-test.gemspec index 0cda12a..7a1041a 100644 --- a/voxpupuli-test.gemspec +++ b/voxpupuli-test.gemspec @@ -12,35 +12,35 @@ Gem::Specification.new do |s| s.files = Dir['lib/**/*.rb', 'rubocop.yml', 'LICENSE', 'README.md'] - s.required_ruby_version = '>= 2.7.0' + # This ruby version matches the agent version + s.required_ruby_version = '>= 3.2.0' - s.add_runtime_dependency 'rake', '~> 13.0', '>= 13.0.6' + s.add_dependency 'rake', '~> 13.0', '>= 13.0.6' # Testing - s.add_runtime_dependency 'facterdb', '>= 3.1', '< 5.0' - s.add_runtime_dependency 'metadata-json-lint', '>= 4.0', '< 6' - s.add_runtime_dependency 'openvox-strings', '>= 5.0', '< 7' - s.add_runtime_dependency 'parallel_tests', '>= 4.2', '< 6' - s.add_runtime_dependency 'puppet_fixtures', '>= 0.1', '< 3' - s.add_runtime_dependency 'puppet-syntax', '>= 6.0', '< 8' - s.add_runtime_dependency 'rspec-github', '>= 2.0', '< 4' - s.add_runtime_dependency 'rspec-puppet', '~> 5.0' - s.add_runtime_dependency 'rspec-puppet-facts', '>= 5.4', '< 7' + s.add_dependency 'facterdb', '>= 3.1', '< 5.0' + s.add_dependency 'metadata-json-lint', '>= 4.0', '< 6' + s.add_dependency 'openvox-strings', '>= 5.0', '< 7' + s.add_dependency 'parallel_tests', '>= 4.2', '< 6' + s.add_dependency 'puppet_fixtures', '>= 0.1', '< 3' + s.add_dependency 'puppet-syntax', '>= 6.0', '< 8' + s.add_dependency 'rspec-github', '>= 2.0', '< 4' + s.add_dependency 'rspec-puppet', '~> 5.0' + s.add_dependency 'rspec-puppet-facts', '>= 5.4', '< 7' # openvox gem depends on syslog, but doesn't list it as explicit dependency # until Ruby 3.4, syslog was part of MRI ruby core # https://github.com/OpenVoxProject/puppet/issues/90 - s.add_runtime_dependency 'syslog', '~> 0.3.0' + s.add_dependency 'syslog', '~> 0.3.0' # Rubocop - # newest versions that still support Ruby 2.6 - # jruby 9.3 in Puppetserver 7 is compatible with C Ruby 2.6 - s.add_runtime_dependency 'rubocop', '~> 1.50.0' - s.add_runtime_dependency 'rubocop-rake', '~> 0.6.0' - s.add_runtime_dependency 'rubocop-rspec', '~> 2.20.0' + # has to be compatible with MRI Ruby 3.1 due to OpenVox server using Jruby + s.add_dependency 'rubocop', '~> 1.81.1' + s.add_dependency 'rubocop-rake', '~> 0.7.1' + s.add_dependency 'rubocop-rspec', '~> 3.7.0' # Linting # meta gem to pull in all puppet-lint plugins + puppet-lint itself - s.add_runtime_dependency 'voxpupuli-puppet-lint-plugins', '>= 6.0', '< 8' + s.add_dependency 'voxpupuli-puppet-lint-plugins', '>= 6.0', '< 8' # development s.add_development_dependency 'rspec', '~> 3.12'