Design System Audit: Fix hex check tool and automate reporting

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-23 16:31:08 +00:00
1 parent d937f04ba3
commit 82dea1e63e
4 files changed
+249 -3

No files matched your search

+18 -3
View File
@@ -2,19 +2,34 @@
import { spawnSync } from "node:child_process";
const SEARCH_PATTERN = '\\b#[0-9a-fA-F]{3,8}\\b';
// Use PCRE2 lookbehind to avoid:
// 1. Matches preceded by a word character (e.g. `Issue#123`)
// 2. Matches preceded by `&` (e.g. HTML entities `&#039;`)
const SEARCH_PATTERN = '(?<!&|[\\w])#[0-9a-fA-F]{3,8}\\b';
// Allow-list tokens and vector logos so brand assets can keep their baked colors.
const IGNORED_GLOBS = [
'!css/tokens.css',
'!**/*.svg',
'!**/node_modules/**',
'!.git/**'
'!.git/**',
'!**/*.min.js',
'!**/*.map',
'!css/tailwind.generated.css',
'!dist/**',
'!build/**',
'!vendor/**',
'!js/utils/qrcode.js',
'!**/dist/**',
'!REMEDIATION_REPORT.md',
'!scripts/daily-design-system-audit.mjs'
];
const rgArgs = [
'--color=never',
'--no-heading',
'-n'
'-n',
'-P' // Enable PCRE2 for lookbehind support
];
for (const glob of IGNORED_GLOBS) {