Skip to content

Commit 8dcb767

Browse files
authored
Merge pull request #393 from puppetlabs/CONT-807-ruby_3
(CONT-807) Ruby 3 / Puppet 8 Additions
2 parents 08aea34 + 2349bd6 commit 8dcb767

File tree

16 files changed

+98
-696
lines changed

16 files changed

+98
-696
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,12 @@
11
name: "ci"
22

33
on:
4-
push:
5-
branches:
6-
- "main"
74
pull_request:
85
branches:
96
- "main"
107
workflow_dispatch:
118

129
jobs:
13-
1410
spec:
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
ruby_version:
19-
- '2.7'
20-
- '3.2'
21-
include:
22-
- ruby_version: '2.7'
23-
puppet_gem_version: '~> 7.0'
24-
- ruby_version: '3.2'
25-
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8
26-
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_gem_version }})"
2711
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2812
secrets: "inherit"
29-
with:
30-
ruby_version: ${{ matrix.ruby_version }}
31-
puppet_gem_version: ${{ matrix.puppet_gem_version }}
32-
33-
acceptance:
34-
needs: "spec"
35-
strategy:
36-
fail-fast: false
37-
matrix:
38-
ruby_version:
39-
- '2.7'
40-
- '3.2'
41-
name: "acceptance (ruby ${{ matrix.ruby_version }})"
42-
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
43-
secrets: "inherit"
44-
with:
45-
ruby_version: ${{ matrix.ruby_version }}
46-
puppet_version: ${{ matrix.puppet_version }}

.github/workflows/nightly.yml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,6 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
109
spec:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
ruby_version:
15-
- '2.7'
16-
- '3.2'
17-
include:
18-
- ruby_version: '2.7'
19-
puppet_gem_version: '~> 7.0'
20-
- ruby_version: '3.2'
21-
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8
22-
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_gem_version }})"
2310
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2411
secrets: "inherit"
25-
with:
26-
ruby_version: ${{ matrix.ruby_version }}
27-
puppet_gem_version: ${{ matrix.puppet_gem_version }}
28-
29-
acceptance:
30-
needs: "spec"
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
ruby_version:
35-
- '2.7'
36-
- '3.2'
37-
name: "acceptance (ruby ${{ matrix.ruby_version }})"
38-
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
39-
secrets: "inherit"
40-
with:
41-
ruby_version: ${{ matrix.ruby_version }}
42-
puppet_gem_version: ${{ matrix.puppet_gem_version }}

.github/workflows/release_prep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "release prep"
1+
name: "Release Prep"
22

33
on:
44
workflow_dispatch:

.rubocop.yml

Lines changed: 12 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,19 @@
1-
---
21
inherit_from: .rubocop_todo.yml
32

43
require:
5-
- rubocop-performance
6-
- rubocop-rspec
4+
- rubocop-performance
5+
- rubocop-rspec
76

87
AllCops:
9-
DisplayCopNames: true
10-
SuggestExtensions: false
8+
Exclude:
9+
- Gemfile
10+
- Rakefile
11+
- spec/fixtures/**/*
12+
- vendor/bundle/**/*
1113
NewCops: enable
14+
SuggestExtensions: false
1215
TargetRubyVersion: '2.7'
13-
Include:
14-
- "**/*.rb"
15-
Exclude:
16-
- bin/*
17-
- ".vendor/**/*"
18-
- "**/Gemfile"
19-
- "**/Rakefile"
20-
- pkg/**/*
21-
- spec/fixtures/**/*
22-
- vendor/**/*
23-
- "**/Puppetfile"
24-
- "**/Vagrantfile"
25-
- "**/Guardfile"
26-
- '**/*.erb'
27-
- 'lib/puppet-strings/yard/templates/**/*'
28-
Layout/LineLength:
29-
Description: People have wide screens, use them.
30-
Max: 200
31-
RSpec/BeforeAfterAll:
32-
Description: Beware of using after(:all) as it may cause state to leak between tests.
33-
A necessary evil in acceptance testing.
34-
Exclude:
35-
- spec/acceptance/**/*.rb
36-
RSpec/HookArgument:
37-
Description: Prefer explicit :each argument, matching existing module's style
38-
EnforcedStyle: each
39-
Style/BlockDelimiters:
40-
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
41-
be consistent then.
42-
EnforcedStyle: braces_for_chaining
43-
Style/EmptyElse:
44-
Description: Enforce against empty else clauses, but allow `nil` for clarity.
45-
EnforcedStyle: empty
46-
Style/FormatString:
47-
Description: Following the main puppet project's style, prefer the % format format.
48-
EnforcedStyle: percent
49-
Style/FormatStringToken:
50-
Description: Following the main puppet project's style, prefer the simpler template
51-
tokens over annotated ones.
52-
EnforcedStyle: template
53-
Style/Lambda:
54-
Description: Prefer the keyword for easier discoverability.
55-
EnforcedStyle: literal
56-
Style/RegexpLiteral:
57-
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
58-
EnforcedStyle: percent_r
59-
Style/TernaryParentheses:
60-
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
61-
on complex expressions for better readability, but seriously consider breaking
62-
it up.
63-
EnforcedStyle: require_parentheses_when_complex
64-
Style/TrailingCommaInArguments:
65-
Description: Prefer always trailing comma on multiline argument lists. This makes
66-
diffs, and re-ordering nicer.
67-
EnforcedStyleForMultiline: comma
68-
Style/TrailingCommaInArrayLiteral:
69-
Description: Prefer always trailing comma on multiline literals. This makes diffs,
70-
and re-ordering nicer.
71-
EnforcedStyleForMultiline: comma
72-
Style/SymbolArray:
73-
Description: Using percent style obscures symbolic intent of array's contents.
74-
EnforcedStyle: brackets
75-
RSpec/MessageSpies:
76-
EnforcedStyle: receive
77-
Style/Documentation:
78-
Exclude:
79-
- spec/**/*
80-
Style/WordArray:
81-
EnforcedStyle: brackets
16+
17+
# Disabled
18+
Style/ClassAndModuleChildren:
19+
Enabled: false

