scelint 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/add_new_issue_to_triage_project.yml +1 -1
- data/.github/workflows/pr_tests.yml +6 -5
- data/.github/workflows/tag_deploy_rubygem.yml +5 -5
- data/CHANGELOG.md +8 -0
- data/Gemfile +6 -6
- data/exe/scelint +1 -1
- data/lib/scelint/cli.rb +14 -0
- data/lib/scelint/version.rb +1 -1
- data/lib/scelint.rb +27 -1
- data/scelint.gemspec +1 -1
- metadata +11 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc7289501df2ba7489119cef80aff1319b3d4e3ced3c7256f77db2fadb757447
|
|
4
|
+
data.tar.gz: 03347cf49d0b25dfe69b1b20efc9288063b3003bd9b83c73f7096468a3d19a28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c453ffc5c435214e2a18b36f15f79362301500185311e76c674b4b9c7c040c29ff6816df81898a5b23f0a0c94d4f8abc42dd987749310ad6a3f38def9d67c3cc
|
|
7
|
+
data.tar.gz: 739acfe53764dff91810874f45a87ed697ee91915aeb5ee440e6d6350da602ab5ca64b9737c755b7cfee98ede884b80c015c8df4b10a465b928a790ebad04b8e
|
|
@@ -34,7 +34,7 @@ jobs:
|
|
|
34
34
|
name: Add issue to project
|
|
35
35
|
runs-on: ubuntu-latest
|
|
36
36
|
steps:
|
|
37
|
-
- uses: actions/add-to-project@
|
|
37
|
+
- uses: actions/add-to-project@v1.0.2
|
|
38
38
|
with:
|
|
39
39
|
project-url: https://github.com/orgs/simp/projects/11
|
|
40
40
|
github-token: ${{ secrets.AUTO_TRIAGE_TOKEN }}
|
|
@@ -13,11 +13,11 @@ jobs:
|
|
|
13
13
|
name: 'Ruby Style'
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
17
|
- name: "Install Ruby"
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
20
|
-
ruby-version:
|
|
20
|
+
ruby-version: 4.0.1
|
|
21
21
|
bundler-cache: true
|
|
22
22
|
- run: bundle exec rake rubocop
|
|
23
23
|
|
|
@@ -27,12 +27,13 @@ jobs:
|
|
|
27
27
|
strategy:
|
|
28
28
|
matrix:
|
|
29
29
|
ruby:
|
|
30
|
-
- '3.2' # Puppet 8
|
|
30
|
+
- '3.2' # Puppet/OpenVox 8
|
|
31
31
|
- '3.3'
|
|
32
|
-
- '3.4'
|
|
32
|
+
- '3.4'
|
|
33
|
+
- '4.0' # Latest
|
|
33
34
|
|
|
34
35
|
steps:
|
|
35
|
-
- uses: actions/checkout@
|
|
36
|
+
- uses: actions/checkout@v6
|
|
36
37
|
- name: Set up Ruby
|
|
37
38
|
uses: ruby/setup-ruby@v1
|
|
38
39
|
with:
|
|
@@ -63,7 +63,7 @@ jobs:
|
|
|
63
63
|
steps:
|
|
64
64
|
- name: "Assert '${{ github.ref }}' is a tag"
|
|
65
65
|
run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
|
|
66
|
-
- uses: actions/checkout@
|
|
66
|
+
- uses: actions/checkout@v6
|
|
67
67
|
with:
|
|
68
68
|
ref: ${{ github.ref }}
|
|
69
69
|
clean: true
|
|
@@ -92,7 +92,7 @@ jobs:
|
|
|
92
92
|
echo "release_command=$GEM_RELEASE_COMMAND" | tee -a "$GITHUB_OUTPUT"
|
|
93
93
|
- uses: ruby/setup-ruby@v1
|
|
94
94
|
with:
|
|
95
|
-
ruby-version:
|
|
95
|
+
ruby-version: 4.0.1
|
|
96
96
|
bundler-cache: true
|
|
97
97
|
- name: Test build the package
|
|
98
98
|
run: "${{ steps.commands.outputs.build_command }}"
|
|
@@ -117,7 +117,7 @@ jobs:
|
|
|
117
117
|
tag: ${{ steps.tag-check.outputs.tag }}
|
|
118
118
|
steps:
|
|
119
119
|
- name: Checkout code
|
|
120
|
-
uses: actions/checkout@
|
|
120
|
+
uses: actions/checkout@v6
|
|
121
121
|
with:
|
|
122
122
|
ref: ${{ github.ref }}
|
|
123
123
|
clean: true
|
|
@@ -181,13 +181,13 @@ jobs:
|
|
|
181
181
|
PKG_DIR: ${{ needs.releng-checks.outputs.pkg_dir }}
|
|
182
182
|
steps:
|
|
183
183
|
- name: Checkout code
|
|
184
|
-
uses: actions/checkout@
|
|
184
|
+
uses: actions/checkout@v6
|
|
185
185
|
with:
|
|
186
186
|
ref: ${{ github.ref }}
|
|
187
187
|
clean: true
|
|
188
188
|
- uses: ruby/setup-ruby@v1
|
|
189
189
|
with:
|
|
190
|
-
ruby-version:
|
|
190
|
+
ruby-version: 4.0.1
|
|
191
191
|
bundler-cache: true
|
|
192
192
|
- name: Build RubyGem
|
|
193
193
|
run: |
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
### 0.5.0 / 2026-03-11
|
|
2
|
+
* Validate parameter names
|
|
3
|
+
* Fix command-line argument processing
|
|
4
|
+
|
|
5
|
+
### 0.4.1 / 2026-01-26
|
|
6
|
+
* Support compliance_engine 0.2.x
|
|
7
|
+
* Test with Ruby 4.0
|
|
8
|
+
|
|
1
9
|
### 0.4.0 / 2025-08-26
|
|
2
10
|
* Updates for recent rubocop and plugins
|
|
3
11
|
* Bump minimum required Ruby version to 3.2.0 (oldest version we're testing with)
|
data/Gemfile
CHANGED
|
@@ -7,14 +7,14 @@ gem 'rake', '~> 13.3.0'
|
|
|
7
7
|
|
|
8
8
|
group :tests do
|
|
9
9
|
gem 'rspec', '~> 3.13.1'
|
|
10
|
-
gem 'rubocop', '~> 1.
|
|
11
|
-
gem 'rubocop-performance', '~> 1.
|
|
10
|
+
gem 'rubocop', '~> 1.85.0'
|
|
11
|
+
gem 'rubocop-performance', '~> 1.26.0'
|
|
12
12
|
gem 'rubocop-rake', '~> 0.7.1'
|
|
13
|
-
gem 'rubocop-rspec', '~> 3.
|
|
13
|
+
gem 'rubocop-rspec', '~> 3.9.0'
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
group :development do
|
|
17
|
-
gem 'pry', '~> 0.
|
|
18
|
-
gem 'pry-byebug', '~> 3.
|
|
19
|
-
gem 'rdoc', '~>
|
|
17
|
+
gem 'pry', '~> 0.16.0'
|
|
18
|
+
gem 'pry-byebug', '~> 3.12.0'
|
|
19
|
+
gem 'rdoc', '~> 7.2.0'
|
|
20
20
|
end
|
data/exe/scelint
CHANGED
data/lib/scelint/cli.rb
CHANGED
|
@@ -6,6 +6,20 @@ require 'logger'
|
|
|
6
6
|
|
|
7
7
|
# SCELint CLI
|
|
8
8
|
class Scelint::CLI < Thor
|
|
9
|
+
def self.exit_on_failure?
|
|
10
|
+
true
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# When the first argument is not a known subcommand or an option flag,
|
|
14
|
+
# treat all arguments as paths for the default `lint` command.
|
|
15
|
+
def self.start(given_args = ARGV, config = {})
|
|
16
|
+
args = given_args
|
|
17
|
+
if args.first && !args.first.start_with?('-') && !all_commands.key?(args.first)
|
|
18
|
+
args = ['lint'] + args
|
|
19
|
+
end
|
|
20
|
+
super(args, config)
|
|
21
|
+
end
|
|
22
|
+
|
|
9
23
|
class_option :quiet, type: :boolean, aliases: '-q', default: false
|
|
10
24
|
class_option :verbose, type: :boolean, aliases: '-v', default: false
|
|
11
25
|
class_option :debug, type: :boolean, aliases: '-d', default: false
|
data/lib/scelint/version.rb
CHANGED
data/lib/scelint.rb
CHANGED
|
@@ -396,7 +396,33 @@ module Scelint
|
|
|
396
396
|
# @param check [String] The name of the check
|
|
397
397
|
# @param parameter [String] The parameter to validate
|
|
398
398
|
def check_parameter(file, check, parameter)
|
|
399
|
-
|
|
399
|
+
# Regular expression to match valid Puppet class parameter names
|
|
400
|
+
valid_parameter = %r{\A([a-z][a-z0-9_]*::)+[a-z][a-z0-9_]*\z}
|
|
401
|
+
# From https://www.puppet.com/docs/puppet/7/lang_reserved.html
|
|
402
|
+
reserved_words = ['and', 'application', 'attr', 'case', 'component', 'consumes', 'default', 'define', 'elsif',
|
|
403
|
+
'environment', 'false', 'function', 'if', 'import', 'in', 'inherits', 'node',
|
|
404
|
+
'or', 'private', 'produces', 'regexp', 'site', 'true', 'type', 'undef', 'unit', 'unless',
|
|
405
|
+
'main', 'settings', 'init', 'any', 'array', 'binary', 'boolean', 'catalogentry', 'class',
|
|
406
|
+
'collection', 'callable', 'data', 'default', 'deferred', 'enum', 'float', 'hash', 'integer',
|
|
407
|
+
'notundef', 'numeric', 'optional', 'pattern', 'resource', 'regexp', 'runtime', 'scalar',
|
|
408
|
+
'semver', 'semVerRange', 'sensitive', 'string', 'struct', 'timespan', 'timestamp', 'tuple',
|
|
409
|
+
'type', 'undef', 'variant', 'facts', 'trusted', 'server_facts', 'title', 'name'].freeze
|
|
410
|
+
|
|
411
|
+
unless parameter.is_a?(String) && !parameter.empty?
|
|
412
|
+
errors << "#{file} (check '#{check}'): invalid parameter '#{parameter}'"
|
|
413
|
+
return
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
unless parameter.match?(valid_parameter)
|
|
417
|
+
errors << "#{file} (check '#{check}'): invalid parameter name '#{parameter}'"
|
|
418
|
+
return
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
parameter.split('::').each do |part|
|
|
422
|
+
if reserved_words.include?(part)
|
|
423
|
+
errors << "#{file} (check '#{check}'): parameter name '#{parameter}' contains reserved word '#{part}'"
|
|
424
|
+
end
|
|
425
|
+
end
|
|
400
426
|
end
|
|
401
427
|
|
|
402
428
|
# Check remediation
|
data/scelint.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scelint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Pritchard
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: deep_merge
|
|
@@ -42,17 +41,22 @@ dependencies:
|
|
|
42
41
|
name: compliance_engine
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
|
-
- - "
|
|
44
|
+
- - ">="
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
46
|
version: 0.1.0
|
|
47
|
+
- - "<"
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: 0.3.0
|
|
48
50
|
type: :runtime
|
|
49
51
|
prerelease: false
|
|
50
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
53
|
requirements:
|
|
52
|
-
- - "
|
|
54
|
+
- - ">="
|
|
53
55
|
- !ruby/object:Gem::Version
|
|
54
56
|
version: 0.1.0
|
|
55
|
-
|
|
57
|
+
- - "<"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: 0.3.0
|
|
56
60
|
email:
|
|
57
61
|
- simp@simp-project.org
|
|
58
62
|
executables:
|
|
@@ -82,7 +86,6 @@ licenses:
|
|
|
82
86
|
metadata:
|
|
83
87
|
homepage_uri: https://github.com/simp/rubygem-simp-scelint
|
|
84
88
|
source_code_uri: https://github.com/simp/rubygem-simp-scelint
|
|
85
|
-
post_install_message:
|
|
86
89
|
rdoc_options: []
|
|
87
90
|
require_paths:
|
|
88
91
|
- lib
|
|
@@ -97,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
100
|
- !ruby/object:Gem::Version
|
|
98
101
|
version: '0'
|
|
99
102
|
requirements: []
|
|
100
|
-
rubygems_version:
|
|
101
|
-
signing_key:
|
|
103
|
+
rubygems_version: 4.0.3
|
|
102
104
|
specification_version: 4
|
|
103
105
|
summary: Linter SIMP Compliance Engine data
|
|
104
106
|
test_files: []
|