Skip to content
Closed
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
7 changes: 5 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require:
inherit_from: .rubocop_todo.yml

plugins:
- rubocop-rake
- rubocop-rspec

Expand Down Expand Up @@ -41,4 +43,5 @@ Style/IfUnlessModifier:
Metrics/BlockLength:
Enabled: false

inherit_from: .rubocop_todo.yml
Layout/LineLength:
Comment thread
rwaffen marked this conversation as resolved.
Enabled: false
11 changes: 2 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
20 changes: 13 additions & 7 deletions rubocop.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we please keep this enabled? It avoids situations like puppetlabs/puppetlabs-postgresql#1633 and puppetlabs/puppetlabs-postgresql#1634. It was actually the RSpec/SpecFilePathFormat that was the "too picky" part and I'm glad they separated the cops into 2.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can do, just disabled it, as the "original" it was splitted from was also disabled.

Enabled: false

# Leaving these enabled creates too much busy work
Expand Down Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions voxpupuli-test.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down