.rubocop_todo.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2023-04-13 15:49:55 UTC using RuboCop version 1.48.1.
3+
# on 2023-04-19 09:06:42 UTC using RuboCop version 1.48.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9+
# Offense count: 1
10+
# This cop supports safe autocorrection (--autocorrect).
11+
# Configuration parameters: Severity, Include.
12+
# Include: **/*.gemspec
13+
Gemspec/RequireMFA:
14+
Exclude:
15+
- 'puppetlabs_spec_helper.gemspec'
16+
917
# Offense count: 5
1018
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
1119
Metrics/AbcSize:
@@ -59,6 +67,12 @@ RSpec/DescribeClass:
5967
RSpec/ExampleLength:
6068
Max: 13
6169

70+
# Offense count: 5
71+
# Configuration parameters: .
72+
# SupportedStyles: have_received, receive
73+
RSpec/MessageSpies:
74+
EnforcedStyle: receive
75+
6276
# Offense count: 5
6377
RSpec/MultipleExpectations:
6478
Max: 3
@@ -84,6 +98,13 @@ Style/CombinableLoops:
8498
Exclude:
8599
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
86100

101+
# Offense count: 7
102+
# This cop supports safe autocorrection (--autocorrect).
103+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
104+
# SupportedStyles: annotated, template, unannotated
105+
Style/FormatStringToken:
106+
EnforcedStyle: unannotated
107+
87108
# Offense count: 4
88109
# Configuration parameters: AllowedVariables.
89110
Style/GlobalVars:
@@ -94,3 +115,19 @@ Style/GlobalVars:
94115
Style/MixinUsage:
95116
Exclude:
96117
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
118+
119+
# Offense count: 9
120+
# This cop supports safe autocorrection (--autocorrect).
121+
# Configuration parameters: EnforcedStyleForMultiline.
122+
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
123+
Style/TrailingCommaInArguments:
124+
Exclude:
125+
- 'lib/puppetlabs_spec_helper/tasks/fixtures.rb'
126+
- 'spec/unit/puppetlabs_spec_helper/tasks/fixture_helpers_spec.rb'
127+
128+
# Offense count: 17
129+
# This cop supports safe autocorrection (--autocorrect).
130+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
131+
# URISchemes: http, https
132+
Layout/LineLength:
133+
Max: 195

Gemfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,3 @@ group :development do
3838
gem 'fakefs'
3939
gem 'yard'
4040
end
41-
42-
# Evaluate Gemfile.local if it exists
43-
if File.exist? "#{__FILE__}.local"
44-
eval(File.read("#{__FILE__}.local"), binding)
45-
end
46-
47-
# Evaluate ~/.gemfile if it exists
48-
if File.exist?(File.join(Dir.home, '.gemfile'))
49-
eval(File.read(File.join(Dir.home, '.gemfile')), binding)
50-
end

0 commit comments

Comments
 (0)