feat: add Azure Policy AST types#653
Conversation
8e86d77 to
3a86494
Compare
There was a problem hiding this comment.
Pull request overview
Adds foundational Azure Policy support types by introducing a span-annotated AST for policy definitions/rules/conditions and enhancing Azure Policy/ARM string comparison helpers for case-insensitive matching.
Changes:
- Introduces
languages::azure_policy::astwith span-tracked nodes for policy rules, constraints, operators, values, ARM template expressions, andcount. - Updates Azure Policy string utilities to clarify/document casing semantics and adjusts key/value comparison helpers.
- Refactors Unicode case folding implementation to use
icu_casemap::CaseMapper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/languages/azure_policy/strings/mod.rs | Adds documentation pointer for casing semantics. |
| src/languages/azure_policy/strings/keys.rs | Adjusts ARM key comparison helpers (signature/param naming). |
| src/languages/azure_policy/strings/case_fold.rs | Refactors full Unicode case folding implementation using CaseMapper. |
| src/languages/azure_policy/mod.rs | Expands module docs, adds AST module export, and applies clippy allowances. |
| src/languages/azure_policy/ast/mod.rs | Adds top-level Azure Policy AST definitions (rules, constraints, operators, fields, etc.). |
| src/languages/azure_policy/ast/value.rs | Adds JSON/value/expression/count node types with span tracking. |
Comments suppressed due to low confidence (1)
src/languages/azure_policy/mod.rs:12
- The crate-level
#![allow(...)]here applies to the entireazure_policymodule (includingaliasesandstrings), potentially masking new warnings outside the AST code. Consider scoping theseclippyallowances more narrowly (e.g., toastor specific files) so unrelated code still benefits from linting.
#[allow(clippy::pattern_type_mismatch)]
pub mod aliases;
pub mod ast;
pub mod strings;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ae448df to
f5fb53a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1fbc8ce to
8e43f6a
Compare
8e43f6a to
ca05bdf
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ca05bdf to
a7fb800
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add span-annotated AST types for Azure Policy conditions and rules. - PolicyDefinition, PolicyRule with if/then/details structure - Condition enum: field conditions, value conditions, logical combinators (allOf, anyOf, not), and count expressions - Operator enums for all 19 Azure Policy constraint operators (equals, contains, greater, matchInsensitively, etc.) - Expr enum for field references, literal values (number, string, bool), template function calls, and policy function invocations - Value types with span tracking for error reporting
a7fb800 to
11e1c47
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add span-annotated AST types for Azure Policy conditions and rules, plus string utility enhancements for case-insensitive policy matching.
AST types (ast/):