mirror of
https://github.com/awslabs/iam-policy-autopilot.git
synced 2026-04-25 16:05:58 +03:00
[PR #62] [MERGED] feat: add custom dylint lint to enforce node_kinds constants usage #212
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/iam-policy-autopilot#212
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/62
Author: @adpaco-aws
Created: 12/9/2025
Status: ✅ Merged
Merged: 12/9/2025
Merged by: @adpaco-aws
Base:
main← Head:custom-dylint-node-kinds📝 Commits (4)
471ca2dfeat: add custom dylint lint to enforce node_kinds constants usage4ecd65bdocs: explain need of nightly and clippy version matching31861fcfix: additionally check type onkind()receiverf1ba24ffix: make lint trigger errors instead of warnings📊 Changes
13 files changed (+390 additions, -6 deletions)
View changed files
📝
.github/workflows/pr-checks.yml(+32 -0)📝
Cargo.toml(+1 -0)➕
dylint.toml(+4 -0)➕
iam-policy-autopilot-lints/.cargo/config.toml(+6 -0)➕
iam-policy-autopilot-lints/Cargo.toml(+23 -0)➕
iam-policy-autopilot-lints/README.md(+76 -0)➕
iam-policy-autopilot-lints/rust-toolchain(+6 -0)➕
iam-policy-autopilot-lints/src/lib.rs(+14 -0)➕
iam-policy-autopilot-lints/src/node_kind_literal.rs(+113 -0)➕
iam-policy-autopilot-lints/ui/main.rs(+80 -0)➕
iam-policy-autopilot-lints/ui/main.stderr(+35 -0)📝
iam-policy-autopilot-policy-generation/src/extraction/go/node_kinds.rs(+0 -3)📝
iam-policy-autopilot-policy-generation/src/extraction/python/node_kinds.rs(+0 -3)📄 Description
Issue #, if available: Resolves #60
Description of changes: Adds a custom dylint lint that enforces the use of
node_kindsconstants instead of string literals when comparing Tree-sitter node types. The lint detects any pattern where.kind()is compared with a string literal (e.g.,node.kind() == "composite_literal") and suggests defining a constant in anode_kindsmodule.This is enforced automatically in CI via a new
custom-lintsjob that runs on every PR, preventing regressions from the recent node kinds constants refactor.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.