Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
78cda82
(CONT-881) Update dependencies
chelnak Apr 18, 2023
2c50f14
(CONT-881) Correct Lint/RedundantCopDisableDirective
chelnak Apr 18, 2023
9af9047
(CONT-881) Correct Lint/NonAtomicFileOperation
chelnak Apr 18, 2023
a1737ff
(CONT-881) Correct Lint/RedundantCopDisableDirective
chelnak Apr 18, 2023
5ee2e78
(CONT-881) Correct Performance/RegexpMatch
chelnak Apr 18, 2023
2134d9d
(CONT-881) Correct RSpec/BeNil
chelnak Apr 18, 2023
e5fe66d
(CONT-881) Correct RSpec/HookArgument
chelnak Apr 18, 2023
6bfcd40
(CONT-881) Correct RSpec/ImplicitSubject
chelnak Apr 18, 2023
c023d36
(CONT-881) Correct RSpec/NamedSubject
chelnak Apr 18, 2023
674e7b4
(CONT-881) Correct RSpec/NamedSubject
chelnak Apr 18, 2023
9244704
(CONT-881) Correct Layout/LineEndStringConcatenationIndentation
chelnak Apr 18, 2023
0cc6486
(CONT-881) Correct Style/FormatStringToken
chelnak Apr 18, 2023
5acbb43
(CONT-881) Correct Style/IfUnlessModifier
chelnak Apr 18, 2023
cb1431b
(CONT-881) Correct Style/RedundantStringEscape
chelnak Apr 18, 2023
f2ac6ef
(CONT-881) Correct Style/RegexpLiteral
chelnak Apr 18, 2023
7d08a46
(CONT-881) Correct Style/TrailingCommaInArrayLiteral
chelnak Apr 18, 2023
dd4d6bc
(CONT-881) Correct Style/TrailingCommaInHashLiteral
chelnak Apr 18, 2023
6234f12
(CONT-881) Correct Layout/LineLength
chelnak Apr 18, 2023
da6621d
(CONT-881) Add rubocop_todo
chelnak Apr 18, 2023
3e34dd0
(CONT-881) Correct Style/IfUnlessModifier
chelnak Apr 18, 2023
74ec822
(CONT-881) Update fixtures
chelnak Apr 18, 2023
73b603c
(CONT-881) Update acceptance job name
chelnak Apr 18, 2023
fbd7cef
(CONT-881) Update ruby requirement
chelnak Apr 18, 2023
e415693
(CONT-881) Add ffi gem for win platforms
chelnak Apr 18, 2023
3c94303
(CONT-881) Clean up legacy files/entries
chelnak Apr 18, 2023
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
2 changes: 0 additions & 2 deletions .github/CODEOWNERS

This file was deleted.

15 changes: 0 additions & 15 deletions .github/dependabot.yml

This file was deleted.

42 changes: 24 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,48 @@ on:
workflow_dispatch:

jobs:

spec:
strategy:
fail-fast: false
matrix:
ruby_version:
- '2.5'
- '2.7'
puppet_gem_version:
- '~> 6.0'
- '~> 7.0'
name: "spec (ruby ${{ matrix.ruby_version }} | ${{ matrix.puppet_gem_version }})"
- "2.7"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
runs_on:
- "ubuntu-latest"
- "windows-latest"
name: "spec (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
secrets: "inherit"
with:
ruby_version: ${{ matrix.ruby_version }}
puppet_gem_version: ${{ matrix.puppet_gem_version }}
runs_on: ${{ matrix.runs_on }}

acceptance:
needs: "spec"
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
ruby_version:
- "2.5"
- "2.7"
puppet_gem_version:
- '~> 6.0'
- '~> 7.0'
name: "acceptance (${{ matrix.os }} ruby ${{ matrix.ruby_version }} |${{ matrix.puppet_gem_version }})"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
runs_on:
- "ubuntu-latest"
- "windows-latest"
name: "acceptance (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
secrets: "inherit"
with:
ruby_version: ${{ matrix.ruby_version }}
rake_task: 'acceptance'
puppet_version: ${{ matrix.puppet_gem_version }}
runs_on: ${{ matrix.os }}
runs_on: ${{ matrix.runs_on }}
41 changes: 23 additions & 18 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,47 @@ on:
workflow_dispatch:

jobs:

