Skip to content

feat: add TAG105 to block tagging.taggable changing from false to true - #114

Merged
zhaomicx merged 2 commits into
mainfrom
tag105-taggable-false-to-true
Aug 26, 2026
Merged

feat: add TAG105 to block tagging.taggable changing from false to true#114
zhaomicx merged 2 commits into
mainfrom
tag105-taggable-false-to-true

Conversation

@zhaomicx

Copy link
Copy Markdown
Contributor

Issue

TAG101 blocks tagging.taggable going from true to false, but the inverse transition (false -> true) had no check.

Description of changes

Adds TAG105 - "tagging.taggable MUST NOT change from false to true".

This required restructuring the taggable branch of ensure_taggable_not_changed rather than just appending a clause. The branch asserted this.old_value == true as a bare clause with no custom message attached (the << ... >> block binds to the clause that precedes it, i.e. this.new_value != false). Because clauses in a block are ANDed, a false -> true flip already failed the rule today - but the resulting finding carried an empty message and was silently dropped by runner.py, which skips message-less checks. The violation surfaced in neither non_compliant, compliant, nor skipped.

Turning old_value into a when condition fixes that and lets each direction carry its own check id:

when this.property == "/tagging/taggable" {
    when this.old_value == true  { this.new_value != false << TAG101 >> }
    when this.old_value == false { this.new_value != true  << TAG105 >> }
}

TAG101 behavior is unchanged - same check id, message and reported path (/tagging/changed/0/new_value).

Testing

Verified against the engine for every transition: false -> true reports TAG105 only; true -> false reports TAG101 only; no-op and newly-added tagging blocks report nothing; TAG102/TAG104 unaffected. Two integ cases added (the minimal flip, plus the realistic case where a provider turns taggable on while adding tagOnCreate/tagUpdatable/cloudFormationSystemTags/tagProperty in the same revision).

Full suite 96 -> 98 passing, black==22.3.0 clean, pylint==2.15.10 at 10.00/10.

Follow-up (not in this PR)

TAG102 (tagOnCreate) and TAG103 (cloudFormationSystemTags) still have the same message-less-clause pattern, so a false -> true flip on either makes the rule fail with nothing reported. Happy to apply the same two-line restructure in a separate PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Adds the inverse of TAG101: flipping `tagging.taggable` from false to
true is now reported as a breaking change.

The taggable branch of `ensure_taggable_not_changed` asserted
`this.old_value == true` as a bare clause with no custom message
attached. A false -> true flip therefore failed that clause, but the
finding carried an empty message and was dropped by runner.py, which
skips message-less checks. The rule failed silently - the violation
showed up in neither non_compliant, compliant, nor skipped. Turning
old_value into a `when` condition surfaces the new TAG105 finding and
leaves TAG101 behavior (check id, message and path) unchanged.
The eslint hook has been failing `pre-commit run --all-files` with

    Failed to load plugin '@typescript-eslint' declared in
    'vscode-extension/.eslintrc.json': Cannot read properties of
    undefined (reading 'Intrinsic')

typescript is an *optional* peer dependency of
@typescript-eslint/eslint-plugin, so npm does not reliably install it
into the hook's isolated environment - but ts-api-utils, which the
plugin pulls in transitively, requires it at load time. Declaring
typescript@5.3.3 explicitly fixes the plugin load. 5.3.3 satisfies the
`^5.0.0` that vscode-extension/package.json already pins.

Verified with the hook's exact versions (eslint 8.56.0, parser and
plugin 6.21.0) plus typescript 5.3.3: eslint exits 0 over every
vscode-extension .js/.ts file and --fix rewrites nothing, so no source
changes are needed.
@zhaomicx
zhaomicx merged commit 48966bc into main Aug 26, 2026
7 checks passed
@zhaomicx
zhaomicx deleted the tag105-taggable-false-to-true branch August 26, 2026 17:47
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.

3 participants