Skip to content

Commit 91ec50f

Browse files
authored
Merge pull request #50 from puppetlabs/CONT-881-ruby_3
(CONT-881) Ruby 3 / Puppet 8 Support
2 parents f28591a + 3c94303 commit 91ec50f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1153
-1607
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,48 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
1110
spec:
1211
strategy:
1312
fail-fast: false
1413
matrix:
1514
ruby_version:
16-
- '2.5'
17-
- '2.7'
18-
puppet_gem_version:
19-
- '~> 6.0'
20-
- '~> 7.0'
21-
name: "spec (ruby ${{ matrix.ruby_version }} | ${{ matrix.puppet_gem_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+
runs_on:
23+
- "ubuntu-latest"
24+
- "windows-latest"
25+
name: "spec (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
2226
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2327
secrets: "inherit"
2428
with:
2529
ruby_version: ${{ matrix.ruby_version }}
30+
puppet_gem_version: ${{ matrix.puppet_gem_version }}
31+
runs_on: ${{ matrix.runs_on }}
2632

2733
acceptance:
2834
needs: "spec"
2935
strategy:
30-
fail-fast: false
3136
matrix:
32-
os:
33-
- "ubuntu-latest"
34-
- "windows-latest"
3537
ruby_version:
36-
- "2.5"
3738
- "2.7"
38-
puppet_gem_version:
39-
- '~> 6.0'
40-
- '~> 7.0'
41-
name: "acceptance (${{ matrix.os }} ruby ${{ matrix.ruby_version }} |${{ matrix.puppet_gem_version }})"
39+
- "3.2"
40+
include:
41+
- ruby-version: '2.7'
42+
puppet_gem_version: '~> 7.0'
43+
- ruby_version: '3.2'
44+
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
45+
runs_on:
46+
- "ubuntu-latest"
47+
- "windows-latest"
48+
name: "acceptance (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
4249
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
4350
secrets: "inherit"
4451
with:
4552
ruby_version: ${{ matrix.ruby_version }}
46-
rake_task: 'acceptance'
4753
puppet_version: ${{ matrix.puppet_gem_version }}
48-
runs_on: ${{ matrix.os }}
54+
runs_on: ${{ matrix.runs_on }}

.github/workflows/nightly.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,47 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
109
spec:
1110
strategy:
1211
fail-fast: false
1312
matrix:
1413
ruby_version:
15-
- '2.5'
16-
- '2.7'
17-
puppet_gem_version:
18-
- '~> 6.0'
19-
- '~> 7.0'
20-
name: "spec (ruby ${{ matrix.ruby_version }} | ${{ matrix.puppet_gem_version }})"
14+
- "2.7"
15+
- "3.2"
16+
include:
17+
- ruby-version: '2.7'
18+
puppet_gem_version: '~> 7.0'
19+
- ruby_version: '3.2'
20+
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
21+
runs_on:
22+
- "ubuntu-latest"
23+
- "windows-latest"
24+
name: "spec (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
2125
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2226
secrets: "inherit"
2327
with:
2428
ruby_version: ${{ matrix.ruby_version }}
29+
puppet_gem_version: ${{ matrix.puppet_gem_version }}
30+
runs_on: ${{ matrix.runs_on }}
2531

2632
acceptance:
2733
needs: "spec"
2834
strategy:
29-
fail-fast: false
3035
matrix:
31-
os:
32-
- "ubuntu-latest"
33-
- "windows-latest"
3436
ruby_version:
35-
- "2.5"
3637
- "2.7"
37-
puppet_gem_version:
38-
- '~> 6.0'
39-
- '~> 7.0'
40-
name: "acceptance (${{ matrix.os }} ruby ${{ matrix.ruby_version }} |${{ matrix.puppet_gem_version }})"
38+
- "3.2"
39+
include:
40+
- ruby-version: '2.7'
41+
puppet_gem_version: '~> 7.0'
42+
- ruby_version: '3.2'
43+
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
44+
runs_on:
45+
- "ubuntu-latest"
46+
- "windows-latest"
4147
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
4248
secrets: "inherit"
4349
with:
4450
ruby_version: ${{ matrix.ruby_version }}
45-
rake_task: 'acceptance'
4651
puppet_version: ${{ matrix.puppet_gem_version }}
47-
runs_on: ${{ matrix.os }}
52+
runs_on: ${{ matrix.runs_on }}

.rubocop.yml

Lines changed: 12 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,19 @@
1-
require: rubocop-rspec
1+
inherit_from: .rubocop_todo.yml
2+
3+
require:
4+
- rubocop-performance
5+
- rubocop-rspec
26

37
AllCops:
4-
TargetRubyVersion: 2.5
58
Exclude:
6-
# binstubs, and other utilities
7-
- bin/**/*
8-
- vendor/**/*
9-
- vendor/**/.*
10-
# package testing gems
11-
- package-testing/vendor/**/*
12-
- package-testing/vendor/**/.*
13-
# Any thing in test fixtures
9+
- Gemfile
10+
- Rakefile
1411
- spec/fixtures/**/*
12+
- vendor/bundle/**/*
13+
NewCops: enable
14+
SuggestExtensions: false
15+
TargetRubyVersion: '2.7'
1516

16-
# Metrics, excludes complexity and sizing metrics for now, as ruby's defaults are very strict
17-
Metrics/AbcSize:
18-
Enabled: False
19-
20-
Metrics/BlockLength:
21-
Description: rspec uses long describe blocks, so allow long blocks under spec/
22-
Enabled: False
23-
Exclude:
24-
- 'spec/**/*.rb'
25-
26-
Metrics/ClassLength:
27-
Enabled: False
28-
29-
Metrics/CyclomaticComplexity:
30-
Enabled: False
31-
32-
Layout/LineLength:
33-
Description: People have wide screens, use them.
34-
Max: 200
35-
36-
Metrics/MethodLength:
37-
Enabled: False
38-
39-
Metrics/ModuleLength:
40-
Enabled: False
41-
42-
Metrics/ParameterLists:
43-
Enabled: False
44-
45-
Metrics/PerceivedComplexity:
46-
Enabled: False
47-
48-
# RSpec cops
49-
RSpec/BeforeAfterAll:
50-
Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing.
51-
Exclude:
52-
- 'spec/acceptance/**/*.rb'
53-
- 'package-testing/spec/package/**/*.rb'
54-
55-
RSpec/DescribeClass:
56-
Description: This cop does not account for rspec-puppet, and beaker-rspec usage.
57-
Enabled: False
58-
59-
RSpec/HookArgument:
60-
Description: Prefer explicit :each argument, matching existing module's style
61-
EnforcedStyle: each
62-
63-
RSpec/NestedGroups:
64-
Description: Nested groups can lead to cleaner tests with less duplication
65-
Max: 10
66-
67-
RSpec/ExampleLength:
68-
Description: Forcing short examples leads to the creation of one-time use let() helpers
69-
Enabled: False
70-
71-
RSpec/MessageSpies:
72-
EnforcedStyle: receive
73-
74-
RSpec/ScatteredSetup:
75-
Enabled: False
76-
77-
# This is fine
78-
RSpec/ImplicitSubject:
79-
Enabled: false
80-
81-
# Set a reasonble max level
82-
RSpec/MultipleExpectations:
83-
Max: 10
84-
85-
# Nested contexts don't comply
86-
RSpec/ContextWording:
87-
Enabled: false
88-
89-
# This is allowed
90-
RSpec/SubjectStub:
91-
Enabled: false
92-
93-
# Doesn't help readability
94-
RSpec/PredicateMatcher:
95-
Enabled: false
96-
97-
# Style Cops
98-
Style/AsciiComments:
99-
Description: Names, non-english speaking communities.
100-
Enabled: False
101-
102-
Style/BlockDelimiters:
103-
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then.
104-
EnforcedStyle: braces_for_chaining
105-
17+
# Disabled
10618
Style/ClassAndModuleChildren:
107-
Description: Compact style reduces the required amount of indentation.
108-
EnforcedStyle: compact
109-
110-
Style/EmptyElse:
111-
Description: Enforce against empty else clauses, but allow `nil` for clarity.
112-
EnforcedStyle: empty
113-
114-
Style/FormatString:
115-
Description: Following the main puppet project's style, prefer the % format format.
116-
EnforcedStyle: percent
117-
118-
Style/FormatStringToken:
119-
Description: Following the main puppet project's style, prefer the simpler template tokens over annotated ones.
120-
EnforcedStyle: template
121-
122-
Style/IfUnlessModifier:
123-
Description: Post-fix `if` modifiers are hard to parse for newcomers. We don't want to encourage them. Post-fix `unless` modifiers could be nice in some cases, but the Cop doesn't differentiate.
124-
Enabled: false
125-
126-
Style/Lambda:
127-
Description: Prefer the keyword for easier discoverability.
128-
EnforcedStyle: literal
129-
130-
Style/MethodCalledOnDoEndBlock:
131-
Enabled: true
132-
133-
Style/RegexpLiteral:
134-
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
135-
EnforcedStyle: percent_r
136-
137-
Style/SymbolProc:
138-
Description: SymbolProc notation is not discoverable
13919
Enabled: false
140-
141-
Style/TernaryParentheses:
142-
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses on complex expressions for better readability, but seriously consider breaking it up.
143-
EnforcedStyle: require_parentheses_when_complex
144-
145-
Style/TrailingCommaInArguments:
146-
Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer.
147-
EnforcedStyleForMultiline: comma
148-
149-
Style/TrailingCommaInArrayLiteral:
150-
Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
151-
EnforcedStyleForMultiline: comma
152-
153-
Style/TrailingCommaInHashLiteral:
154-
Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
155-
EnforcedStyleForMultiline: comma
156-
157-
Style/SymbolArray:
158-
Description: Using percent style obscures symbolic intent of array's contents.
159-
Enabled: true
160-
EnforcedStyle: brackets
161-
162-
Style/HashEachMethods:
163-
Enabled: true
164-
165-
Style/HashTransformKeys:
166-
Enabled: true
167-
168-
Style/HashTransformValues:
169-
Enabled: true
170-
171-
# Enforce LF line endings, even when on Windows
172-
Layout/EndOfLine:
173-
EnforcedStyle: lf
174-
175-
# new as of rubocop 0.81
176-
Lint/RaiseException:
177-
Enabled: true
178-
179-
Lint/StructNewOverride:
180-
Enabled: true
181-
182-
RSpec/MultipleMemoizedHelpers:
183-
Max: 14

0 commit comments

Comments
 (0)