Commit e1e2b8d
committed
refactor(lint): harden icon-color-variables against silent failures
Address PR review feedback on the icon-color-variables rule:
- Merge variable name indices across ALL candidate files instead of
requiring one file to hold every expected variable; binding validation
always runs against the merged index, so a degraded/failed variable
fetch or a renamed variable no longer silently skips the whole check.
- Treat config mistakes (selector matching nothing, empty allow-list,
no component matched, expected variables absent) as .warning, not a
hard .error that fails CI.
- Surface empty fileId with a precise message before resolution.
- Sample components with prefix(50) to respect NodesEndpoint rate limits.
- Skip fully transparent subtrees (opacity == 0); O(n) lookup -> dict.
- Wrap the generated policy in IconColorPolicy (failable init rejects an
empty allow-list, single allowed(for:) overlap rule); fix description
to reflect that binding is opt-in via requireBound.
Tests:
- Add fileId-aware MockClient overloads (setResponse/setError for:fileId:)
so cross-file resolution can be tested per file.
- Cover all API-failure paths, empty-fileId, multiple/nested fills,
transparent skip, RTL skip, unbound stroke, and unit-test
variableLookupKeys + IconColorPolicy. Rule suite: 10 -> 26 tests.
Clarify Lint.pkl field comments and capture session learnings in
pkl-codegen / troubleshooting / lint-patterns rule files.1 parent 07ed092 commit e1e2b8d
8 files changed
Lines changed: 758 additions & 159 deletions
File tree
- .claude/rules
- Sources
- ExFigCLI
- Lint/Rules
- Resources/Schemas
- ExFigConfig/Generated
- Tests/ExFigTests
- Helpers
- Lint
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
0 commit comments