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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c88e7f7c408afd3a75f203e4b9be28bc34fdbea11bba5245f5315a930cca516
4
- data.tar.gz: 3096af92ef4d33f90c50529778930d51a979992ca62e2a96990d5e2b1a8e1936
3
+ metadata.gz: 71723fc4a281f7c3536d6432b44c5e139836acc8c92fa5bfdb88889f106d6abb
4
+ data.tar.gz: d17a05a915f9f10b1e132a7eae9587f4877c14094e8d5104fb61c9ff4dbc63c2
5
5
  SHA512:
6
- metadata.gz: b7d189b56162653881f90a3ff60cdbfda158e252425904e0bd4e49b7adb169a78ba13214dfdd3439498125b9892d6d7e8bdae4fc247711fb3a43d501d5cb7a88
7
- data.tar.gz: db0220c84a03ce7f32acb448410ccd3ac61b1733c193b8f765a4eb91080bdf295c041f205e4e0841737b7a00a8c30975803115d2979e309eb090b7dfbfdf78c6
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
@@ -46,7 +46,7 @@ the lexer token types, the plugin system, and integration guidance.
46
46
 
47
47
  | Constant | Value | Description |
48
48
  |----------|-------|-------------|
49
- | `VERSION` | `'1.0.1'` | Gem version |
49
+ | `VERSION` | `'1.0.3'` | Gem version |
50
50
 
51
51
  ### Class Methods
52
52
 
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
- params << sem[j] if depth > 0
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenvoxLint
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openvox-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnny Sheets