forked from glennsarti/puppetfile-resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from puppetlabs/bug-fix_ruby3_incompatibility
(bug) - Fix ruby 3.x incompatibility
- Loading branch information
Showing
7 changed files
with
152 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
name: CI for Puppetfile Resolver | ||
name: "ci" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- "main" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: CI Tasks | ||
spec: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby: [2.7] | ||
check: [rspec] | ||
os: [ubuntu-latest, windows-latest] | ||
ruby_version: | ||
- '2.7' | ||
- '3.2' | ||
include: | ||
# Run linting | ||
- ruby: 2.7 | ||
os: ubuntu-latest | ||
check: rubocop | ||
# Test on the oldest ruby we support | ||
- ruby: 2.5 | ||
os: ubuntu-latest | ||
check: rspec | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
- name: Output Ruby Information | ||
run: | | ||
echo "Ruby version" | ||
ruby --version | ||
echo "gem version" | ||
gem --version | ||
echo "bundler version" | ||
bundle -v | ||
- run: bundle exec ${{ matrix.check }} | ||
- ruby_version: '2.7' | ||
puppet_version: '~> 7.0' | ||
- ruby_version: '3.2' | ||
puppet_version: '~> 8.0' | ||
runs-on: | ||
- ubuntu-latest | ||
- windows-latest | ||
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }} - ${{ matrix.runs-on }})" | ||
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" | ||
secrets: "inherit" | ||
with: | ||
ruby_version: ${{ matrix.ruby_version }} | ||
puppet_gem_version: ${{ matrix.puppet_version }} | ||
runs_on: ${{ matrix.runs-on }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "nightly" | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
spec: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby_version: | ||
- '2.7' | ||
- '3.2' | ||
include: | ||
- ruby_version: '2.7' | ||
puppet_version: '~> 7.0' | ||
- ruby_version: '3.2' | ||
puppet_version: '~> 8.0' | ||
runs-on: | ||
- ubuntu-latest | ||
- windows-latest | ||
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }} - ${{ matrix.runs-on }})" | ||
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" | ||
secrets: "inherit" | ||
with: | ||
ruby_version: ${{ matrix.ruby_version }} | ||
puppet_gem_version: ${{ matrix.puppet_version }} | ||
runs_on: ${{ matrix.runs-on }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,82 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2019-11-04 20:38:19 +0800 using RuboCop version 0.76.0. | ||
# 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: 2 | ||
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms. | ||
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS | ||
Naming/FileName: | ||
Exclude: | ||
- 'lib/puppetfile-resolver.rb' | ||
- 'puppetfile-cli.rb' | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2023-10-27 07:36:27 UTC using RuboCop version 1.48.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 | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
Lint/DuplicateRequire: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/spec_searchers/git/gclone.rb' | ||
|
||
# Offense count: 1 | ||
Lint/MissingSuper: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/puppetfile/parser/errors.rb' | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. | ||
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src | ||
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS | ||
Naming/FileName: | ||
Exclude: | ||
- 'lib/puppetfile-resolver.rb' | ||
- 'puppetfile-cli.rb' | ||
|
||
# Offense count: 27 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: EnforcedStyle. | ||
# SupportedStyles: separated, grouped | ||
Style/AccessorGrouping: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/models/module_dependency.rb' | ||
- 'lib/puppetfile-resolver/models/module_specification.rb' | ||
- 'lib/puppetfile-resolver/puppetfile/document.rb' | ||
- 'lib/puppetfile-resolver/puppetfile/git_module.rb' | ||
- 'lib/puppetfile-resolver/puppetfile/validation_errors.rb' | ||
- 'lib/puppetfile-resolver/resolver.rb' | ||
- 'lib/puppetfile-resolver/spec_searchers/configuration.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowedMethods, AllowedPatterns. | ||
# AllowedMethods: ==, equal?, eql? | ||
Style/ClassEqualityComparison: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/util.rb' | ||
|
||
# Offense count: 1 | ||
Style/CombinableLoops: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/puppetfile/document.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods. | ||
# AllowedMethods: respond_to_missing? | ||
Style/OptionalBooleanParameter: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/cache/base.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/RedundantAssignment: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval/module/local.rb' | ||
|
||
# Offense count: 3 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Style/RedundantRegexpEscape: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/puppetfile/parser/r10k_eval.rb' | ||
|
||
# Offense count: 7 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: Mode. | ||
Style/StringConcatenation: | ||
Exclude: | ||
- 'lib/puppetfile-resolver/cache/persistent.rb' | ||
- 'lib/puppetfile-resolver/spec_searchers/git/github.rb' | ||
- 'lib/puppetfile-resolver/spec_searchers/git/gitlab.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,22 @@ | ||
source ENV['GEM_SOURCE'] || 'https://rubygems.org' | ||
source 'https://rubygems.org' | ||
|
||
# Specify your gem's dependencies in pdk.gemspec | ||
gemspec | ||
|
||
group :development do | ||
gem 'rspec', '>= 3.2', :require => false | ||
gem 'pry' | ||
if RUBY_VERSION =~ /^2\.1\./ | ||
gem "rubocop", "<= 0.57.2", :require => false, :platforms => [:ruby, :x64_mingw] | ||
gem 'rake', '~> 12.3', :require => false | ||
else | ||
gem "rubocop", "~> 0.80", :require => false, :platforms => [:ruby, :x64_mingw] | ||
gem 'rake', '>= 10.4', :require => false | ||
end | ||
group :test do | ||
gem 'rake' | ||
gem 'rspec', '~> 3.1' | ||
gem 'rspec-collection_matchers', '~> 1.0' | ||
gem 'rspec-its', '~> 1.0' | ||
|
||
gem "yard", :require => false | ||
gem 'redcarpet', :require => false | ||
gem 'github-markup', :require => false | ||
end | ||
gem 'rubocop', '~> 1.48.1' | ||
gem 'rubocop-rspec', '~> 2.19' | ||
gem 'rubocop-performance', '~> 1.16' | ||
|
||
# Evaluate Gemfile.local and ~/.gemfile if they exist | ||
extra_gemfiles = [ | ||
"#{__FILE__}.local", | ||
File.join(Dir.home, '.gemfile'), | ||
] | ||
gem 'codecov' | ||
gem 'simplecov' | ||
end | ||
|
||
extra_gemfiles.each do |gemfile| | ||
if File.file?(gemfile) && File.readable?(gemfile) | ||
eval(File.read(gemfile), binding) | ||
end | ||
group :development do | ||
gem 'pry' | ||
gem 'yard' | ||
end | ||
# vim: syntax=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters