openvox-lint 1.0.1 → 1.0.3
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 +21 -0
- data/DOCUMENTATION.md +1 -1
- data/README.md +1 -1
- data/lib/openvox-lint/check_plugin.rb +4 -1
- data/lib/openvox-lint/plugins/checks/double_quoted_strings.rb +8 -0
- data/lib/openvox-lint/version.rb +1 -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: 71723fc4a281f7c3536d6432b44c5e139836acc8c92fa5bfdb88889f106d6abb
|
|
4
|
+
data.tar.gz: d17a05a915f9f10b1e132a7eae9587f4877c14094e8d5104fb61c9ff4dbc63c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b15cf28730f168002763c7d5c3c193514897b890285ca8a3ab28cdc8d8b2db6cb0afd9368244c29e1f7cc343db833a84bd4ff5ffca6e858492edc97d8d85442
|
|
7
|
+
data.tar.gz: 4d738c4820d2266bff5ca38ab59e7e889614e6f1acf12362e00c0e2ebf2f818be3f19a021605f8bf92cd2a1e76b5a1a867304eac8718d99554394f275df93065
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to openvox-lint will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.3] - 2026-02-09
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **double_quoted_strings**: No longer flags double-quoted strings that
|
|
10
|
+
contain nested single-quote characters (e.g. `"it's running"`,
|
|
11
|
+
`"use 'ensure' as first parameter"`). Double quotes are the correct
|
|
12
|
+
choice when the string body contains literal single quotes, and this
|
|
13
|
+
is now recognised and skipped.
|
|
14
|
+
|
|
15
|
+
## [1.0.2] - 2026-02-09
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **duplicate_params**: No longer generates false positives when multiple
|
|
20
|
+
resource blocks inside a class or defined type share the same parameter
|
|
21
|
+
names (e.g. `command`, `path`, `onlyif` across separate `exec` blocks).
|
|
22
|
+
The underlying `compute_resource_indexes` helper now scopes each
|
|
23
|
+
resource's `param_tokens` to brace depth 1, so tokens belonging to
|
|
24
|
+
nested resource declarations are excluded.
|
|
25
|
+
|
|
5
26
|
## [1.0.1] - 2026-02-09
|
|
6
27
|
|
|
7
28
|
### Fixed
|
data/DOCUMENTATION.md
CHANGED
data/README.md
CHANGED
|
@@ -175,7 +175,7 @@ openvox-lint ships with **38 built-in checks** organized into categories:
|
|
|
175
175
|
|
|
176
176
|
| Check | Severity | Description |
|
|
177
177
|
|-------|----------|-------------|
|
|
178
|
-
| `double_quoted_strings` | warning | Use single quotes for strings without interpolation |
|
|
178
|
+
| `double_quoted_strings` | warning | Use single quotes for strings without interpolation, escapes, or nested quotes |
|
|
179
179
|
| `only_variable_string` | warning | Don't quote strings containing only a variable |
|
|
180
180
|
| `single_quote_string_with_variables` | warning | Use double quotes for strings with variables |
|
|
181
181
|
| `variables_not_enclosed` | warning | Variables in strings must use `${var}` braces |
|
|
@@ -97,7 +97,10 @@ module OpenvoxLint
|
|
|
97
97
|
when :LBRACE then depth += 1
|
|
98
98
|
when :RBRACE then depth -= 1
|
|
99
99
|
end
|
|
100
|
-
|
|
100
|
+
# Only collect tokens at depth 1 — the resource's own
|
|
101
|
+
# parameters. Tokens at depth >= 2 belong to nested
|
|
102
|
+
# resource declarations and must not be included.
|
|
103
|
+
params << sem[j] if depth == 1 && sem[j].type != :RBRACE
|
|
101
104
|
j += 1
|
|
102
105
|
end
|
|
103
106
|
results << { type: rtype, start: brace, end: j - 1, param_tokens: params }
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Double-quoted strings that do not contain variables or escape sequences
|
|
4
4
|
# should use single quotes instead.
|
|
5
|
+
#
|
|
6
|
+
# Exception: when the string body contains literal single-quote characters
|
|
7
|
+
# (e.g. "it's running", "use 'ensure'"), double quotes are the correct
|
|
8
|
+
# choice to avoid backslash-escaping those quotes. This is standard
|
|
9
|
+
# Puppet style and must not be flagged.
|
|
5
10
|
OpenvoxLint.new_check(:double_quoted_strings) do
|
|
6
11
|
def check
|
|
7
12
|
tokens.each do |tok|
|
|
@@ -10,6 +15,9 @@ OpenvoxLint.new_check(:double_quoted_strings) do
|
|
|
10
15
|
# STRING type means double-quoted without interpolation
|
|
11
16
|
next if val =~ /\\[nt\\$"]/ # has meaningful escapes
|
|
12
17
|
next if val.length <= 2 # empty string ""
|
|
18
|
+
# Strip surrounding double quotes to inspect inner content.
|
|
19
|
+
inner = val[1..-2] || ''
|
|
20
|
+
next if inner.include?("'") # contains nested single quotes
|
|
13
21
|
notify :warning,
|
|
14
22
|
message: 'string does not contain variables or escapes; use single quotes',
|
|
15
23
|
line: tok.line,
|
data/lib/openvox-lint/version.rb
CHANGED