openvox-lint 1.3.0 → 1.3.2
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 +15 -2
- data/DOCUMENTATION.md +2 -2
- data/README.md +1 -1
- data/lib/openvox-lint/check_plugin.rb +21 -0
- data/lib/openvox-lint/checks.rb +22 -9
- data/lib/openvox-lint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c05d5ae29ef48e240815439ce845d046cc744174e1a8fab4af7750f945f152f
|
|
4
|
+
data.tar.gz: a7089f30cbc770df73833be2173b44fe8dbe579647c2e07b9243b76a49cca67b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d73364d4a91db8da06e6cef69f9f4eb10def5ff8ced91531c79d5f3d95f129368f81f4de1361d05d1418d35dd5d1e7edb9fecbac93cffabe3c446d5bb187f29
|
|
7
|
+
data.tar.gz: 6aab6a244ad2e8448a9eaf26b75bff0305edb0e91592b0b115310e38e1e5833c164ef5a20935cadbddb057c80b3f4d2918b61849b2c1ba73d4b40e7d33d8bc27
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to openvox-lint will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.3.2] - 2026-05-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Strengthened resource detection logic in `compute_resource_indexes` to reliably exclude `class`/`define`/`node` bodies. This prevents multiple checks (especially `trailing_comma`) from incorrectly treating statements inside classes as resource attributes.
|
|
9
|
+
|
|
10
|
+
## [1.3.1] - 2026-05-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Critical false positive in `unquoted_resource_title`: resource types (e.g. `file`) inside `class { ... }` or `define { ... }` bodies were incorrectly reported as unquoted titles.
|
|
14
|
+
- `lint:ignore` parser now correctly handles multiple `lint:ignore:check` directives on a single comment line (space or comma separated) and bare `lint:ignore`.
|
|
15
|
+
- Added comprehensive regression tests for the above fixes plus real `--fix` verification for the five supported checks.
|
|
16
|
+
- Expanded unit test coverage across many previously untested checks and edge cases (legacy facts in lambdas/parameters, etc.).
|
|
17
|
+
|
|
5
18
|
## [1.3.0] - 2026-05-23
|
|
6
19
|
|
|
7
20
|
### Fixed / Production Readiness
|
|
@@ -15,7 +28,7 @@ All notable changes to openvox-lint will be documented in this file.
|
|
|
15
28
|
- Linter now writes mutated `manifest_lines` back to disk on `--fix` (with final-NL normalization per style guide). Fixes are line-based and safe; complex structural fixes (arrow_alignment) remain future work. Tested on real manifests.
|
|
16
29
|
- **`legacy_facts` crash fixed** (in active workspace): `require 'set'` present + exclusion logic for local class/define params and `|$var|` lambdas fully verified (no false positives, no NameError).
|
|
17
30
|
- Removed committed stale `openvox-lint-1.0.8.gem` (violated `.gitignore`).
|
|
18
|
-
- **Version/doc sync**: All references now 1.3.
|
|
31
|
+
- **Version/doc sync**: All references now 1.3.1 (source, docs header, comparison table, this changelog). Bumped for the --fix + hygiene milestone.
|
|
19
32
|
- Updated README links and comparison to point to canonical OpenVox style guide and note real --fix status.
|
|
20
33
|
- Architecture decision: retained OpenVox's lightweight `CheckPlugin` + depth-aware helpers (superior to puppet-lint Data for some cases); added minimal mutation support for fixes without porting heavy token-rewiring singleton.
|
|
21
34
|
|
|
@@ -23,7 +36,7 @@ All notable changes to openvox-lint will be documented in this file.
|
|
|
23
36
|
- `--fix` now production-usable for the listed checks (edits in place like puppet-lint).
|
|
24
37
|
- Style guide references prioritize OpenVox canonical docs.
|
|
25
38
|
|
|
26
|
-
### Contributors (for 1.3.0)
|
|
39
|
+
### Contributors (for 1.3.0 modernization)
|
|
27
40
|
- Grok Build (lead modernization per full analysis reports)
|
|
28
41
|
|
|
29
42
|
## [1.2.0] - 2026-03-12
|
data/DOCUMENTATION.md
CHANGED
|
@@ -10,7 +10,7 @@ reported in multiple output formats suitable for humans, CI systems, and IDEs.
|
|
|
10
10
|
This document covers the architecture, every public API, every built-in check,
|
|
11
11
|
the lexer token types, the plugin system, and integration guidance.
|
|
12
12
|
|
|
13
|
-
**Version:** 1.3.
|
|
13
|
+
**Version:** 1.3.2
|
|
14
14
|
**Checks:** 37 built-in (with real --fix support for 5+ checks)
|
|
15
15
|
**License:** Apache 2.0
|
|
16
16
|
**Compatibility:** OpenVox 8.x, Puppet 8.x, Puppet 7.x (with deprecation warnings)
|
|
@@ -94,7 +94,7 @@ The top-level namespace for all openvox-lint classes.
|
|
|
94
94
|
|
|
95
95
|
| Constant | Value | Description |
|
|
96
96
|
|----------|-------|-------------|
|
|
97
|
-
| `VERSION` | `'1.3.
|
|
97
|
+
| `VERSION` | `'1.3.2'` | Gem version string |
|
|
98
98
|
|
|
99
99
|
#### Class Methods
|
|
100
100
|
|
data/README.md
CHANGED
|
@@ -638,7 +638,7 @@ openvox-lint/
|
|
|
638
638
|
|
|
639
639
|
## Comparison with puppet-lint
|
|
640
640
|
|
|
641
|
-
| Feature | puppet-lint 5.x | openvox-lint 1.3.
|
|
641
|
+
| Feature | puppet-lint 5.x | openvox-lint 1.3.2 |
|
|
642
642
|
|---------|-----------------|------------------|
|
|
643
643
|
| Ruby requirement | ≥ 3.1 | ≥ 2.5 (RHEL 8, macOS, all modern platforms) |
|
|
644
644
|
| Runtime dependencies | None | None |
|
|
@@ -92,6 +92,21 @@ module OpenvoxLint
|
|
|
92
92
|
results = []; i = 0; sem = semantic_tokens
|
|
93
93
|
while i < sem.length
|
|
94
94
|
if sem[i].type == :NAME && i + 1 < sem.length && sem[i + 1].type == :LBRACE
|
|
95
|
+
# Skip NAME { that belong to class/define/node bodies rather than
|
|
96
|
+
# actual resources. This prevents inner statements (including other
|
|
97
|
+
# resources) from being treated as parameters of the class itself.
|
|
98
|
+
k = i - 1
|
|
99
|
+
while k >= 0
|
|
100
|
+
t = sem[k]
|
|
101
|
+
break if t.type == :CLASS || t.type == :DEFINE || t.type == :NODE
|
|
102
|
+
break unless t.formatting?
|
|
103
|
+
k -= 1
|
|
104
|
+
end
|
|
105
|
+
if k >= 0 && [:CLASS, :DEFINE, :NODE].include?(sem[k].type)
|
|
106
|
+
i += 1
|
|
107
|
+
next
|
|
108
|
+
end
|
|
109
|
+
|
|
95
110
|
rtype = sem[i]; brace = i + 1; depth = 1; j = brace + 1; params = []
|
|
96
111
|
while j < sem.length && depth > 0
|
|
97
112
|
case sem[j].type
|
|
@@ -141,6 +156,12 @@ module OpenvoxLint
|
|
|
141
156
|
results = []; sem = semantic_tokens
|
|
142
157
|
sem.each_with_index do |tok, i|
|
|
143
158
|
if tok.type == :LBRACE && i > 0 && sem[i - 1].type == :NAME
|
|
159
|
+
# Skip the opening brace of class/define/node bodies.
|
|
160
|
+
# Their name token before { is not a resource type; the next
|
|
161
|
+
# statement (often another resource) would otherwise be
|
|
162
|
+
# misinterpreted as an "unquoted resource title".
|
|
163
|
+
next if i >= 2 && [:CLASS, :DEFINE, :NODE].include?(sem[i-2]&.type)
|
|
164
|
+
|
|
144
165
|
j = i + 1
|
|
145
166
|
results << sem[j] if j < sem.length && %i[SSTRING STRING NAME VARIABLE].include?(sem[j].type)
|
|
146
167
|
end
|
data/lib/openvox-lint/checks.rb
CHANGED
|
@@ -43,15 +43,34 @@ module OpenvoxLint
|
|
|
43
43
|
@tokens.each do |tok|
|
|
44
44
|
next unless tok.type == :COMMENT
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
comment_text = tok.value.to_s
|
|
47
|
+
|
|
48
|
+
if comment_text =~ /lint:endignore/i
|
|
47
49
|
# Close the most recent open block
|
|
48
50
|
block = open_blocks.pop
|
|
49
51
|
if block
|
|
50
52
|
block[:end_line] = tok.line
|
|
51
53
|
results << block
|
|
52
54
|
end
|
|
53
|
-
elsif
|
|
54
|
-
|
|
55
|
+
elsif comment_text =~ /lint:ignore/i
|
|
56
|
+
# Robust extraction: find every "lint:ignore:" and take the following name(s)
|
|
57
|
+
# until the next "lint:" directive or end of comment.
|
|
58
|
+
checks = []
|
|
59
|
+
text = comment_text
|
|
60
|
+
while (idx = text.index(/lint:ignore:/i))
|
|
61
|
+
# Take from after this directive until the next directive or end
|
|
62
|
+
remaining = text[idx + 'lint:ignore:'.length .. -1]
|
|
63
|
+
next_dir = remaining.index(/lint:/i) || remaining.length
|
|
64
|
+
chunk = remaining[0...next_dir]
|
|
65
|
+
checks += chunk.split(/[,\s]+/).map { |s| s.strip.tr('-', '_').downcase }.reject(&:empty?)
|
|
66
|
+
# Advance past this directive for the next search
|
|
67
|
+
text = text[idx + 1 .. -1] || ''
|
|
68
|
+
end
|
|
69
|
+
checks.uniq!
|
|
70
|
+
if comment_text =~ /lint:ignore(?!\s*:)/i && checks.empty?
|
|
71
|
+
checks = []
|
|
72
|
+
end
|
|
73
|
+
|
|
55
74
|
# If there's code on the same line before this comment, treat
|
|
56
75
|
# it as inline-only (same line). Otherwise open a block.
|
|
57
76
|
if inline_ignore?(tok)
|
|
@@ -59,12 +78,6 @@ module OpenvoxLint
|
|
|
59
78
|
else
|
|
60
79
|
open_blocks.push({ start_line: tok.line, end_line: nil, checks: checks })
|
|
61
80
|
end
|
|
62
|
-
elsif tok.value =~ /lint:ignore\b/
|
|
63
|
-
if inline_ignore?(tok)
|
|
64
|
-
results << { start_line: tok.line, end_line: tok.line, checks: [] }
|
|
65
|
-
else
|
|
66
|
-
open_blocks.push({ start_line: tok.line, end_line: nil, checks: [] })
|
|
67
|
-
end
|
|
68
81
|
end
|
|
69
82
|
end
|
|
70
83
|
|
data/lib/openvox-lint/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openvox-lint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jerald Sheets
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|