spec:
strategy:
fail-fast: false
matrix:
ruby_version:
- '2.5'
- '2.7'
puppet_gem_version:
- '~> 6.0'
- '~> 7.0'
name: "spec (ruby ${{ matrix.ruby_version }} | ${{ matrix.puppet_gem_version }})"
- "2.7"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
runs_on:
- "ubuntu-latest"
- "windows-latest"
name: "spec (${{ matrix.runs_on }} ruby ${{ matrix.ruby_version }} | puppet ${{matrix.puppet_gem_version}})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
secrets: "inherit"
with:
ruby_version: ${{ matrix.ruby_version }}
puppet_gem_version: ${{ matrix.puppet_gem_version }}
runs_on: ${{ matrix.runs_on }}

acceptance:
needs: "spec"
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
- "windows-latest"
ruby_version:
- "2.5"
- "2.7"
puppet_gem_version:
- '~> 6.0'
- '~> 7.0'
name: "acceptance (${{ matrix.os }} ruby ${{ matrix.ruby_version }} |${{ matrix.puppet_gem_version }})"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
runs_on:
- "ubuntu-latest"
- "windows-latest"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main"
secrets: "inherit"
with:
ruby_version: ${{ matrix.ruby_version }}
rake_task: 'acceptance'
puppet_version: ${{ matrix.puppet_gem_version }}
runs_on: ${{ matrix.os }}
runs_on: ${{ matrix.runs_on }}
188 changes: 12 additions & 176 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,183 +1,19 @@
require: rubocop-rspec
inherit_from: .rubocop_todo.yml

require:
- rubocop-performance
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
Exclude:
# binstubs, and other utilities
- bin/**/*
- vendor/**/*
- vendor/**/.*
# package testing gems
- package-testing/vendor/**/*
- package-testing/vendor/**/.*
# Any thing in test fixtures
- Gemfile
- Rakefile
- spec/fixtures/**/*
- vendor/bundle/**/*
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: '2.7'

# Metrics, excludes complexity and sizing metrics for now, as ruby's defaults are very strict
Metrics/AbcSize:
Enabled: False

Metrics/BlockLength:
Description: rspec uses long describe blocks, so allow long blocks under spec/
Enabled: False
Exclude:
- 'spec/**/*.rb'

Metrics/ClassLength:
Enabled: False

Metrics/CyclomaticComplexity:
Enabled: False

Layout/LineLength:
Description: People have wide screens, use them.
Max: 200

Metrics/MethodLength:
Enabled: False

Metrics/ModuleLength:
Enabled: False

Metrics/ParameterLists:
Enabled: False

Metrics/PerceivedComplexity:
Enabled: False

# RSpec cops
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing.
Exclude:
- 'spec/acceptance/**/*.rb'
- 'package-testing/spec/package/**/*.rb'

RSpec/DescribeClass:
Description: This cop does not account for rspec-puppet, and beaker-rspec usage.
Enabled: False

RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each

RSpec/NestedGroups:
Description: Nested groups can lead to cleaner tests with less duplication
Max: 10

RSpec/ExampleLength:
Description: Forcing short examples leads to the creation of one-time use let() helpers
Enabled: False

RSpec/MessageSpies:
EnforcedStyle: receive

RSpec/ScatteredSetup:
Enabled: False

# This is fine
RSpec/ImplicitSubject:
Enabled: false

# Set a reasonble max level
RSpec/MultipleExpectations:
Max: 10

# Nested contexts don't comply
RSpec/ContextWording:
Enabled: false

# This is allowed
RSpec/SubjectStub:
Enabled: false

# Doesn't help readability
RSpec/PredicateMatcher:
Enabled: false

# Style Cops
Style/AsciiComments:
Description: Names, non-english speaking communities.
Enabled: False

Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then.
EnforcedStyle: braces_for_chaining

# Disabled
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact

Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty

Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent

Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template tokens over annotated ones.
EnforcedStyle: template

Style/IfUnlessModifier:
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.
Enabled: false

Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal

Style/MethodCalledOnDoEndBlock:
Enabled: true

Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r

Style/SymbolProc:
Description: SymbolProc notation is not discoverable
Enabled: false

Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses on complex expressions for better readability, but seriously consider breaking it up.
EnforcedStyle: require_parentheses_when_complex

Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma

Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
Enabled: true
EnforcedStyle: brackets

Style/HashEachMethods:
Enabled: true

Style/HashTransformKeys:
Enabled: true

Style/HashTransformValues:
Enabled: true

# Enforce LF line endings, even when on Windows
Layout/EndOfLine:
EnforcedStyle: lf

# new as of rubocop 0.81
Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

RSpec/MultipleMemoizedHelpers:
Max: 14
Loading