Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused variable incorrectly reported by jsonnet-lint #778

Open
nkuln opened this issue Nov 27, 2024 · 0 comments
Open

Unused variable incorrectly reported by jsonnet-lint #778

nkuln opened this issue Nov 27, 2024 · 0 comments

Comments

@nkuln
Copy link

nkuln commented Nov 27, 2024

Looks like the circumstance is very specific -- when the var is being used in an assert statement as part of an object.

Expectation: jsonnet-lint does not report any error in this source file.
Actual: jsonnet-lint reports unused variable error
Details:

% cat assert_lint.jsonnet
local myvar = 'xxxxx';

{
  assert std.length(myvar) == 5 : 'yyyyy',
  some_field: 'zzzzz',
}

% jsonnet-lint --version
Jsonnet linter v0.20.0

% jsonnet-lint assert_lint.jsonnet
assert_lint.jsonnet:1:7-22 Unused variable: myvar

local myvar = 'xxxxx';


Problems found!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant