Skip to content

fix(lint): add tests for ::: (unhide) visibility#57

Merged
julienduchesne merged 2 commits intomasterfrom
worktree-fix-lint-attribute-colon-error
Feb 27, 2026
Merged

fix(lint): add tests for ::: (unhide) visibility#57
julienduchesne merged 2 commits intomasterfrom
worktree-fix-lint-attribute-colon-error

Conversation

@julienduchesne
Copy link
Collaborator

Summary

  • Adds a test fixture testdata/clean/triple_colon_visibility.jsonnet covering object fields with ::: (Jsonnet "unhide") visibility
  • Adds three inline unit tests in jrsonnet-lint/src/lib.rs:
    • lint_snippet_triple_colon_visibility_no_parse_errorattribute::: 'value' must not produce parse errors or diagnostics
    • lint_snippet_triple_colon_local_used_no_false_positive — a local used only in a ::: field value must not be reported as unused
    • lint_snippet_triple_colon_plus_modifier_no_parse_errorfield+::: (merge + unhide) must parse and lint cleanly

Test plan

  • cargo check --tests -p jrsonnet-lint passes (confirms code compiles)
  • cargo test -p jrsonnet-lint passes on CI (all three new tests green)
  • No regressions in existing lint tests

🤖 Generated with Claude Code

…ors and false positives

Object fields with ::: visibility (Jsonnet "unhide" operator) could trigger
unexpected behaviour in jrsonnet-lint. Add a test fixture and inline unit
tests covering:
- simple `attribute::: 'value'` must not produce parse errors or diagnostics
- a local variable used only in a ::: field value must not be reported as unused
- `field+:::` (merge + unhide) must parse and lint cleanly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 27, 2026

Benchmark Results

Benchmark Test vs tk vs base
Diff cluster_scoped 46.88x faster equal
Diff configmap_unchanged 26.79x faster equal
Diff deployment_nested_changes 26.51x faster equal
Env List Single Inline Directory (--json) 44.63x faster equal
Env List Single Inline File (--json) 44.49x faster equal
Env List All Environments (--json) 85.47x faster equal
Eval Single Static Environment 15.06x faster equal
Eval Inline Environment File 22.92x faster equal
Eval Eval Expression - Deeply Nested Path 15.3x faster equal
Export (Full) Single Static Environment 5.45x faster equal
Export (Full) Single Inline Environment 14.09x faster equal
Export (Full) All Environments 11.26x faster equal
Export (Replace) Single Static Environment 5.17x faster equal
Export (Replace) Single Inline Environment 16.78x faster equal
Export (Replace) All Environments 19.45x faster equal
Tool Importers Count Single Lib Directory (Non-Recursive) 2.12x faster equal
Tool Importers Count Single Lib Directory (Recursive) 2.16x faster equal
Tool Importers Count Entire Lib Directory (Non-Recursive) 1.43x faster equal
Tool Importers Count Entire Lib Directory (Recursive) 1.09x faster equal
Tool Importers Global Lib File 2.67x faster equal
Tool Importers Single Env-Specific Lib File 1.67x faster equal
Tool Importers All Env-Specific Lib Files 6.9x faster equal
Tool Importers All Lib Files 6.61x faster equal
Tool Importers All Jsonnet Files 11.68x faster equal
Tool Imports Single Static Environment 3.29x faster equal
Tool Imports Single Inline Environment File 3.34x faster equal

Full results available in workflow artifacts.

Benchmark run on commit 4b0afff677a8273c595f654588374e02f15af2af

…sing

`TS![: :: :::]` does not include COLONCOLONCOLON because Rust tokenizes
`:::` as two token trees (`::` + `:`) rather than one. The TS! macro
iterates over each token tree separately, so the `::: ` part maps to
`COLONCOLON` + `COLON` — COLONCOLONCOLON is never added to the set.

Introduce a `VISIBILITY_SET` constant built with `SyntaxKindSet::new`
to explicitly include all three visibility tokens (`:`, `::`, `:::`),
and use it everywhere the old `TS![: :: :::]` was used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julienduchesne julienduchesne merged commit be0db4c into master Feb 27, 2026
21 checks passed
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

Successfully merging this pull request may close these issues.

1 participant