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

Drop Ruby 2.6 support & Implement voxpupuli-rubocop #85

Merged
merged 2 commits into from
Aug 23, 2023
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
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
inherit_from: .rubocop_todo.yml

inherit_gem:
voxpupuli-rubocop: rubocop.yml
262 changes: 262 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-08-23 12:05:42 UTC using RuboCop version 1.54.2.
# 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
# Configuration parameters: AllowedParentClasses.
Lint/MissingSuper:
Exclude:
- 'lib/ra10ke.rb'

# Offense count: 1
Lint/NoReturnInBeginEndBlocks:
Exclude:
- 'lib/ra10ke/puppetfile_parser.rb'

# Offense count: 1
# Configuration parameters: AllowComments, AllowNil.
Lint/SuppressedException:
Exclude:
- 'Rakefile'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessAssignment:
Exclude:
- 'lib/ra10ke/dependencies.rb'
- 'lib/ra10ke/solve.rb'

# Offense count: 1
Naming/AccessorMethodName:
Exclude:
- 'lib/ra10ke.rb'

# Offense count: 1
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 1
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'lib/ra10ke/solve.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/Count:
Exclude:
- 'lib/ra10ke/validate.rb'
- 'spec/ra10ke/validate_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact:
Exclude:
- 'lib/ra10ke/dependencies.rb'
- 'lib/ra10ke/puppetfile_parser.rb'

# Offense count: 4
RSpec/AnyInstance:
Exclude:
- 'spec/ra10ke/validate_spec.rb'
- 'spec/ra10ke_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/ra10ke/deprecation_spec.rb'

# Offense count: 6
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/ra10ke/dependencies_spec.rb'

# Offense count: 5
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 31

# Offense count: 10
RSpec/ExpectInHook:
Exclude:
- 'spec/ra10ke/validate_spec.rb'

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

# Offense count: 7
RSpec/MultipleExpectations:
Max: 3

# Offense count: 1
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/ra10ke/dependencies_spec.rb'

# Offense count: 12
RSpec/StubbedMock:
Exclude:
- 'spec/ra10ke/deprecation_spec.rb'
- 'spec/ra10ke/validate_spec.rb'

# Offense count: 7
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/ra10ke/deprecation_spec.rb'
- 'spec/ra10ke/validate_spec.rb'

# Offense count: 1
RSpec/VoidExpect:
Exclude:
- 'spec/ra10ke/git_repo_spec.rb'

# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/ra10ke/dependencies.rb'
- 'lib/ra10ke/deprecation.rb'
- 'lib/ra10ke/duplicates.rb'
- 'lib/ra10ke/install.rb'
- 'lib/ra10ke/solve.rb'
- 'lib/ra10ke/syntax.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
Style/CollectionCompact:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 15
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/ra10ke.rb'
- 'lib/ra10ke/dependencies.rb'
- 'lib/ra10ke/deprecation.rb'
- 'lib/ra10ke/duplicates.rb'
- 'lib/ra10ke/git_repo.rb'
- 'lib/ra10ke/install.rb'
- 'lib/ra10ke/monkey_patches.rb'
- 'lib/ra10ke/puppetfile_parser.rb'
- 'lib/ra10ke/solve.rb'
- 'lib/ra10ke/syntax.rb'
- 'lib/ra10ke/validate.rb'

# Offense count: 5
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated

# Offense count: 11
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'lib/ra10ke.rb'
- 'lib/ra10ke/dependencies.rb'
- 'lib/ra10ke/install.rb'
- 'lib/ra10ke/puppetfile_parser.rb'
- 'lib/ra10ke/solve.rb'
- 'lib/ra10ke/syntax.rb'
- 'lib/ra10ke/version.rb'
- 'ra10ke.gemspec'
- 'spec/ra10ke/puppetfile_parser_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 1
Style/MultilineBlockChain:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/ra10ke/version.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/ra10ke/validate.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantInterpolation:
Exclude:
- 'lib/ra10ke/duplicates.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantSort:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: RequireEnglish, EnforcedStyle.
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
Style/SpecialGlobalVars:
Exclude:
- 'ra10ke.gemspec'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'lib/ra10ke/solve.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method
Style/SymbolProc:
Exclude:
- 'lib/ra10ke/dependencies.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 137
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ source 'https://rubygems.org'
gemspec

group :release do
gem 'github_changelog_generator', :require => false
gem 'github_changelog_generator', require: false
end

group :coverage, optional: ENV['COVERAGE']!='yes' do
gem 'simplecov-console', :require => false
gem 'codecov', :require => false
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
gem 'codecov', require: false
gem 'simplecov-console', require: false
end
18 changes: 12 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@ require 'fileutils'
require 'rspec/core'
require 'rspec/core/rake_task'

CLEAN.include("pkg/", "tmp/")
CLOBBER.include("Gemfile.lock")
CLEAN.include('pkg/', 'tmp/')
CLOBBER.include('Gemfile.lock')

task :default => [:spec]
task default: [:spec]

RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
spec.pattern = FileList['spec/**/*_spec.rb']
end

begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
version = Ra10ke::VERSION
config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/
config.future_release = "v#{version}" if /^\d+\.\d+.\d+$/.match?(version)
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog}
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog]
config.user = 'voxpupuli'
config.project = 'ra10ke'
end
rescue LoadError
end

begin
require 'voxpupuli/rubocop/rake'
rescue LoadError
# the voxpupuli-rubocop gem is optional
end
3 changes: 2 additions & 1 deletion lib/ra10ke.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def initialize(*args)
def get_puppetfile
R10K::Puppetfile.new(@basedir, @moduledir, @puppetfile_path, @puppetfile_name, @force)
rescue ArgumentError # R10k < 2.6.0
R10K::Puppetfile.new(@basedir, @moduledir, @puppetfile_path || File.join(@basedir, @puppetfile_name || 'Puppetfile'))
R10K::Puppetfile.new(@basedir, @moduledir,
@puppetfile_path || File.join(@basedir, @puppetfile_name || 'Puppetfile'))
end
end
end
Loading
Loading