diff --git a/.copier-answers.ssf-ci.yml b/.copier-answers.ssf-ci.yml index 30ea2d8..2828d62 100644 --- a/.copier-answers.ssf-ci.yml +++ b/.copier-answers.ssf-ci.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: v2.11.11 +_commit: v2.11.13 _src_path: https://github.com/dafyddj/copier-ssf-ci failure_permitted_ignored: [] failure_permitted_patterns: [] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a0973c..790f681 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: commitlint - id: commitlint-ci - repo: https://github.com/rubocop/rubocop - rev: v1.90.0 + rev: v1.89.0 hooks: - id: rubocop name: Check Ruby files with rubocop diff --git a/Gemfile b/Gemfile index d175101..f084722 100644 --- a/Gemfile +++ b/Gemfile @@ -8,14 +8,16 @@ 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-next Layout/LineLength +# rubocop:disable 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-next Layout/LineLength +# rubocop:disable 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' diff --git a/test/integration/share/libraries/system.rb b/test/integration/share/libraries/system.rb index 17aa4be..64405bb 100644 --- a/test/integration/share/libraries/system.rb +++ b/test/integration/share/libraries/system.rb @@ -4,7 +4,7 @@ # Author: Daniel Dehennin # Copyright (C) 2020 Daniel Dehennin -# rubocop:disable-next Metrics/ClassLength +# rubocop:disable Metrics/ClassLength class SystemResource < Inspec.resource(1) name 'system' @@ -47,7 +47,7 @@ def build_platform_name end end - # rubocop:disable-next Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity + # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity def build_platform_release case inspec.platform[:name] when 'amazon' @@ -60,9 +60,9 @@ def build_platform_release when 'mac_os_x' inspec.command('sw_vers -productVersion').stdout.to_s when 'opensuse' - release = inspec.platform[:release] - # rubocop:disable-next Style/NumericLiterals - release.to_i > 20210101 ? 'tumbleweed' : release + # rubocop:disable Style/NumericLiterals,Layout/LineLength + inspec.platform[:release].to_i > 20210101 ? 'tumbleweed' : inspec.platform[:release] + # rubocop:enable Style/NumericLiterals,Layout/LineLength when 'windows_8.1_pro' '8.1' when 'windows_server_2022_datacenter' @@ -75,6 +75,7 @@ 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' @@ -93,7 +94,7 @@ def build_finger_release end end - # rubocop:disable-next Metrics/MethodLength,Metrics/CyclomaticComplexity + # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity def build_platform_codename case build_platform_finger when 'ubuntu-22.04' @@ -132,4 +133,6 @@ def build_platform_codename '' end end + # rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity end +# rubocop:enable Metrics/ClassLength