Skip to content
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
2 changes: 1 addition & 1 deletion .copier-answers.ssf-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2.12.1
_commit: v2.12.2
_src_path: https://github.com/dafyddj/copier-ssf-ci
failure_permitted_ignored: []
failure_permitted_patterns: []
Expand Down
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ ci:
autoupdate_schedule: quarterly
skip: []
submodules: false
default_install_hook_types: [commit-msg, pre-commit]
default_stages: [pre-commit]
minimum_pre_commit_version: 2.18.0

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand All @@ -30,7 +33,7 @@ repos:
- id: commitlint
- id: commitlint-ci
- repo: https://github.com/rubocop/rubocop
rev: v1.89.0
rev: v1.92.1
hooks:
- id: rubocop
name: Check Ruby files with rubocop
Expand Down Expand Up @@ -100,12 +103,12 @@ repos:
)$
additional_dependencies: [pygments==2.16.1]
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 44.69.12
rev: 44.186.6
hooks:
- id: renovate-config-validator
name: Check Renovate config with renovate-config-validator
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.38.0
rev: 0.39.0
hooks:
- id: check-github-workflows
name: Check GitHub workflows with check-jsonschema
Expand Down
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ source ENV.fetch('PROXY_RUBYGEMSORG', 'https://rubygems.org')

# Install the `inspec` gem using `git` because versions after `4.22.22`
# suppress diff output; this version fixes this for our uses.
# rubocop:disable Layout/LineLength
# rubocop:disable-next Layout/LineLength
gem 'inspec', git: 'https://gitlab.com/saltstack-formulas/infrastructure/inspec', branch: 'ssf'
# rubocop:enable Layout/LineLength

# Install the `kitchen-docker` gem using `git` in order to avoid an upstream
# error caused by `kitchen-docker.gemspec`.
# TODO: correct the error upstream
# rubocop:disable Layout/LineLength
# rubocop:disable-next Layout/LineLength
gem 'kitchen-docker', git: 'https://github.com/dafyddj/kitchen-docker', branch: 'chore/gemspec'
# rubocop:enable Layout/LineLength

gem 'kitchen-inspec', '3.1.0'
gem 'kitchen-salt', '0.7.2'
Expand Down
15 changes: 6 additions & 9 deletions test/integration/share/libraries/system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author: Daniel Dehennin <daniel.dehennin@ac-dijon.fr>
# Copyright (C) 2020 Daniel Dehennin <daniel.dehennin@ac-dijon.fr>

# rubocop:disable Metrics/ClassLength
# rubocop:disable-next Metrics/ClassLength
class SystemResource < Inspec.resource(1)
name 'system'

Expand Down Expand Up @@ -47,7 +47,7 @@ def build_platform_name
end
end

# rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
# rubocop:disable-next Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity
def build_platform_release
case inspec.platform[:name]
when 'amazon'
Expand All @@ -60,9 +60,9 @@ def build_platform_release
when 'mac_os_x'
inspec.command('sw_vers -productVersion').stdout.to_s
when 'opensuse'
# rubocop:disable Style/NumericLiterals,Layout/LineLength
inspec.platform[:release].to_i > 20210101 ? 'tumbleweed' : inspec.platform[:release]
# rubocop:enable Style/NumericLiterals,Layout/LineLength
release = inspec.platform[:release]
# rubocop:disable-next Style/NumericLiterals
release.to_i > 20210101 ? 'tumbleweed' : release
when 'windows_8.1_pro'
'8.1'
when 'windows_server_2022_datacenter'
Expand All @@ -75,7 +75,6 @@ def build_platform_release
inspec.platform[:release]
end
end
# rubocop:enable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity

def derive_gentoo_init_system
inspec.command('systemctl').exist? ? 'sysd' : 'sysv'
Expand All @@ -94,7 +93,7 @@ def build_finger_release
end
end

# rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity
# rubocop:disable-next Metrics/MethodLength,Metrics/CyclomaticComplexity
def build_platform_codename
case build_platform_finger
when 'ubuntu-22.04'
Expand Down Expand Up @@ -133,6 +132,4 @@ def build_platform_codename
''
end
end
# rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity
end
# rubocop:enable Metrics/ClassLength
Loading