scelint 0.5.0 → 0.6.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/CHANGELOG.md +4 -0
- data/lib/scelint/cli.rb +14 -2
- data/lib/scelint/version.rb +1 -1
- data/lib/scelint.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbcb49e907f0804f22a550c9507f56a6849ba26f2ba67f1893df0d41a289ea43
|
|
4
|
+
data.tar.gz: f4c83fa4d9e8cea6dec15625475904e7cf84f05b69de57657ad2a06b70fff5eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2661057050cc3819c58818bb726a429d5e47260c2505bd08c6a084c494b24b0a359bc8a2cfa7618ef8012f71899e54ce8ef0dbb5c68d02ad74958de16edde55a
|
|
7
|
+
data.tar.gz: e2362ae54fc4107861bd76244699386489b50efefebf09211bb38b7ff44d7fd7dc4ef3df4a77a49ce25a34cecd10e4598862a841bd7a322ef408008b02ee6643
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
### 0.6.0 / 2026-03-11
|
|
2
|
+
* Add `.scelint` defaults file support (rspec-style CLI argument defaults)
|
|
3
|
+
* Add `--allow-reserved-words` option to skip reserved word checks on parameter names
|
|
4
|
+
|
|
1
5
|
### 0.5.0 / 2026-03-11
|
|
2
6
|
* Validate parameter names
|
|
3
7
|
* Fix command-line argument processing
|
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}'"
|