A reliable test for the extra code needed in analyzer, passing shellcheck

This commit is contained in:
Ken Sternberg
2024-06-19 11:04:06 -07:00
parent 10a4db602a
commit e1248b3c7e
4 changed files with 32765 additions and 32740 deletions

File diff suppressed because it is too large Load Diff

1
web/package-lock.json generated
View File

@ -7,6 +7,7 @@
"": {
"name": "@goauthentik/web",
"version": "0.0.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@codemirror/lang-html": "^6.4.9",

View File

@ -18,6 +18,7 @@
"lint:precommit": "bun scripts/eslint-precommit.mjs",
"lint:spelling": "node scripts/check-spelling.mjs",
"lit-analyse": "lit-analyzer src",
"postinstall": "bash scripts/patch-analyser.sh",
"precommit": "npm-run-all --parallel tsc lit-analyse lint:spelling --sequential lint:precommit prettier",
"prequick": "run-s tsc:execute lit-analyse lint:precommit lint:spelling",
"prettier-check": "prettier --check .",

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
TARGET="./node_modules/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/handlers.js"
# If the second question mark is not there in this test, put it there. The flags to grep ensure it
# will behave correctly on both MacOS and Linux by requiring it to use only the POSIX "basic"
# regular expression behavior.
#
if ! grep -GL 'node\.name?\.text?\.startsWith' "$TARGET" > /dev/null 2>&1; then
patch --forward -V none --no-backup-if-mismatch -p0 $TARGET <<EOF
--- a/packages/analyzer/src/features/analyse-phase/creators/handlers.js
+++ b/packages/analyzer/src/features/analyse-phase/creators/handlers.js
@@ -34,7 +34,7 @@ export function handleModifiers(doc, node) {
}
});
- if (node.name?.text.startsWith('#')) {
+ if (node.name?.text?.startsWith('#')) {
doc.privacy = 'private';
}
EOF
fi