scelint 0.5.0 → 0.6.1
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 +3 -3
- data/.github/workflows/tag_deploy_rubygem.yml +5 -5
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -4
- data/lib/scelint/cli.rb +14 -2
- data/lib/scelint/version.rb +1 -1
- data/lib/scelint.rb +4 -1
- data/scelint.gemspec +1 -1
- metadata +6 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2a232f07d18ffa6a294a5c8664e5c32fed52810ece80035b6ddc385be96695c
|
|
4
|
+
data.tar.gz: 1503e5f3c4a5e1a6c8c065b74b7c48c75efc5f081932e11f69a112c1b4bed08d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfe6c7bf98cbdd1364cf230c91faeae76bbfd5e71d7d17ba0a74f48a77c46ea5fd64e3474fb6f6841e92202174e73e34ce995899db9a5a5e0a896be8688ecede
|
|
7
|
+
data.tar.gz: c95d7b1e13e5b025374cb51e87494b8e8b25dd48b90df841bbfc482bef7687acbc5af2ddf99898962db3eda4e1a0e89ba1d4b3093b30b0a0e18efd5a954c875e
|
|
@@ -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@v2
|
|
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@v7
|
|
17
17
|
- name: "Install Ruby"
|
|
18
18
|
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
20
|
-
ruby-version: 4.0.
|
|
20
|
+
ruby-version: 4.0.6
|
|
21
21
|
bundler-cache: true
|
|
22
22
|
- run: bundle exec rake rubocop
|
|
23
23
|
|
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
- '4.0' # Latest
|
|
34
34
|
|
|
35
35
|
steps:
|
|
36
|
-
- uses: actions/checkout@
|
|
36
|
+
- uses: actions/checkout@v7
|
|
37
37
|
- name: Set up Ruby
|
|
38
38
|
uses: ruby/setup-ruby@v1
|
|
39
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@v7
|
|
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: 4.0.
|
|
95
|
+
ruby-version: 4.0.6
|
|
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@v7
|
|
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@v7
|
|
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: 4.0.
|
|
190
|
+
ruby-version: 4.0.6
|
|
191
191
|
bundler-cache: true
|
|
192
192
|
- name: Build RubyGem
|
|
193
193
|
run: |
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
### 0.6.1 / 2026-08-20
|
|
2
|
+
* Support compliance_engine 1.x
|
|
3
|
+
|
|
4
|
+
### 0.6.0 / 2026-03-11
|
|
5
|
+
* Add `.scelint` defaults file support (rspec-style CLI argument defaults)
|
|
6
|
+
* Add `--allow-reserved-words` option to skip reserved word checks on parameter names
|
|
7
|
+
|
|
1
8
|
### 0.5.0 / 2026-03-11
|
|
2
9
|
* Validate parameter names
|
|
3
10
|
* Fix command-line argument processing
|
data/Gemfile
CHANGED
|
@@ -3,18 +3,18 @@ source 'https://rubygems.org'
|
|
|
3
3
|
# Specify your gem's dependencies in scelint.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
gem 'rake', '~> 13.
|
|
6
|
+
gem 'rake', '~> 13.4.0'
|
|
7
7
|
|
|
8
8
|
group :tests do
|
|
9
9
|
gem 'rspec', '~> 3.13.1'
|
|
10
|
-
gem 'rubocop', '~> 1.
|
|
10
|
+
gem 'rubocop', '~> 1.89.0'
|
|
11
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.10.0'
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
group :development do
|
|
17
17
|
gem 'pry', '~> 0.16.0'
|
|
18
18
|
gem 'pry-byebug', '~> 3.12.0'
|
|
19
|
-
gem 'rdoc', '~>
|
|
19
|
+
gem 'rdoc', '~> 8.0.0'
|
|
20
20
|
end
|
data/lib/scelint/cli.rb
CHANGED
|
@@ -10,10 +10,21 @@ class Scelint::CLI < Thor
|
|
|
10
10
|
true
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
DEFAULTS_FILE = '.scelint'
|
|
14
|
+
|
|
15
|
+
# Load default arguments from .scelint in the current directory.
|
|
16
|
+
# Each non-blank, non-comment line may contain one or more arguments.
|
|
17
|
+
def self.load_defaults
|
|
18
|
+
return [] unless File.exist?(DEFAULTS_FILE)
|
|
19
|
+
File.readlines(DEFAULTS_FILE, chomp: true)
|
|
20
|
+
.reject { |line| line.strip.empty? || line.strip.start_with?('#') }
|
|
21
|
+
.flat_map(&:split)
|
|
22
|
+
end
|
|
23
|
+
|
|
13
24
|
# When the first argument is not a known subcommand or an option flag,
|
|
14
25
|
# treat all arguments as paths for the default `lint` command.
|
|
15
26
|
def self.start(given_args = ARGV, config = {})
|
|
16
|
-
args = given_args
|
|
27
|
+
args = load_defaults + given_args
|
|
17
28
|
if args.first && !args.first.start_with?('-') && !all_commands.key?(args.first)
|
|
18
29
|
args = ['lint'] + args
|
|
19
30
|
end
|
|
@@ -26,9 +37,10 @@ class Scelint::CLI < Thor
|
|
|
26
37
|
|
|
27
38
|
desc 'lint PATH', 'Lint all files in PATH'
|
|
28
39
|
option :strict, type: :boolean, aliases: '-s', default: false
|
|
40
|
+
option :allow_reserved_words, type: :boolean, default: false
|
|
29
41
|
def lint(*paths)
|
|
30
42
|
paths = ['.'] if paths.nil? || paths.empty?
|
|
31
|
-
lint = Scelint::Lint.new(paths, logger: logger)
|
|
43
|
+
lint = Scelint::Lint.new(paths, logger: logger, allow_reserved_words: options[:allow_reserved_words])
|
|
32
44
|
|
|
33
45
|
count = lint.files.count
|
|
34
46
|
|
data/lib/scelint/version.rb
CHANGED
data/lib/scelint.rb
CHANGED
|
@@ -134,8 +134,9 @@ module Scelint
|
|
|
134
134
|
#
|
|
135
135
|
# @param paths [Array<String>] Paths to look for SCE data in. Defaults to ['.']
|
|
136
136
|
# @param logger [Logger] A logger to send messages to. Defaults to an instance of Logger with the log level set to INFO.
|
|
137
|
-
def initialize(paths = ['.'], logger: Logger.new(STDOUT, level: Logger::INFO))
|
|
137
|
+
def initialize(paths = ['.'], logger: Logger.new(STDOUT, level: Logger::INFO), allow_reserved_words: false)
|
|
138
138
|
@log = logger
|
|
139
|
+
@allow_reserved_words = allow_reserved_words
|
|
139
140
|
@errors = []
|
|
140
141
|
@warnings = []
|
|
141
142
|
@notes = []
|
|
@@ -418,6 +419,8 @@ module Scelint
|
|
|
418
419
|
return
|
|
419
420
|
end
|
|
420
421
|
|
|
422
|
+
return if @allow_reserved_words
|
|
423
|
+
|
|
421
424
|
parameter.split('::').each do |part|
|
|
422
425
|
if reserved_words.include?(part)
|
|
423
426
|
errors << "#{file} (check '#{check}'): parameter name '#{parameter}' contains reserved word '#{part}'"
|
data/scelint.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scelint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Pritchard
|
|
@@ -41,22 +41,16 @@ dependencies:
|
|
|
41
41
|
name: compliance_engine
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
|
-
- - "
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: 0.1.0
|
|
47
|
-
- - "<"
|
|
44
|
+
- - "~>"
|
|
48
45
|
- !ruby/object:Gem::Version
|
|
49
|
-
version:
|
|
46
|
+
version: '1.0'
|
|
50
47
|
type: :runtime
|
|
51
48
|
prerelease: false
|
|
52
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
50
|
requirements:
|
|
54
|
-
- - "
|
|
55
|
-
- !ruby/object:Gem::Version
|
|
56
|
-
version: 0.1.0
|
|
57
|
-
- - "<"
|
|
51
|
+
- - "~>"
|
|
58
52
|
- !ruby/object:Gem::Version
|
|
59
|
-
version:
|
|
53
|
+
version: '1.0'
|
|
60
54
|
email:
|
|
61
55
|
- simp@simp-project.org
|
|
62
56
|
executables:
|
|
@@ -100,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
94
|
- !ruby/object:Gem::Version
|
|
101
95
|
version: '0'
|
|
102
96
|
requirements: []
|
|
103
|
-
rubygems_version: 4.0.
|
|
97
|
+
rubygems_version: 4.0.16
|
|
104
98
|
specification_version: 4
|
|
105
99
|
summary: Linter SIMP Compliance Engine data
|
|
106
100
|
test_files: []
|