diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 18414dca3..9e8c9ca28 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -178,7 +178,21 @@
"showReuseMessage": false
},
"dependsOn": "test-build",
- "command": "bash checks/run_a11y_check.sh"
+ "command": "bash checks/run_a11y_check.sh ${input:a11y_min_level} ${input:a11y_url}"
},
+ ],
+ "inputs": [
+ {
+ "id": "a11y_min_level",
+ "description": "minimum violation level to report from run_a11y_check.sh",
+ "default": "minor",
+ "type": "promptString"
+ },
+ {
+ "id": "a11y_url",
+ "description": "url to run a11y audit on",
+ "default": "",
+ "type": "promptString"
+ }
]
}
diff --git a/checks/run_a11y_check.sh b/checks/run_a11y_check.sh
index 218b7025b..fba746636 100755
--- a/checks/run_a11y_check.sh
+++ b/checks/run_a11y_check.sh
@@ -2,9 +2,24 @@
# Runs the same WCAG audit as the AccessLint/audit@v0 GitHub Action, locally.
set -euo pipefail
+MIN_IMPACT=$1
+
CACHE_DIR="${HOME}/.cache/accesslint-audit"
PORT="$(python3 -c 'import socket; s=socket.socket(); s.bind(("",0)); print(s.getsockname()[1]); s.close()')"
-URLS="${1:-http://localhost:${PORT}/}"
+
+if [ ! -d "public" ]; then
+ echo "Error: 'public' directory does not exist. Run a build first!" >&2
+ exit 1
+fi
+
+if [ -n "${2:-}" ]; then
+ PAGE=$2
+ URLS="http://localhost:${PORT}/${PAGE}"
+else
+ # No URL given: audit every page from the built sitemap.
+ URLS="$(sed -n 's#.*
| Job type | -Requested tasks ( -n, --ntasks) |
-Requested logical CPUs per task ( --cpus-per-task) |
-Requested nodes (-N, --nodes) |
-Requested tasks per node ( --ntasks-per-node) |
-Preferred memory format | -Ideal value | +Job type | +Requested tasks ( -n, --ntasks) |
+Requested logical CPUs per task ( --cpus-per-task) |
+Requested nodes (-N, --nodes) |
+Requested tasks per node ( --ntasks-per-node) |
+Preferred memory format | +Ideal value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Serial | 1 (or unspecified) | 1 (or unspecified) | -(Irrelevant, but should not be specified)1 | -(Irrelevant, but should not be specified)2 | +(Irrelevant, but should not be specified)1 | +(Irrelevant, but should not be specified)2 | --mem= |
-Peak memory3 needed by the program | +Peak memory3 needed by the program | ||||
| Multithreaded (e.g. OpenMP), but not MPI | 1 (or unspecified) | > 1 | -(Irrelevant, but should not be specified)1 | -(Irrelevant, but should not be specified)2 | +(Irrelevant, but should not be specified)1 | +(Irrelevant, but should not be specified)2 | --mem= |
-Peak memory3 needed by the program | +Peak memory3 needed by the program | ||||
| MPI, evenly split between nodes (recommended method) | -Unspecified4 | +Unspecified4 | ≥ 1 (or unspecified) | -≥ 15 | -≥ 15 | +≥ 15 | +≥ 15 | --mem= |
-(Peak memory3 needed per MPI task) × (number of tasks per node) | +(Peak memory3 needed per MPI task) × (number of tasks per node) | |||
| MPI, evenly split between nodes (discouraged method) | > 1 | ≥ 1 (or unspecified) | -Either 1 or the number of tasks6 | -(Irrelevant, but should not be specified)4 | +Either 1 or the number of tasks6 | +(Irrelevant, but should not be specified)4 | --mem= |
-(Peak memory3 needed per MPI task) × (number of tasks per node) | +(Peak memory3 needed per MPI task) × (number of tasks per node) | ||||
| MPI, randomly placed | > 1 | ≥ 1 (or unspecified) | -> 1; < number of tasks6 (or unspecified) | -(Irrelevant, but should not be specified)4 | +> 1; < number of tasks6 (or unspecified) | +(Irrelevant, but should not be specified)4 | --mem-per-cpu= |
-(Peak memory3 needed per MPI task) ÷ (number of logical CPUs per MPI task) | +(Peak memory3 needed per MPI task) ÷ (number of logical CPUs per MPI task) |