diff --git a/.github/requirements/coverage.in b/.github/requirements/coverage.in index cea0f35a..92c60707 100644 --- a/.github/requirements/coverage.in +++ b/.github/requirements/coverage.in @@ -2,3 +2,6 @@ coverage==7.17.2 PyYAML==6.0.3 Markdown==3.11.3 +# The optional console report and TUI, so that their tests run and count. +rich==15.0.0 +textual==8.2.8 diff --git a/.github/requirements/coverage.txt b/.github/requirements/coverage.txt index 287a1733..239ea187 100644 --- a/.github/requirements/coverage.txt +++ b/.github/requirements/coverage.txt @@ -125,10 +125,39 @@ coverage==7.17.2 \ --hash=sha256:f94d465ee00ebe694ca866d66bbe45fa04618b1afcb377de934694f624fa7cf6 \ --hash=sha256:ffbaadf8612781358b3f949ad68dce26c5a35beaafcc48125fc231dbcce7d362 # via -r coverage.in +linkify-it-py==2.2.0 \ + --hash=sha256:3adc40eb5af300b2605fcfdb968c24e1d780a90f1f2221af7c15e5111e94d443 \ + --hash=sha256:907acd2d17ac1fbb9ddb62c8957ccbd6158cac602231a15c3b0cd1e215f03cee + # via markdown-it-py markdown==3.11.3 \ --hash=sha256:81eb91631dc97ad1efbc76019ef0f80fe90ca49ddf81546752d79989c3bfff3e \ --hash=sha256:e1a31a112232504d753e5c01bb8c2de90d3f0ba986b063e10770cf7695b09e73 # via -r coverage.in +markdown-it-py==4.2.0 \ + --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ + --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a + # via + # mdit-py-plugins + # rich + # textual +mdit-py-plugins==0.6.1 \ + --hash=sha256:214c82fb2ac524472ab6a5bcab1de80f73b50443e187f401bfd77efbc7c6481d \ + --hash=sha256:a2bca0f039f39dbd35fb74ae1b5f998608c437463371f0ff7f49a19a17a114d0 + # via textual +mdurl==0.1.2 \ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ + --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba + # via markdown-it-py +platformdirs==4.14.5 \ + --hash=sha256:32e9921db7385aa8169bee4fe9501923e5715ba9fb7ea3b9c69b0d8e0639f7a1 \ + --hash=sha256:8e778c6fa421516f4d3369449f8df3b0e1b72c0e0005fe88e3ec772d0a14e750 + # via textual +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via + # rich + # textual pyyaml==6.0.3 \ --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ --hash=sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a \ @@ -204,3 +233,17 @@ pyyaml==6.0.3 \ --hash=sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926 \ --hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0 # via -r coverage.in +rich==15.0.0 \ + --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \ + --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36 + # via + # -r coverage.in + # textual +textual==8.2.8 \ + --hash=sha256:267375fd402dc8d981457212efa71f0e3365fd17bba144ba9bb3ed7563cb374a \ + --hash=sha256:3f106a9fbc73e39dd266c9712432087de78a6d644084c7c241d6a25c3169115b + # via -r coverage.in +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via textual diff --git a/.github/requirements/test.in b/.github/requirements/test.in index a01df89d..cdca4079 100644 --- a/.github/requirements/test.in +++ b/.github/requirements/test.in @@ -2,3 +2,11 @@ PyYAML==6.0.3 # tests/build_site.py renders the documentation site. Markdown==3.11.3 +# The optional console report and TUI, so that their tests run and count. +rich==15.0.0 +textual==8.2.8 +# Runs the suite (unittest test cases) in parallel, one worker per core. +pytest==9.2.0 +pytest-xdist==3.8.0 +# pytest needs it on Windows only, so compiling on Linux would leave it out of the pins. +colorama==0.4.6 diff --git a/.github/requirements/test.txt b/.github/requirements/test.txt index 4de8389c..5e7a533d 100644 --- a/.github/requirements/test.txt +++ b/.github/requirements/test.txt @@ -4,10 +4,70 @@ # # pip-compile --allow-unsafe --generate-hashes --no-emit-index-url --output-file=test.txt --strip-extras test.in # +colorama==0.4.6 \ + --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ + --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 + # via -r test.in +execnet==2.1.2 \ + --hash=sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd \ + --hash=sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec + # via pytest-xdist +iniconfig==2.3.1 \ + --hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \ + --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 + # via pytest +linkify-it-py==2.2.0 \ + --hash=sha256:3adc40eb5af300b2605fcfdb968c24e1d780a90f1f2221af7c15e5111e94d443 \ + --hash=sha256:907acd2d17ac1fbb9ddb62c8957ccbd6158cac602231a15c3b0cd1e215f03cee + # via markdown-it-py markdown==3.11.3 \ --hash=sha256:81eb91631dc97ad1efbc76019ef0f80fe90ca49ddf81546752d79989c3bfff3e \ --hash=sha256:e1a31a112232504d753e5c01bb8c2de90d3f0ba986b063e10770cf7695b09e73 # via -r test.in +markdown-it-py==4.2.0 \ + --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ + --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a + # via + # mdit-py-plugins + # rich + # textual +mdit-py-plugins==0.6.1 \ + --hash=sha256:214c82fb2ac524472ab6a5bcab1de80f73b50443e187f401bfd77efbc7c6481d \ + --hash=sha256:a2bca0f039f39dbd35fb74ae1b5f998608c437463371f0ff7f49a19a17a114d0 + # via textual +mdurl==0.1.2 \ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ + --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba + # via markdown-it-py +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via pytest +platformdirs==4.14.5 \ + --hash=sha256:32e9921db7385aa8169bee4fe9501923e5715ba9fb7ea3b9c69b0d8e0639f7a1 \ + --hash=sha256:8e778c6fa421516f4d3369449f8df3b0e1b72c0e0005fe88e3ec772d0a14e750 + # via textual +pluggy==1.7.0 \ + --hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \ + --hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8 + # via pytest +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via + # pytest + # rich + # textual +pytest==9.2.0 \ + --hash=sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588 \ + --hash=sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b + # via + # -r test.in + # pytest-xdist +pytest-xdist==3.8.0 \ + --hash=sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88 \ + --hash=sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1 + # via -r test.in pyyaml==6.0.3 \ --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ --hash=sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a \ @@ -83,3 +143,17 @@ pyyaml==6.0.3 \ --hash=sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926 \ --hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0 # via -r test.in +rich==15.0.0 \ + --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \ + --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36 + # via + # -r test.in + # textual +textual==8.2.8 \ + --hash=sha256:267375fd402dc8d981457212efa71f0e3365fd17bba144ba9bb3ed7563cb374a \ + --hash=sha256:3f106a9fbc73e39dd266c9712432087de78a6d644084c7c241d6a25c3169115b + # via -r test.in +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via textual diff --git a/.github/requirements/typing.in b/.github/requirements/typing.in index 1cfab62b..8d8acd55 100644 --- a/.github/requirements/typing.in +++ b/.github/requirements/typing.in @@ -3,5 +3,6 @@ mypy==2.4.1 types-PyYAML==6.0.12.20261103 PyYAML==6.0.3 rich==15.0.0 +textual==8.2.8 types-Markdown==3.11.3.20261108 Markdown==3.11.3 diff --git a/.github/requirements/typing.txt b/.github/requirements/typing.txt index c1fe6291..3f162e0d 100644 --- a/.github/requirements/typing.txt +++ b/.github/requirements/typing.txt @@ -202,6 +202,10 @@ librt==0.16.0 \ --hash=sha256:fe52bf4641069e7978a14253b036cb9002def1926317e710f2e249f8a8c47742 \ --hash=sha256:ff7baa55f8e7c69851419e50a666015d02a74198716fd45c0125a2112e0a389f # via mypy +linkify-it-py==2.2.0 \ + --hash=sha256:3adc40eb5af300b2605fcfdb968c24e1d780a90f1f2221af7c15e5111e94d443 \ + --hash=sha256:907acd2d17ac1fbb9ddb62c8957ccbd6158cac602231a15c3b0cd1e215f03cee + # via markdown-it-py markdown==3.11.3 \ --hash=sha256:81eb91631dc97ad1efbc76019ef0f80fe90ca49ddf81546752d79989c3bfff3e \ --hash=sha256:e1a31a112232504d753e5c01bb8c2de90d3f0ba986b063e10770cf7695b09e73 @@ -209,7 +213,14 @@ markdown==3.11.3 \ markdown-it-py==4.2.0 \ --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a - # via rich + # via + # mdit-py-plugins + # rich + # textual +mdit-py-plugins==0.6.1 \ + --hash=sha256:214c82fb2ac524472ab6a5bcab1de80f73b50443e187f401bfd77efbc7c6481d \ + --hash=sha256:a2bca0f039f39dbd35fb74ae1b5f998608c437463371f0ff7f49a19a17a114d0 + # via textual mdurl==0.1.2 \ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba @@ -276,10 +287,16 @@ pathspec==1.1.1 \ --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189 # via mypy +platformdirs==4.14.5 \ + --hash=sha256:32e9921db7385aa8169bee4fe9501923e5715ba9fb7ea3b9c69b0d8e0639f7a1 \ + --hash=sha256:8e778c6fa421516f4d3369449f8df3b0e1b72c0e0005fe88e3ec772d0a14e750 + # via textual pygments==2.21.0 \ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c - # via rich + # via + # rich + # textual pyyaml==6.0.3 \ --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ --hash=sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a \ @@ -358,6 +375,12 @@ pyyaml==6.0.3 \ rich==15.0.0 \ --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \ --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36 + # via + # -r typing.in + # textual +textual==8.2.8 \ + --hash=sha256:267375fd402dc8d981457212efa71f0e3365fd17bba144ba9bb3ed7563cb374a \ + --hash=sha256:3f106a9fbc73e39dd266c9712432087de78a6d644084c7c241d6a25c3169115b # via -r typing.in types-markdown==3.11.3.20261108 \ --hash=sha256:eac0188fc8dacbf9bbbea68a0aee98c7d3b0008f8b1def1a141cd669dd7c708a \ @@ -370,4 +393,6 @@ types-pyyaml==6.0.12.20261103 \ typing-extensions==4.16.0 \ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 - # via mypy + # via + # mypy + # textual diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a92c65d8..4ac6beb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,11 +67,12 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install PyYAML + - name: Install the test dependencies run: python -m pip install --require-hashes -r .github/requirements/test.txt + # The unittest suite, run by pytest-xdist on every core; warnings are errors in each worker. - name: Test - run: python -W error -m unittest + run: python -W error -m pytest -W error -n auto -p no:cacheprovider formatting: name: formatting @@ -235,8 +236,12 @@ jobs: # the job summary first; the strict run decides the step. - name: Validate project_validator with itself run: | - project-validator --format markdown --exclude tests/fixtures . >> "$GITHUB_STEP_SUMMARY" || true - project-validator --strict --exclude tests/fixtures . + # The HTML report's script (views/assets) is JavaScript without a JavaScript toolchain of its own yet: it is + # left out until it has one, rather than hidden from the validator. build/ is what `pip install .` left + # (a copy of the package, that script included). + exclude=(--exclude tests/fixtures --exclude project_validator/views/assets --exclude build) + project-validator --format markdown "${exclude[@]}" . >> "$GITHUB_STEP_SUMMARY" || true + project-validator --strict "${exclude[@]}" . # What a pull request changes in the support matrix (the rows a profile or a check adds), against main's. - name: Show the support matrix changes diff --git a/.github/workflows/leaderboard.yml b/.github/workflows/leaderboard.yml index 9622681d..efe58f94 100644 --- a/.github/workflows/leaderboard.yml +++ b/.github/workflows/leaderboard.yml @@ -103,9 +103,10 @@ jobs: path: ${{ runner.temp }}/results merge-multiple: true - # The data branch holds only the results (an orphan branch, created on the first night). The token is used for - # this push alone, not kept in the checkout. - - name: Add the night to the leaderboard-data branch + # The data branch holds only the results, as one commit: each night replaces it, so that the projects' full + # HTML reports (the latest only) never grow its history; history/ keeps every night's numbers. The token is + # used for this push alone, not kept in the checkout. + - name: Record the night as the leaderboard-data branch env: GH_TOKEN: ${{ github.token }} REPOSITORY: ${{ github.repository }} @@ -119,10 +120,11 @@ jobs: fi python -m leaderboard record "${RUNNER_TEMP}/results" "$data" --date "$(date -u +%F)" cd "$data" + git checkout --quiet --orphan night git add --all git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ commit --quiet --allow-empty -m "Leaderboard for $(date -u +%F)" - git push --quiet "$remote" HEAD:leaderboard-data + git push --quiet --force "$remote" HEAD:leaderboard-data publish: name: publish the site diff --git a/.github/workflows/mutation-testing.yml b/.github/workflows/mutation-testing.yml index 865cdff1..3b6ea779 100644 --- a/.github/workflows/mutation-testing.yml +++ b/.github/workflows/mutation-testing.yml @@ -14,7 +14,7 @@ jobs: mutmut: name: mutmut runs-on: ubuntu-latest - timeout-minutes: 35 + timeout-minutes: 45 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -55,12 +55,12 @@ jobs: git -C mutants add -A # A budget below the job's timeout: a pull request that changes many functions still gets a report # of the mutants checked so far, instead of a cancelled job and no report at all. The budget covers - # the whole run: the stats pass that maps tests to functions (the full suite, 8 to 14 minutes), the + # the whole run: the stats pass that maps tests to functions (the full suite, 15 to 20 minutes), the # clean run of the tests covering the changed functions (up to the full suite again for a change to # a central function), then the mutants at about two seconds each. A pull request that changes a few # functions finishes well inside it; one that changes central ones gets the mutants of the fastest # tests first. - budget_minutes=20 + budget_minutes=30 status=0 timeout --signal=INT --kill-after=2m "${budget_minutes}m" mutmut run "${patterns[@]}" 2>&1 | tee run.log || status=$? if grep -q 'Filtered for specific mutants, but nothing matches' run.log; then @@ -68,7 +68,9 @@ jobs: echo "The changed functions have no mutants: nothing to mutate." >> "$GITHUB_STEP_SUMMARY" exit 0 fi - [ "$status" -eq 0 ] || [ "$status" -eq 124 ] || exit "$status" + # 124 is the budget's end; 137 is the KILL two minutes after it, when mutmut ignored the INT (its stats pass + # does): both are the budget running out, reported below, not a failure. + [ "$status" -eq 0 ] || [ "$status" -eq 124 ] || [ "$status" -eq 137 ] || exit "$status" # The results also list every mutant not run (the other functions'), which would fill the summary. survivors=$(mktemp) mutmut results | grep -v ': not checked$' > "$survivors" || true @@ -78,7 +80,7 @@ jobs: echo echo 'Mutants of: `'"${patterns[*]}"'`' echo - if [ "$status" -eq 124 ]; then + if [ "$status" -ne 0 ]; then echo "Stopped after $budget_minutes minutes with $checked mutants checked: the results below cover those." echo fi diff --git a/.gitignore b/.gitignore index 71a2ca35..85067b99 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] .mypy_cache/ .ruff_cache/ +.pytest_cache/ # Virtual environments .venv/ diff --git a/README.md b/README.md index 43103371..dc35ca7a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,9 @@ The validator itself is pure Python and has no build step; it only inspects - Python 3.12+ (the system Python on Ubuntu 24.04 LTS and later; no installation step, run with `python3 -m project_validator `) - [PyYAML](https://pyyaml.org/) 6.0+ (`python3-yaml` on Ubuntu, or `python3 -m pip install PyYAML`) -- Optionally [rich](https://github.com/Textualize/rich) 13.0+ for colored output +- Optionally [rich](https://github.com/Textualize/rich) 13.0+ for the console report (`pip install + project_validator[pretty]`), and [textual](https://github.com/Textualize/textual) for the TUI (`[tui]`; `[all]` for + both). The HTML report needs nothing more - CMake / CTest, only for `--build` (already required by any CMake project being validated) On a machine without Python 3.12, `uv run` or a distro backport will work. @@ -43,8 +45,24 @@ python3 -m project_validator --map path/to/project python3 -m project_validator --facts path/to/project python3 -m project_validator --answers path/to/project python3 -m project_validator --only coverage,platform-matrix --format json path/to/project +python3 -m project_validator --html report.html --score path/to/project +python3 -m project_validator --explain fuzz-testing +python3 -m project_validator --tui path/to/project ``` +What you see: +- **In a terminal** (with rich): a header with the score, then what was detected (each language and what recognised + it, the units, the code in each role and how it is judged, the CI, how much was read), the results grouped by + category with a line per language where they differ, and the score's breakdown and next steps. Progress is shown + while the project is read. `--verbose` shows every detail and the checks that do not apply. +- **Elsewhere** (CI logs, or without rich): the same detection, then one greppable `[STATUS] check: message` line per + check, each detail said once. +- **The HTML report** (`--html FILE`, or `--format html`): one self-contained file, light and dark, with the score, + what was detected, every result with why it matters, a matrix of checks by language, the next steps, a searchable + browser of every fact the validator read (linked to the file on GitHub for a checkout) and how long each stage took. +- **The TUI** (`--tui`, with textual): the stages as they are read, then a tree of the overview, what was detected, + the results, the next steps and the facts by kind. + | Option | Meaning | |---|---| | `--list` | list the available checks; with `--format json`, also the ecosystems each one applies to; with `--format markdown`, as a table of check, ecosystems and description | @@ -53,13 +71,17 @@ python3 -m project_validator --only coverage,platform-matrix --format json path/ | `--facts` | print the facts found about the project as JSON, each with where it was found: the source and build files with their languages, the settings the configuration files hold (per tool), the CI jobs (one per matrix combination), the commands and actions each runs, the commands those run in turn (package scripts, Deno tasks, Composer scripts, Make targets, pre-commit hooks), what the coverage tools CI runs measure, and what could not be read (see [docs/architecture.md](docs/architecture.md)) | | `--answers` | print the answers to every question about the project as JSON, per language in each unit of the project: each `yes`, `no`, `unknown` (something that could answer it was not read) or `impossible` (no known tool provides it for the language), with what shows it (the tools CI runs and the files that define them, the coverage at each granularity, the settings met, the platforms, the manifests and lockfiles, …) and what the known tools could do | | `--only CHECKS` / `--skip CHECKS` | comma separated check names to run / not run | -| `--format text\|json\|markdown` | output format; `json` gives each check's result and, in `places`, its result for each ecosystem in each unit (status, message, details, the tools that ran, what `--auxiliary` named); `markdown` lays those places out as a grid of checks against ecosystems, for a CI job summary (and says so when no ecosystem was recognised) | -| `--score` | also score the project's tooling (a preview, [docs/score.md](docs/score.md)): its **level** (a gated tech tree: foundations, analysis, hardening, excellence), **completeness** (covered cells over applicable ones, averaged across units; auxiliary code weighs half) and **depth** (each tool in a covered cell by its rank), and the next steps that raise them most. Text and markdown end with the summary and the top five next steps; JSON becomes `{"results": [...], "score": {...}}`. The statuses and the exit code do not change | +| `--format text\|json\|markdown\|html` | output format; `text` is the console report on a terminal with rich, plain text otherwise; `html` prints the HTML report; `json` gives each check's result and, in `places`, its result for each ecosystem in each unit (status, message, details, the tools that ran, what `--auxiliary` named); `markdown` lays those places out as a grid of checks against ecosystems, for a CI job summary (and says so when no ecosystem was recognised) | +| `--score` | also print the tooling score ([docs/score.md](docs/score.md)) in the plain text, markdown and JSON outputs (the console and HTML reports always show it): **100% means every quality gate that applies to each part of the project is in place**, with extra credit above it for complementary tools once every gate is; its **level** (Foundations, Analysis, Hardening, Complete); and the next steps worth the most. JSON becomes `{"results": [...], "score": {...}}`. The statuses and the exit code do not change | +| `--html FILE` | also write the self-contained HTML report to `FILE`, whatever `--format` prints | +| `-v`, `--verbose` | in the console report, show every detail, the checks that do not apply, and each stage of the reading | +| `--explain CHECK` | explain a check: what it looks for, why it matters, the level it counts for, and the tools it recognises for each language | +| `--tui` | browse the analysis in the terminal (needs textual) | | `--color auto\|always\|never` | color the text output (needs rich); `auto` colors only on a terminal when `NO_COLOR` is unset | | `--exclude DIR` | leave `DIR`, relative to the project, out of the validation (e.g. test fixtures); may be repeated | | `--build` | configure and build the project in a temporary directory and ask `ctest` for its tests; a build that cannot run makes whether there are tests unknown | | `--strict` | treat warnings as failures | -| `--auxiliary WHAT` | judge this code as auxiliary, not the product's: by role (`tooling`, `docs`, `example`, `benchmark`, `test`), by language or ecosystem (`python`, `c/c++`), or by directory (`scripts/`); may be repeated. Every check still judges it in full, but its failures are warnings, labelled `(auxiliary: tooling)` and saying in a detail what named the code. Without it, every source outside vendored directories is the product's: a C++ project's `scripts/release.py` makes Python one of its languages, held to every check | +| `--auxiliary WHAT` | judge this code as auxiliary, not the product's: by role (`tooling`, `docs`, `example`, `benchmark`, `test`), by language or ecosystem (`python`, `c++`), or by directory (`scripts/`); may be repeated. Every check still judges it in full, but its failures are warnings, labelled `(auxiliary: tooling)` and saying in a detail what named the code. Without it, every source outside vendored directories is the product's: a C++ project's `scripts/release.py` makes Python one of its languages, held to every check | | `--max-file-size MIB` | committed files larger than this belong in Git LFS or DVC (default: 5) | | `--allow-official-tags` | let the actions GitHub publishes (`actions/`, `github/`) be pinned to tags | | `--allow-unknown` | judge by what could be read when an answer depends on CI configuration that could not be (a provider scanned heuristically, a matrix computed by an expression, a reusable workflow in another repository). Without it, such an answer is an `ERROR`: a gap in the validator's tooling, not a finding about the project | @@ -80,17 +102,17 @@ Every language is judged in each unit (build root or workspace member) of the pr | `coverage` | A coverage tool CI runs measures branch coverage, or the finest coverage any known tool can measure for the language when none measures branches. The result says how far CI takes it: measured, reported (a report shows the numbers; an upload to Codecov or Coveralls counts) or gated (CI fails under a threshold; a Codecov status target counts), and suggests the next rung. Path or MC/DC coverage is a bonus. A setting counts when CI runs the tool that reads it | | `platform-matrix` | CI covers at least 2 operating systems, 2 toolchains (compilers, or the ecosystem's language versions) and 3 OS/toolchain combinations; for SQL, 2 database engine versions (the service containers CI runs: `postgres:16`), whatever the OS | | `ci-build-types` | every OS/toolchain combination in CI builds Debug and Release, each with and without sanitizers | -| `sanitizers` | sanitizers are used in some configuration: for C/C++, AddressSanitizer and UndefinedBehaviorSanitizer (`-fsanitize=address,undefined`, MSVC's `/fsanitize=address`, cmake_template's `ENABLE_SANITIZER_*` options, Meson's `b_sanitize`), warning when only one of the two is; for Rust, `cargo miri test` or a nightly `-Zsanitizer` build; for Go, `go test -race` (the race detector; `-asan` and `-msan` count too). Fails when none is used; `ci-build-types` asks that each platform builds with and without them | +| `sanitizers` | sanitizers are used in some configuration: for C and C++, AddressSanitizer and UndefinedBehaviorSanitizer (`-fsanitize=address,undefined`, MSVC's `/fsanitize=address`, cmake_template's `ENABLE_SANITIZER_*` options, Meson's `b_sanitize`), warning when only one of the two is; for Rust, `cargo miri test` or a nightly `-Zsanitizer` build; for Go, `go test -race` (the race detector; `-asan` and `-msan` count too). Fails when none is used; `ci-build-types` asks that each platform builds with and without them | | `compiler-warnings` | a strict warning set is enabled. Warns listing what is missing | | `warnings-as-errors` | warnings fail the build, the lint or the tests | -| `cxx-extensions` | compiler extensions to the language standard are turned off, so `-std=c++NN` is used rather than `-std=gnu++NN` (for Fortran, `-std=f2018` rather than the GNU dialect) | +| `compiler-extensions` | compiler extensions to the language standard are turned off, so `-std=c++NN` (C: `-std=cNN`) is used rather than `-std=gnu++NN` (`-std=gnuNN`); for Fortran, `-std=f2018` rather than the GNU dialect. `cxx-extensions`, its old name, still selects it | | `out-of-source-build` | the build prevents in-source builds: a CMake file compares `CMAKE_SOURCE_DIR` with `CMAKE_BINARY_DIR` (and stops with `message(FATAL_ERROR)` when they are equal), or sets `CMAKE_DISABLE_IN_SOURCE_BUILD`; Meson always builds out of source. Warns otherwise | | `compile-commands` | the build exports `compile_commands.json`, so clang-based tooling (clang-tidy, clangd, IDEs) can read it: `CMAKE_EXPORT_COMPILE_COMMANDS` on in the CMake files, a preset or on the command line; Meson always writes it. Warns otherwise | | `top-level-guard` | tests and developer-only settings are conditioned on the project being built on its own (`PROJECT_IS_TOP_LEVEL`, `CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR`; Meson: `meson.is_subproject()`), so that it works as a subproject through FetchContent, CPM or `add_subdirectory`. Warns otherwise | | `hardening` | binary hardening is enabled: exploit mitigations that the build inserts into the binary (static analysis and dependency audits are judged by `security-scanning` and `dependency-audit`). Ecosystems that build no native binary are not judged. Warns listing what is missing | | `code-formatting` | CI enforces each language's formatting in each unit: a formatter run that fails on unformatted code, or one that rewrites it where the job fails on the change or commits it (a pre-commit hook, `git diff --exit-code`). Its style is defined (e.g. `.clang-format`) or the tool's own. Warns when the style is defined but CI does not enforce it | | `function-limits` | function length is limited: lizard runs with a length limit (`lizard --length 30`), or one of the ecosystem's own tools limits it | -| `static-analysis` | CI runs a static analyzer on each language in each unit (and every analyzer a language requires: clang-tidy and cppcheck for C/C++), with its checks defined where it has no defaults worth running. Warns when an analyzer is configured but does not run, or runs short; fails when none runs | +| `static-analysis` | CI runs a static analyzer on each language in each unit (and every analyzer a language requires: clang-tidy and cppcheck for C and C++), with its checks defined where it has no defaults worth running. Warns when an analyzer is configured but does not run, or runs short; fails when none runs | | `type-checking` | CI (or a pre-commit hook CI runs) runs a static type checker on each dynamically typed language in each unit. Strict mode is a bonus; without it the result suggests it. Warns when a type checker is configured but does not run; fails when none runs. Compiled languages, whose compilers check types, are not judged | | `mutation-testing` | CI runs a mutation testing tool on each language in each unit (mutmut, cosmic-ray, Mull, cargo-mutants, gremlins, StrykerJS, PIT, Stryker.NET, Infection, mutant, Muter); running it on a pull request's changes only is a bonus (heuristic: the mutant names are taken as the pull request's changes). Warns when a tool is configured but does not run, or when none is found | | `action-pinning` | every action and reusable workflow CI uses from another repository is pinned to a full commit SHA (`actions/checkout@ # v4.2.2`), and every `docker://` image to a digest. Fails when one is pinned to a branch or not at all; warns when one is pinned to a tag or an abbreviated commit (`--allow-official-tags` accepts tags for `actions/` and `github/`). Skipped without GitHub Actions | @@ -137,7 +159,7 @@ Known limitations: values unknown. - Evidence is found by scanning text, so every file under the project is considered; use `--exclude` to leave out test fixtures or vendored code. -- A CI job that names no compiler counts as a C/C++ build with its runner's default compiler, +- A CI job that names no compiler counts as a C or C++ build with its runner's default compiler, unless it only runs another ecosystem's tools (e.g. pytest, but no CMake, Meson or compiler). ## Writing a Plugin @@ -302,7 +324,8 @@ with as little setup as possible. To keep it that way: | Dependency | Kind | Why | |---|---| | [PyYAML](https://pyyaml.org/) `>=6.0` | required | The standard library has no YAML parser, and CI configuration is YAML. PyYAML is mature, MIT licensed, has no dependencies, and is packaged by every major distro (`python3-yaml` on Ubuntu). It is required rather than optional because scanning CI files as text cannot tell which compiler runs on which OS, nor apply a matrix's `include`/`exclude`, so it over-counts platform combinations and can pass `platform-matrix` for a project that should fail. Without PyYAML the validator exits with an error that says how to install it. | -| [rich](https://github.com/Textualize/rich) `>=13.0` | optional (`pretty` extra) | Colored, aligned text output with a per-status summary. MIT licensed and widely used. Without it the validator prints plain text and says so. | +| [rich](https://github.com/Textualize/rich) `>=13.0` | optional (`pretty`, `tui` and `all` extras) | The console report: colour, tables, progress while the project is read. MIT licensed and widely used. Without it the validator prints plain text and says so. | +| [textual](https://github.com/Textualize/textual) `>=1.0` | optional (`tui` and `all` extras) | The TUI (`--tui`), built on rich by its authors. MIT licensed. Without it `--tui` says how to install it. | | [coverage.py](https://coverage.readthedocs.io/) `>=7.10` | development only (`coverage` extra) | Measures the branch coverage of the test suite; the standard library's `trace` module does not measure branches. coverage.py is the de facto Python coverage tool, Apache 2.0 licensed and has no required dependencies. The validator itself never imports it. | | [ruff](https://docs.astral.sh/ruff/), [mypy](https://mypy-lang.org/), [lizard](https://github.com/terryyin/lizard), [jscpd](https://github.com/kucherenko/jscpd), [mutmut](https://mutmut.readthedocs.io/), [pytest](https://docs.pytest.org/), [atheris](https://github.com/google/atheris) | CI only | The lint, typing, function-limits and copy-paste-detection quality gates, the mutation-testing gate (mutmut needs pytest to run the suite) and atheris, the fuzz-testing gate. They are installed by their CI jobs and are never imported by the validator. | diff --git a/corpus/projects.toml b/corpus/projects.toml index f042c7da..7b2c1ba2 100644 --- a/corpus/projects.toml +++ b/corpus/projects.toml @@ -54,73 +54,73 @@ issues = [182, 188] [[project]] name = "fmtlib/fmt" commit = "4229eb5820af49bf797641168624c8a754a1a4eb" -ecosystems = ["C/C++"] +ecosystems = ["C", "C++"] issues = [182, 282] [[project]] name = "cpp-best-practices/cmake_template" commit = "b86318abbf55a657a11a0cf2acce69f221841b22" -ecosystems = ["C/C++"] +ecosystems = ["C++"] issues = [182, 282] [[project]] name = "simdjson/simdjson" commit = "449f38e6377992798220c513f58740632355de52" -ecosystems = ["C/C++"] +ecosystems = ["C++"] issues = [182, 183] [[project]] name = "bus1/dbus-broker" commit = "2956b5d381deeea709c53d02f10e799e50e44f4b" -ecosystems = ["C/C++"] +ecosystems = ["C"] issues = [182, 186, 196, 282] [[project]] name = "nlohmann/json" commit = "81888ff9f005c022e60f2de572327b2e50222222" -ecosystems = ["C/C++"] +ecosystems = ["C++"] issues = [182, 183, 207, 282] [[project]] name = "catchorg/Catch2" commit = "5cf5dec9f5a119a08d3ee061d260ccc525093a75" -ecosystems = ["C/C++"] +ecosystems = ["C++"] issues = [207, 282] [[project]] name = "google/googletest" commit = "e882c36410197464e3429546e6a7d5e217bde51e" -ecosystems = ["C/C++"] +ecosystems = ["C++"] issues = [182, 207, 211] [[project]] name = "uber/h3" commit = "15920096d4a165729c01f749e2bd97334b009519" -ecosystems = ["C/C++"] +ecosystems = ["C"] issues = [182] [[project]] name = "GNOME/glib" commit = "a6457d849e45b9a1a9473c61364ee6e56894774b" -ecosystems = ["C/C++"] +ecosystems = ["C", "C++"] issues = [182, 215, 282] [[project]] name = "neovim/neovim" commit = "49b853fb327f5f6b5c1bdb38d2e3b8026a4124eb" -ecosystems = ["C/C++", "Lua"] +ecosystems = ["C", "Lua"] issues = [182, 282] [[project]] name = "ggml-org/llama.cpp" commit = "9d25e0014c4b4b316873c01f4938c0e3c687287d" -ecosystems = ["C/C++", "Python"] +ecosystems = ["C", "C++", "Python"] issues = [181, 224] [[project]] name = "glfw/glfw" commit = "92dcf4ce74f2e2554a98fea09be7c705c17daa5a" -ecosystems = ["C/C++"] +ecosystems = ["C"] issues = [223, 282] [[project]] @@ -419,46 +419,46 @@ ecosystems = ["Haskell"] [[project]] name = "fastify/fastify" commit = "7e0c8febb2a1ba4d55309cdc2ccd51694eca46d3" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] issues = [182, 280] [[project]] name = "sindresorhus/got" commit = "6b5aafc1cd538998728be6f45c65b0f80bae01b2" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] [[project]] name = "axios/axios" commit = "4ee8d46fc463770b8f5da718d5449a5b027b2c08" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] [[project]] name = "prettier/prettier" commit = "f391bf3e7ee219bcfeb61b06555ee1ac8e9c0680" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] issues = [182] [[project]] name = "vitejs/vite" commit = "f898888222297aa56d6fc281c585d4d4e4d51f58" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] issues = [182, 184, 248, 280] [[project]] name = "expressjs/express" commit = "43fca52d28a422c8be48fd489cbd4f2d6152bab6" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript"] [[project]] name = "colinhacks/zod" commit = "fef16cba0cf6668eb25ecc32fdfe2ce0a46f6f80" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] issues = [182, 188] [[project]] name = "denoland/std" commit = "f834d0223364361169314833e3c7a8f62ce11d58" -ecosystems = ["JavaScript/TypeScript"] +ecosystems = ["JavaScript", "TypeScript"] issues = [182] [[project]] @@ -1119,7 +1119,7 @@ ecosystems = ["SQL"] [[project]] name = "pgvector/pgvector" commit = "28dbea6e645f576461eb2343541a7e1fa712dabf" -ecosystems = ["SQL", "C/C++"] +ecosystems = ["SQL", "C"] issues = [276] [[project]] diff --git a/docs/architecture.md b/docs/architecture.md index 6173eb17..2e1418a9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -18,7 +18,7 @@ This document describes the design as it is. How the code got here, one pull req Before this design, each language profile supplied a typed rule to each practice: the regular expressions that recognised its tools, where to look for them, and what counted as passing. Detection and requirements were mixed in one object, so adding a language touched about 25 shared files and the snapshot of every other fixture; knowledge -that was not about one language had to live in one (CMake in the C/C++ profile, although it also builds Fortran; +that was not about one language had to live in one (CMake in the C and C++ profile, although it also builds Fortran; gcov, lizard and the sanitizers copied per profile); and a profile that could not meet a requirement (Go has no branch coverage) needed a special case in the profile and in the tests. @@ -163,7 +163,7 @@ below one, `src/test/resources`): `product`, `test`, data file there is noted, not parsed), or `vendored` (below a vendor directory anywhere, or a minified bundle). A role names code; it judges none: every source outside vendored directories is the product's, whatever its role, and adds its language to its unit. `--auxiliary` dials that back (`project_validator/facts/auxiliary.py`): what it -names, by role (`tooling`), by language or ecosystem (`python`, `c/c++`) or by directory (`scripts/`), is recorded as +names, by role (`tooling`), by language or ecosystem (`python`, `c++`) or by directory (`scripts/`), is recorded as a fact (`AuxiliaryCode`) and resolved once per project (`selectors`). Code it names adds no language to its unit; a language only such code is written in is still judged by every practice, in the units that code is in, but the judging layer makes its failures warnings that say so and name the dial, and labels them `(auxiliary: tooling)`. @@ -220,7 +220,7 @@ build system registers for a test runner) applies to the units at or below its d Build-wired tools are claims on the build: CMake's `CMAKE__CLANG_TIDY`, JVM analyzers bound to a build's verification, .NET analyzer packages, SwiftLint's build tool plugin, a restore with `NuGetAuditMode`. Probes -(`Probe`) run the project's own tools when asked (`--build`): the C/C++ profile builds the project and counts what +(`Probe`) run the project's own tools when asked (`--build`): the C and C++ profiles build the project and count what ctest lists. Shared tools (`project_validator/tools`) serve every language whose files they read: gcov, gcovr, lcov and llvm-cov @@ -311,6 +311,18 @@ support matrix is not committed (a generated file would be, against `committed-a changes it): the `pages` workflow renders it, the README and the pages under docs/ to HTML (`tests/build_site.py`) and publishes them to GitHub Pages from `main` on every push. +### Views + +Every output renders one `Analysis` (`project_validator/analysis.py`): the project, the structure, the facts, each +check's report, the score, the extraction stages with how long each took and what it found, the code in each role, +and the git checkout the project is in. `analyse` extracts the facts first, then runs the checks, and tells the +context's observers what it does (`Progress`: a stage or a check, starting or done), so the console and the TUI can +show it while it works. The views are in `project_validator/views`: plain text, the console (rich), the HTML report +(one self-contained file, its stylesheet and scripts in `views/assets`, shared with the documentation site and the +leaderboard) and the TUI (textual, imported only when installed). What they share, how a place is named, how the +checks are grouped by category, what was detected in words, is in `views/common.py`, so that every view says the same +thing. Why each check matters, and its category, is in `project_validator/explanations.py`, which `--explain` prints. + ### Worked example: branch coverage in this repository 1. The GitHub Actions extractor records the job `coverage` and its command @@ -336,6 +348,15 @@ are named after its module, and the ecosystem contract (`tests/test_ecosystem_co profile has them and that its well-configured fixture passes every check that applies to it. `python -m project_validator.scaffold` starts one with everything the contract asks for. +Separate languages that share their build systems and tools are separate profiles of one **family** +(`Ecosystem.family`): C and C++ (what they share is the `project_validator/c_family` package, each judged by its own +flags: `CMAKE_CXX_FLAGS` does not count for C), JavaScript and TypeScript (TypeScript uses the JavaScript profile's +platform and tools, and adds type checking). A build file that declares a language of a family (CMake's default +`project()` languages, package.json's `main`) adds it only where no source of the family says otherwise; a header +claimed by several of a family (`.h`) is the language of most sources below its nearest directory that has any; and +a family's tool configuration (`eslint.config.js`) is no source of its language where the family's other languages +have sources. + A plugin (`--plugin-dir`) is a directory of modules read the same way: its ecosystems are registered (an ecosystem may not claim another one's build file or source suffix), and its components are found beside the built-in ones. diff --git a/docs/design/2026-11-19-reporting-and-languages.md b/docs/design/2026-11-19-reporting-and-languages.md new file mode 100644 index 00000000..e5b97cb6 --- /dev/null +++ b/docs/design/2026-11-19-reporting-and-languages.md @@ -0,0 +1,189 @@ +# Reporting, scoring and languages: analysis and design + +Status: working design for the `ux` branch, 2026-11-19. Upstream main at 63d182b (#80, #81 and #309 merged). + +## Why + +The validator knows a great deal about a project: which ecosystems it found and why, its units, the code in each role, +its CI jobs and what each runs, and about 1,500 facts on a mid-size C++ project. Almost none of it reaches the reader. +The report is a flat list of check lines, the score is three numbers nobody can explain, the facts are a JSON dump, +and the site is plain Markdown pages. This design is about making all of that visible, explained and pleasant to +read, in the terminal, in a browser, and on the project site. + +Two language changes come with it, because they change what every report shows: C and C++ become separate languages, +and so do JavaScript and TypeScript. + +## Analysis of what there is today + +Measured on `cpp-best-practices/cmake_template` (a well-tooled C++ template) and `spf13/cobra`. + +### Scoring (preview v0) + +1. **Three numbers, none of them a "100%".** "Level 1 · 76% complete · 100 depth" doesn't say how far from done the + project is, or what done means. Depth is an unbounded number nobody can interpret. +2. **One incidental file decides the level.** cmake_template is held at level 1 by its devcontainer's Dockerfile, + which has no hadolint. Its C++ tooling (clang-tidy, cppcheck, CodeQL, sanitizers, fuzzing, six-way matrix) is + level-3 material. +3. **Test, example and script code must carry every gate**, fuzzing and mutation testing included, so 100% is out of + reach for any project with a `tests/` directory judged as auxiliary. +4. **Extra tools are rewarded by the validator's catalogue**, not by what makes a project stronger: two formatters or + two coverage tools earn depth. +5. **`status-badges` is scored**, though it's cosmetic. +6. **Next steps read as jargon**: "+1.0% completeness, toward Level 2". + +### The terminal report + +1. **Nothing says what was detected.** The ecosystems, the signals that recognised them, the units and their roles, + the vendored code, the CI providers and jobs: all of it exists (`--map`) but only as JSON, and the default report + never mentions it. The reader can't tell why "Docker" is judged at all. +2. **Detected roles are invisible.** The validator knows `tests/`, `examples/` and `scripts/` are test, example and + tooling code, but says nothing until the user happens to pass `--auxiliary`. +3. **Silence while it works.** No progress during extraction; a large repository just hangs for seconds. +4. **Noise.** Twelve `[SKIP] …: not applicable to C, C++` lines; `platform-matrix` prints 40 detail lines, half of + them duplicates; several checks pack two ecosystems into one line ("C/C++: …; Docker: …"). +5. **No why.** A check name and a message, never why the practice matters or how to fix it beyond a hint. +6. **The markdown grid lists rows that apply nowhere** (`link-check`, `migration-safety` all "—"). + +### Facts + +1. Browsable only as a 1,500-element JSON array, with no grouping, no descriptions and no links to the files. +2. One fact kind is named by its description ("libFuzzer or AFL++ fuzz targets (…)"), not a class name. + +### The site + +The docs site and the leaderboard are rendered Markdown with a dozen lines of CSS: no dark mode, plain tables, the +support matrix a 44-column wall, the leaderboard a bare table. + +### Languages + +1. **C/C++ is one ecosystem.** C and C++ are different languages with different warnings, standards, extensions, + idioms and tooling defaults. One column hides a project that sets `-Wall -Wextra` for its C++ and nothing for its C. + It also means every CMake project is both C and C++, because CMake's `project()` defaults to both. +2. **JavaScript/TypeScript is one ecosystem.** Type checking is the defining gate of TypeScript (`tsc --noEmit`, + `strict`) and not a norm of JavaScript, so one column either asks JavaScript projects for type checking or lets + TypeScript projects off it. + +## Decisions + +### C and C++ are separate ecosystems + +- Two ecosystems, **C** and **C++**, sharing their build systems (CMake, Meson), compiler and CI knowledge. +- A language is a unit's when it has its sources. A build file alone no longer makes a project both: CMake's + `project()` defaults say nothing about the code. +- `.h` (and `.inc`) headers belong to C++ in a unit with C++ sources, otherwise to C. A unit of headers only (a + header-only library with `.h` files) is C unless something says C++ (`LANGUAGES CXX`, `cpp_std`, C++ standard + flags). +- Flags are attributed per language: `CMAKE_C_FLAGS` and `$` to C, the `CXX` forms to C++, and + unqualified flags (`add_compile_options`, `target_compile_options`, Meson's `warning_level`) to both. +- `cxx-extensions` applies to C++ only. Every other C/C++ check applies to both, judged separately. +- Docs: `docs/ecosystems/c.md` and `cpp.md`. The leaderboard's C/C++ seed moves to its language, and the other + language gets a seed. + +### JavaScript and TypeScript are separate ecosystems + +Different concerns, so yes: +- **TypeScript**: `.ts`, `.tsx`, `.mts`, `.cts`, `.d.ts`, or a `tsconfig.json`. Type checking applies (tsc, vue-tsc, + or a bundler's type check). +- **JavaScript**: `.js`, `.jsx`, `.mjs`, `.cjs`. Type checking doesn't apply: it isn't the ecosystem's norm. +- Both share package.json reading, package managers, test runners, ESLint, Prettier, Biome and dependency audit. +- A TypeScript project's JavaScript tooling configuration (`*.config.js`, `.eslintrc.js`, `gulpfile.js`) doesn't + make it a JavaScript project. Those files are configuration, not sources. +- The leaderboard's seed (Compiler Explorer) is TypeScript; JavaScript gets a seed. + +### Score v1: 100% means every applicable gate is in place + +The design proposed on #295 after the preview: + +- **Slots.** One per gate that applies, per language, per unit, plus the project-wide gates once. +- **Fill.** Pass 1, warn ½, fail and error 0, skip not a slot. Auxiliary slots weigh ½. +- **Auxiliary code carries fewer gates.** Formatting, static analysis, type checking, compiler warnings, warnings as + errors, tests run, VCS hygiene and committed artifacts apply; coverage, fuzzing, mutation, sanitizers, hardening, + dependency audit and platform matrix don't. +- **Pooled, not averaged.** `base = 100 × filled ÷ slots`. A one-gate data folder weighs one slot. +- **Extra credit, only where tools complement each other:** static analysis, security scanning, dependency audit, + fuzzing, sanitizers, type checking, compiler warnings (more compilers). The second distinct tool earns +¼ of a + slot, the third +⅒; tools of one family (ruff and flake8; golangci-lint and its bundled linters) count once. +- **Held until 100%.** `score = base` below 100, `100 + extra` once every slot is filled; the held extra credit is + shown. +- `status-badges` is reported but not scored. +- **Levels stay, as milestones**: 1 Foundations, 2 Analysis, 3 Hardening, 4 Complete (= 100%). Same gating rule as + v0, auxiliary slots excluded from levels 1 to 3. +- **Next steps in plain words**: "Run fuzz tests in CI (C++, root): +4 points, needed for Analysis". + +### One analysis, many views + +All output comes from one `Analysis` value: the project, the structure (map), the facts, the reports, the score, the +options, the timings and the validator's version. Every renderer takes it: + +| View | How | Needs | +|---|---|---| +| plain text | default without a terminal or rich | nothing | +| console | default in a terminal with rich | `[pretty]`: rich | +| markdown | `--format markdown` | nothing | +| JSON | `--format json` | nothing | +| HTML report | `--format html`, or `--html FILE` beside any format | nothing | +| TUI | `--tui` | `[tui]`: textual | + +Extraction reports progress through an observer: each stage starting and finishing, with what it found. The console +shows it live on stderr; the TUI shows it on its loading screen. + +### The console report + +In order: +1. **Header**: project, path, commit if it's a git checkout. +2. **Detected**: each ecosystem with the signals that recognised it; the units (directory, role, languages, build + systems); code in each detected role, with the `--auxiliary` flag that would judge it as auxiliary; vendored and + unrecognised files; CI providers and job count. And how it was read: each extraction stage with its counts. +3. **Results**, grouped by level (Foundations, Analysis, Hardening, then Hygiene and Project). One line per check, + then one line per language when they differ. Details deduplicated and capped (`--verbose` shows all). Skipped and + inapplicable checks are counted, not listed (`--verbose` lists them). +4. **Score**: a bar to 100%, the milestone, the slots filled, held extra credit, and the top next steps. + +`--explain CHECK` prints what a check looks for, why it matters, what passes, and the tools it recognises per +language. Each check gains a `rationale`: one or two sentences on why the practice matters. + +Plain text keeps its `[STATUS] check: message` lines (greppable in CI logs), gains the Detected section, and +deduplicates details. + +### The HTML report + +One self-contained file: inline CSS and JavaScript, no network, light and dark themes, printable. +- **Summary**: a score ring, the milestone, status counts, the top next steps. +- **Detected project**: ecosystems and their signals, units, roles, vendored code, CI jobs with OS, compilers and + configurations, and how it was read. +- **Results matrix**: checks by language, colour-coded, each cell linking to its finding. +- **Findings**: each check's result per place, with details, the hint, the rationale and the tools. +- **Facts browser**: every fact, filterable by kind and searchable, grouped by kind with each kind's description, and + each origin linking to the file on GitHub when the remote is known. +- **Run**: validator version, options, timings. + +### The TUI + +`--tui` (textual): a tree on the left (Overview, Detected, Units, Results by status, Score, Facts by kind), detail on +the right, `/` to search, `q` to quit. It shows extraction progress while it loads. + +### The site + +One design system, shared by the HTML report, the docs site and the leaderboard: a stylesheet in the package, with +light and dark themes and a header with navigation. +- **Docs site**: styled pages; the support matrix with sticky headers, coloured cells and a language filter. +- **Leaderboard**: score bars, milestone chips, per-language tabs and sparklines. Each project page links its full + nightly HTML report, which the nightly job now writes. + +### Optional dependencies + +`[pretty]` = rich, `[tui]` = textual (and rich), `[all]` = both. The HTML report needs nothing. CI's test and coverage +requirements install both, so their code is tested and covered; the tests without them still run. + +## Order of work + +1. C and C++ split. +2. JavaScript and TypeScript split. +3. Score v1. +4. The `Analysis` model, progress events, check rationales, `--explain`. +5. The console report (rich) and plain text improvements. +6. The HTML report. +7. The TUI. +8. The site and leaderboard redesign, with nightly HTML reports. + +Each step is test-first, with every gate green, committed separately. diff --git a/docs/ecosystems/c.md b/docs/ecosystems/c.md new file mode 100644 index 00000000..8702f3a8 --- /dev/null +++ b/docs/ecosystems/c.md @@ -0,0 +1,141 @@ +# C + +Recognised by `.c` sources, and by CMake (`CMakeLists.txt`) or Meson (`meson.build`). A project is judged by the rules +of the build system it uses; one using neither is judged as a CMake project. + +C and [C++](cpp.md) are separate languages, judged separately: a project with sources in both is judged once for each, +each by its own flags (`CMAKE_C_FLAGS` and `$` for C; flags for every language count for both). A +`.h` or `.inc` header is the language of most sources below its nearest directory that has any, so headers beside C +sources are C; a project of headers alone is C unless its build says C++ (`project(lib CXX)`). CMake's `project()` +enables C and C++ unless told otherwise, which says nothing about the code: once there are C sources, a CMake file +does not make the project a C++ one too. + +## `tests-run` + +With CMake: `enable_testing()` or `include(CTest)` is called, tests are registered (`add_test`, `*_discover_tests`, +...) and CI runs `ctest` (or `cmake --build … --target test`, or `cmake --workflow`); with `--build`, the project is +really configured and built, and `ctest` must list at least one test (a build that cannot run is unknown). With Meson: +`test()` is called in a `meson.build` and CI runs `meson test` (or ninja's `test` target). + +## `fuzz-testing` + +libFuzzer targets (files defining `LLVMFuzzerTestOneInput`) and AFL++ targets (`__AFL_LOOP`), run by a CI step that +passes a libFuzzer option to a binary (`./fuzz_tester -max_total_time=30`, a heuristic), by `afl-fuzz` (whose target, the words +after `--`, is not a `dotnet` program or a `.dll`), or by `ctest` when a CMake `add_test` passes a libFuzzer option to +its command (a test that only replays crash files does not count). The `ctest` command's `-R`/`-L` and `-E`/`-LE` +regexes are matched against the test's name. This is a heuristic: a fuzz test registered behind an option CI does not +turn on (`if(ENABLE_FUZZING)`) is still counted, and the run is credited to the CMake files' unit. RapidCheck tests alone warn: they are property-based tests, not +fuzz targets. + +## `coverage` + +A coverage tool CI runs, reporting branches: gcovr with any report but the default text one (`--xml`, `--html`, +`--json`, `--sonarqube`, `--print-summary`, `--txt-metric branch`, also in `gcovr.cfg`), lcov or genhtml with +`branch_coverage=1` (also in `.lcovrc`), `gcov -b`, or `llvm-cov report`, `export` or `show -show-branches`. Path or +MC/DC coverage is a bonus: gcov `--conditions` or `--prime-paths`, lcov `--mcdc-coverage`, `llvm-cov show -show-mcdc`, +or the instrumentation `-fcondition-coverage`, `-fpath-coverage` or `-fcoverage-mcdc` on a command line, in an +environment variable, or in the CMake files a CI `cmake` configuration reads (matched in their text). + +## `platform-matrix` + +The toolchains are compilers. A CI job that names no compiler counts with its runner's default compiler (gcc on Linux, +AppleClang on macOS, MSVC on Windows), unless it only runs another ecosystem's tools. + +## `ci-build-types` + +Every OS/compiler combination builds Debug and Release, each with and without sanitizers. + +## `sanitizers` + +AddressSanitizer and UndefinedBehaviorSanitizer are used in some configuration, whatever the compiler: +`-fsanitize=address,undefined` (MSVC's `/fsanitize=address`) among the build files' options or on a CI command line, +cmake_template's `ENABLE_SANITIZER_ADDRESS` and `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR` options (with or without the +project's prefix) on by default or turned on by CI, or Meson's `b_sanitize`. One of the two warns; neither fails. +ThreadSanitizer and MemorySanitizer are not asked, since they exclude the other two in one build. + +## `compiler-warnings` + +`-Wall -Wextra -Wpedantic -Wshadow -Wconversion`, plus `/W4` and `/permissive-` when MSVC is in CI. + +## `warnings-as-errors` + +`-Werror`, `/WX` or `COMPILE_WARNING_AS_ERROR` (Meson: `werror=true`) is enabled in at least one configuration. + +## `compiler-extensions` + +`CMAKE_C_EXTENSIONS` is turned off, or with Meson `c_std` names a standard such as `c17` rather than `gnu17`, so +`-std=cNN` is used rather than `-std=gnuNN`. The check was called `compiler-extensions`, which still selects it. + +## `out-of-source-build` + +In-source builds are prevented: a CMake file compares `CMAKE_SOURCE_DIR` (or `PROJECT_SOURCE_DIR`) with the binary +directory and stops with `message(FATAL_ERROR)` when they are equal, as cmake_template's `PreventInSourceBuilds.cmake` +does, or sets `CMAKE_DISABLE_IN_SOURCE_BUILD` or `CMAKE_DISABLE_SOURCE_CHANGES`. Meson refuses in-source builds itself, +so a Meson project passes. Warns otherwise. + +## `compile-commands` + +`compile_commands.json` is exported, so clang-tidy, clangd and IDEs can read the build: `CMAKE_EXPORT_COMPILE_COMMANDS` +on in the CMake files, in a preset or on the command line (`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`). Meson always writes +it, so a Meson project passes. Warns otherwise. + +## `top-level-guard` + +Tests and developer-only settings are conditioned on the project being built on its own, so that it works as a +subproject through FetchContent, CPM or `add_subdirectory`: an `if()` on `PROJECT_IS_TOP_LEVEL` (or +`_IS_TOP_LEVEL`, or the older `CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR`), a `cmake_dependent_option` +depending on it, or with Meson an `if` on `meson.is_subproject()`. The validator sees what the project guards on, not +yet what it guards. Warns otherwise. + +## `hardening` + +`_FORTIFY_SOURCE`, `-fstack-protector-strong`, `-fcf-protection` and `-fstack-clash-protection` (or GCC's +`-fhardened`), plus `/sdl /guard:cf /DYNAMICBASE /CETCOMPAT` when MSVC is in CI. The C++ standard library's assertions +(`_GLIBCXX_ASSERTIONS`, `_LIBCPP_HARDENING_MODE`) are not asked of C. Warns listing what is missing. + +## `mutation-testing` + +Mull (`mull-runner` or `mull-cxx`, settings in `mull.yml`; a build with its compiler plugin only embeds the mutants, +so it is not a run) or dextool (`dextool mutate`, settings in `.dextool_mutate.toml`). No changes-only mode is +recognised for either. + +## `code-formatting` + +The style is defined in a `.clang-format` (or `_clang-format`), at or above the code, and CI checks it: +`clang-format --dry-run -Werror` (or `-n --Werror`, also through `xargs`), `git clang-format --diff`, run-clang-format, +the `DoozyX/clang-format-lint-action` or `jidicula/clang-format-action` action, or the clang-format pre-commit hook +when CI runs pre-commit. `clang-format -i` enforces it only where the job then fails on a change +(`git diff --exit-code`) or commits it. + +## `security-scanning` + +No security lints of its own here: CodeQL, GitLab SAST or semgrep in CI. + +## `function-limits` + +lizard runs in CI with a length limit (`-L`, `--length`, `-T length=` or `-T nloc=`), or clang-tidy runs (directly, +or through `CMAKE_C_CLANG_TIDY`) with a `.clang-tidy` that enables `readability-function-size` with a positive +`LineThreshold` or `StatementThreshold`. A `.clang-tidy` that sets the limit while nothing runs clang-tidy warns; one +that cannot be read makes the answer unknown. + +## `static-analysis` + +clang-tidy or cppcheck: run directly (`clang-tidy`, `run-clang-tidy`, `cppcheck`), through the +`cpp-linter/cpp-linter-action`, `ZedThree/clang-tidy-review` or `deep5050/cppcheck-action` actions, or by a build CI +configures with `CMAKE_C_CLANG_TIDY` / `CMAKE_C_CPPCHECK` (on the `cmake` command line, or in the CMake files, +target properties or presets), or a custom target CI builds (`cmake --build build --target lint`) that runs either. +clang-tidy needs its checks chosen in a `.clang-tidy`. + +## `dependency-management` + +CPM, FetchContent, vcpkg (`vcpkg.json`), Conan (`conanfile.txt` / `conanfile.py`) or Meson wraps +(`subprojects/*.wrap`). + +## `committed-artifacts` + +Object files and libraries (`*.o`, `*.obj`, `*.a`, `*.lib`, `*.so`, `*.dylib`, `*.dll`), `*.exe`, `*.pdb`, +`CMakeCache.txt`, `CMakeFiles/`, `CMakeUserPresets.json`, and a top-level `build/`, `out/` or `builddir/`. + +## `vcs-ignore` + +`build/` or `out/`. diff --git a/docs/ecosystems/clojure.md b/docs/ecosystems/clojure.md index 090b7e01..2be09e63 100644 --- a/docs/ecosystems/clojure.md +++ b/docs/ecosystems/clojure.md @@ -67,4 +67,4 @@ The same, each of those the project's build systems write; `.nrepl-port` for eve Clojure is dynamically typed (`type-checking`); lizard does not parse it (`function-limits`); `deps.edn` and `project.clj` pin every version and have no lock file (`dependency-management`); no fuzzer or mutation testing tool the validator knows runs Clojure tests; the JVM builds no debug or release configuration (`ci-build-types`, -`hardening`, `cxx-extensions`). +`hardening`, `compiler-extensions`). diff --git a/docs/ecosystems/common_lisp.md b/docs/ecosystems/common_lisp.md index 0f70ad17..ffb03357 100644 --- a/docs/ecosystems/common_lisp.md +++ b/docs/ecosystems/common_lisp.md @@ -51,4 +51,4 @@ Compiled files: SBCL's `*.fasl`, CCL's `*.lx64fsl` and `*.dx64fsl`, ECL's and CL Common Lisp has no standard formatter (`code-formatting`), and no type checker, code security scanner, dependency auditor, fuzzer or mutation testing tool the validator knows; lizard does not parse it (`function-limits`); Qlot's `qlfile.lock` is left to `dependency-management`; a Lisp image builds no debug or release configuration -(`ci-build-types`, `hardening`, `cxx-extensions`). +(`ci-build-types`, `hardening`, `compiler-extensions`). diff --git a/docs/ecosystems/c_cpp.md b/docs/ecosystems/cpp.md similarity index 86% rename from docs/ecosystems/c_cpp.md rename to docs/ecosystems/cpp.md index b3ea8266..3d34a37a 100644 --- a/docs/ecosystems/c_cpp.md +++ b/docs/ecosystems/cpp.md @@ -1,8 +1,14 @@ -# C/C++ +# C++ -Recognised by `.c`, `.cpp`, `.cc`, `.cxx`, `.hpp`, `.ixx`, `.cppm` and similar sources, and by CMake (`CMakeLists.txt`) -or Meson (`meson.build`). A project is judged by the rules of the build system it uses; one using neither is judged as -a CMake project. +Recognised by `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.hxx`, `.ixx` and `.cppm` sources, and by CMake +(`CMakeLists.txt`) or Meson (`meson.build`). A project is judged by the rules of the build system it uses; one using +neither is judged as a CMake project. + +C++ and [C](c.md) are separate languages, judged separately: a project with sources in both is judged once for each, +each by its own flags (`CMAKE_CXX_FLAGS` and `$` for C++; flags for every language count for +both). A `.h` or `.inc` header is the language of most sources below its nearest directory that has any, so headers +beside C++ sources are C++. CMake's `project()` enables C and C++ unless told otherwise, which says nothing about the +code: once there are C++ sources, a CMake file does not make the project a C one too. ## `tests-run` @@ -55,10 +61,10 @@ ThreadSanitizer and MemorySanitizer are not asked, since they exclude the other `-Werror`, `/WX` or `COMPILE_WARNING_AS_ERROR` (Meson: `werror=true`) is enabled in at least one configuration. -## `cxx-extensions` +## `compiler-extensions` -`CMAKE_CXX_EXTENSIONS` (or `CMAKE_C_EXTENSIONS` for C) is turned off, or with Meson `cpp_std` (`c_std`) names a -standard such as `c++20` rather than `gnu++20`, so `-std=c++NN` is used rather than `-std=gnu++NN`. +`CMAKE_CXX_EXTENSIONS` is turned off, or with Meson `cpp_std` names a standard such as `c++20` rather than `gnu++20`, +so `-std=c++NN` is used rather than `-std=gnu++NN`. The check was called `compiler-extensions`, which still selects it. ## `out-of-source-build` diff --git a/docs/ecosystems/emacs_lisp.md b/docs/ecosystems/emacs_lisp.md index 786a6986..d03fb9fc 100644 --- a/docs/ecosystems/emacs_lisp.md +++ b/docs/ecosystems/emacs_lisp.md @@ -49,4 +49,4 @@ The byte-compiled `*.elc` files, the generated `*-autoloads.el`, and the tools' Emacs Lisp has no standard formatter (`code-formatting`), and no type checker, code security scanner, dependency auditor, fuzzer or mutation testing tool the validator knows; lizard does not parse it (`function-limits`); a package has no lock file (`dependency-management`); byte-compilation builds no debug or release configuration -(`ci-build-types`, `hardening`, `cxx-extensions`). +(`ci-build-types`, `hardening`, `compiler-extensions`). diff --git a/docs/ecosystems/fortran.md b/docs/ecosystems/fortran.md index 7539d8da..a7c3b31e 100644 --- a/docs/ecosystems/fortran.md +++ b/docs/ecosystems/fortran.md @@ -48,7 +48,7 @@ The stack and control-flow protections GCC's back end adds: `-fstack-protector-s `-fstack-clash-protection` (or GCC 14's `-fhardened`); ifx takes the first two. `_FORTIFY_SOURCE` and the C++ library assertions are C's and C++'s. A project with no Fortran `program` outside its tests is a library, and skipped. -## `cxx-extensions` +## `compiler-extensions` Fortran compiled to a standard rather than the compiler's dialect: `-std=f2018` (or another standard, gfortran and flang), `-stand f18` (ifx, ifort), or Meson's `fortran_std`. diff --git a/docs/ecosystems/javascript.md b/docs/ecosystems/javascript.md index 153fd1de..fecce332 100644 --- a/docs/ecosystems/javascript.md +++ b/docs/ecosystems/javascript.md @@ -1,7 +1,14 @@ -# JavaScript/TypeScript +# JavaScript -Recognised by `.js`, `.ts` and related sources, `package.json` or `deno.json`. The package scripts CI runs -(`npm test`, `npm run lint`, Deno tasks) count as CI configuration. +Recognised by `.js`, `.mjs`, `.cjs` and `.jsx` sources, a `package.json` that names an entry point (`main`, `module`, +`exports`, `bin`) or `deno.json`. The package scripts CI runs (`npm test`, `npm run lint`, Deno tasks) count as CI +configuration. + +JavaScript and [TypeScript](typescript.md) are separate languages, judged separately: they share package.json, Deno, +their runtimes and their tools, but type checking is TypeScript's defining gate and not a norm of JavaScript, so +`type-checking` does not apply here. JavaScript tool configuration (`eslint.config.js`, `vite.config.mjs`, +`.prettierrc.cjs`, `gulpfile.js`) in a project with TypeScript sources is configuration, not JavaScript code, and a +package.json's `main` names the JavaScript a TypeScript package publishes, which makes it no JavaScript project. ## `tests-run` @@ -34,12 +41,6 @@ A linter runs: eslint, `biome lint` / `biome ci`, or `deno lint`. A lint warning fails CI: `eslint --max-warnings 0`, `biome ci` or `--error-on-warnings`, or `deno lint`. -## `type-checking` - -`tsc` or `vue-tsc` (JavaScript with `checkJs`), or `deno check` / `deno test`, also through the package scripts -CI runs. Strict mode is a bonus: `"strict": true` or `@tsconfig/strictest` in a `tsconfig.json`, or Deno, strict by -default. - ## `mutation-testing` StrykerJS (`stryker run`, also as `npx stryker run` or a package script; settings in `stryker.config.json`, diff --git a/docs/ecosystems/julia.md b/docs/ecosystems/julia.md index 889af2ab..05b247db 100644 --- a/docs/ecosystems/julia.md +++ b/docs/ecosystems/julia.md @@ -66,6 +66,6 @@ left to `dependency-management`. ## Not judged -Julia compiles memory-safe code (`hardening`, `cxx-extensions`, `ci-build-types`); no static analyzer besides Aqua +Julia compiles memory-safe code (`hardening`, `compiler-extensions`, `ci-build-types`); no static analyzer besides Aqua and JET, dependency auditor, function length limiter (lizard does not parse Julia), fuzzer or mutation testing tool the validator knows reads Julia. diff --git a/docs/ecosystems/perl.md b/docs/ecosystems/perl.md index cf979fcc..101ef0f4 100644 --- a/docs/ecosystems/perl.md +++ b/docs/ecosystems/perl.md @@ -64,6 +64,6 @@ only `cover_db/` ignored. ## Not judged -Perl is interpreted (`hardening`, `cxx-extensions`, `ci-build-types`) and dynamically typed (`type-checking`); no code +Perl is interpreted (`hardening`, `compiler-extensions`, `ci-build-types`) and dynamically typed (`type-checking`); no code security scanner, fuzzer or mutation testing tool the validator knows reads Perl; Carton's `cpanfile.snapshot` for applications belongs to `dependency-management`, not judged for Perl yet. diff --git a/docs/ecosystems/r.md b/docs/ecosystems/r.md index 4d42e28f..a38ec2b6 100644 --- a/docs/ecosystems/r.md +++ b/docs/ecosystems/r.md @@ -64,6 +64,6 @@ resolve them; a project whose `.Rprofile` activates renv is an analysis that com ## Not judged -R is interpreted, so `hardening`, `cxx-extensions` and `ci-build-types` do not apply, and nor does `type-checking`; +R is interpreted, so `hardening`, `compiler-extensions` and `ci-build-types` do not apply, and nor does `type-checking`; no code security scanner or dependency auditor the validator knows reads R; no fuzzer or mutation testing tool the validator knows runs R tests. diff --git a/docs/ecosystems/typescript.md b/docs/ecosystems/typescript.md new file mode 100644 index 00000000..7d0f2e1f --- /dev/null +++ b/docs/ecosystems/typescript.md @@ -0,0 +1,94 @@ +# TypeScript + +Recognised by `.ts`, `.mts`, `.cts` and `.tsx` sources (declarations, `.d.ts`, included), or `deno.json`. TypeScript +is built on JavaScript's platform: package.json and Deno, the Node.js, Deno and Bun runtimes, and the same tools, so +everything below but `type-checking` reads as it does for [JavaScript](javascript.md). The package scripts CI runs +(`npm test`, `npm run typecheck`, Deno tasks) count as CI configuration. + +JavaScript tool configuration (`eslint.config.js`, `vite.config.mjs`) in a TypeScript project is configuration, not +JavaScript code, so it does not make the project a JavaScript one too. + +## `tests-run` + +`*.test.*`, `*.spec.*`, `*_test.*`, `__tests__/` or top-level `test/` files run by jest, vitest, mocha, ava, borp, +`node --test` (or node running a runner's entry point, or the test directory), `deno test`, `bun test`, playwright +or a package script (`npm test`, `nub run test`). + +## `fuzz-testing` + +Jazzer.js fuzz targets (an exported `fuzz` function, or `it.fuzz(` tests, in `.js`, `.mjs`, `.cjs` or `.ts` files), run +by a CI step `npx jazzer ` or by `jest` with `JAZZER_FUZZ=1` set in the step or job environment. fast-check +tests alone warn: they are property-based tests, not fuzz targets. + +## `coverage` + +c8, nyc, Jest (`--coverage`, or `collectCoverage: true` in the configuration it reads, or package.json's `jest`), Vitest +(`--coverage`, or coverage `enabled: true` in the configuration it reads), `deno test --coverage` or +`node --test --experimental-test-coverage`, run by CI directly, through `npx` and the other package runners, or +through the package scripts it runs. `bun test --coverage` counts lines only. + +## `platform-matrix` + +The toolchains are Node.js, Deno or Bun versions. + +## `compiler-warnings` + +A linter runs: eslint, `biome lint` / `biome ci`, or `deno lint`. + +## `warnings-as-errors` + +A lint warning fails CI: `eslint --max-warnings 0`, `biome ci` or `--error-on-warnings`, or `deno lint`. + +## `type-checking` + +TypeScript's defining gate: `tsc` (usually `tsc --noEmit`) or `vue-tsc`, or `deno check` / `deno test`, also through +the package scripts CI runs. Strict mode is a bonus: `"strict": true` or `@tsconfig/strictest` (and the other strict +published bases) in a `tsconfig.json`, or Deno, strict by default. +## `mutation-testing` + +StrykerJS (`stryker run`, also as `npx stryker run` or a package script; settings in `stryker.config.json`, +`.js`, `.mjs` or `.cjs`, or `stryker.conf.json` or `.js`). `stryker run --incremental` counts as +running on the changes only. + +## `code-formatting` + +`prettier --check` (or `-l`; settings in a `.prettierrc*`, `prettier.config.*` or the `prettier` key of +package.json), `biome format`, `biome check` or `biome ci` (without `--write`), `deno fmt --check`, `dprint check` or +`oxfmt --check`, in CI or the package scripts and Deno tasks it runs. They have a default style, so CI enforcement +alone passes. + +## `function-limits` + +lizard runs in CI with a length limit, or eslint runs with `max-lines-per-function` on (not `"off"` or `0`) in its +configuration. The rule on while CI does not run eslint warns. + +## `static-analysis` + +eslint (or `next lint`, or xo), oxlint, `biome lint` / `check` / `ci` or `deno lint`, in CI, a pre-commit hook CI runs, +or the package scripts CI runs. + +## `security-scanning` + +eslint with `eslint-plugin-security` (or `@microsoft/eslint-plugin-sdl`) in its configuration. In CI, where the tool +runs (a setting alone, which nothing CI runs reads, does not count); CodeQL, GitLab SAST or semgrep count too. + +## `dependency-management` + +Dependencies declared in `package.json` (or `imports` in `deno.json`) are locked by a committed `package-lock.json`, +`npm-shrinkwrap.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lock`, `bun.lockb` or `deno.lock`, libraries included. + +## `dependency-audit` + +`npm audit` (not `npm audit signatures`), `pnpm audit`, `yarn npm audit` / `yarn audit` or `bun audit`. + +## `license` + +`license` in `package.json`. + +## `committed-artifacts` + +`node_modules/`, a top-level `coverage/` and `*.tsbuildinfo` (not `dist/`, which a JavaScript GitHub Action commits). + +## `vcs-ignore` + +`node_modules/`. diff --git a/docs/ecosystems/zig.md b/docs/ecosystems/zig.md index 680d2e46..3ceba151 100644 --- a/docs/ecosystems/zig.md +++ b/docs/ecosystems/zig.md @@ -59,7 +59,7 @@ lizard parses Zig, so CI runs it with a length limit. ## Not judged -Zig has no warnings (`compiler-warnings`, `warnings-as-errors`) and no standard to pick (`cxx-extensions`); it is +Zig has no warnings (`compiler-warnings`, `warnings-as-errors`) and no standard to pick (`compiler-extensions`); it is statically typed (`type-checking`); no code security scanner, dependency auditor or mutation testing tool the validator knows reads Zig; the `.hash` of every dependency in `build.zig.zon` belongs to `dependency-management`, not judged for Zig yet. diff --git a/docs/score.md b/docs/score.md index 2b326fee..d870a64a 100644 --- a/docs/score.md +++ b/docs/score.md @@ -1,82 +1,92 @@ -# The tooling score (preview) +# The tooling score -`python -m project_validator --score path/to/project` adds a score to the report. The statuses and the exit code -do not change. The score is extra output: a summary line and the top next steps in the text and markdown reports, -and a `score` object beside the results with `--format json`. The design is upstream issue #295. This is its preview, -**version 0**. It reads only what the reports already carry, so later versions will change it. +The console and HTML reports always show the score; `python -m project_validator --score path/to/project` adds it to +the plain text, markdown and JSON outputs too. The statuses and the exit code do not change. The design is upstream +issue #295; this is **version 1**. -> **Level 2 · 84% complete · 137 depth** +> **87% · Level 2 Analysis · 41 of 47 gates in place** -## Cells and tiers +## 100% means every gate is in place -A **cell** is one check's result for one ecosystem in one unit: one of the `places` in `--format json`. A check of the -whole project, such as `license` or `action-pinning`, is one **project** cell. A cell of code that `--auxiliary` -names is **auxiliary**, and every other cell is **core**. A cell that skips is not applicable. A cell that errors, for -example because something could not be read, scores nothing but stays in the maximum. Hiding something never helps. +A **slot** is one check's result for one language in one unit: one of the `places` in `--format json`. A check of the +whole project (a licence, CI, action pinning) is one slot. The score is the share of the slots that are filled: -## The three numbers +``` +percent = 100 * filled / slots +``` -**Level** is a gated tech tree. A project reaches level N when every core and project cell of the checks of levels 1 -to N passes, and each of those checks ran. A warning does not complete a level. +| Result | Fills | +|---|---| +| pass | the whole slot | +| warning (configured but not enforced, or partly in place) | half | +| fail, or error | nothing, but the slot counts: hiding something never helps | +| skip (the gate does not apply) | not a slot | + +- **Pooled.** Every slot counts the same, so a folder of data files with one gate weighs one slot, not as much as the + code with twenty. +- **Auxiliary code** (what `--auxiliary` names: tests, examples, scripts) weighs half, and is not asked for the gates + of the product alone: coverage, fuzzing, mutation testing, sanitizers, hardening, dependency audit, the platform + matrix, build types and security scanning. +- **Not scored:** `status-badges` is reported, but a README badge is not a quality gate. +- A language the validator has no tools for adds no slot for the gates it can not judge: that gap is the validator's to + fix, not the project's. + +So 100% is reachable, and means exactly that: every gate that applies to each part of the project is in place. + +## Extra credit + +Some gates find more with each tool: two static analysers, a scanner beside CodeQL, a second fuzzing engine, more +sanitizers, a second type checker. In those gates (`static-analysis`, `security-scanning`, `dependency-audit`, +`fuzz-testing`, `sanitizers`, `type-checking`, `compiler-warnings`), the second distinct tool in a slot earns a +quarter of a slot more, and the third a tenth. Tools of one family count once: ruff and flake8, or golangci-lint and +the linters it bundles. Two formatters, or two coverage tools, earn nothing: they do not make a project stronger. + +**Extra credit is held until every slot is filled.** Below 100% it is shown but not added, so passing 100% always +means every gate is in place: `100% + extra`. + +## Levels + +Levels are milestones: a project reaches level N when every core and project slot of the checks of levels 1 to N +passes, and each of those checks ran. A warning does not complete a level, and auxiliary code never holds one back. | Level | Checks | |---|---| | 1, Foundations | `ci-present`, `compiler-warnings`, `warnings-as-errors`, `code-formatting`, `tests-run`, `license`, `vcs-ignore` | | 2, Analysis | `static-analysis`, `type-checking`, `coverage`, `dependency-management`, `dependency-audit` | | 3, Hardening | `sanitizers`, `fuzz-testing`, `mutation-testing`, `security-scanning`, `action-pinning` | -| 4, Excellence | every check ran, and every applicable cell passes, auxiliary ones included | - -**Completeness** is the headline. It is covered cells over applicable cells, computed per unit and averaged across the -units. The project cells count as one more unit. A passing cell covers 1, a warning ½, anything else 0. Auxiliary cells -weigh ½. A language or unit without tooling lowers completeness, so adding code without tooling never pays. - -**Depth** is the high score for projects that are already complete. Each covered cell earns points for its tools by -their rank in the cell: - -| Rank in the cell | Core | Auxiliary | Project | -|---|---:|---:|---:| -| 1st tool | 10 | 5 | 10 | -| 2nd | 5 | 2 | 5 | -| 3rd | 2 | 1 | 2 | -| 4th to 6th | 1 each | 0 | 1 each | - -- A covered cell earns its first rank even when the check names no tool. -- A project cell that passes without a tool earns a flat 5. -- A warning earns half. -- Depth earned in a level counts only once the levels below it are complete. The rest is reported as `locked_depth`. -- Depth is shown but never used to compare projects: the leaderboard ranks by level, then completeness. +| 4, Complete | every check ran, and every slot is filled: 100% | ## Next steps -Every cell that is not covered becomes an **opportunity**, with what covering it is worth: -- the completeness it adds; -- the depth it earns, which is 0 while its level is locked; -- the level it stands in the way of (`blocks`), and whether it alone does (`unlocks`). +Every slot not filled is a next step, with the points filling it is worth and, when it stands in the way of the next +level, which level. The next level's gates come first (the one that completes it first), then the lower levels, core +before auxiliary code, then the most points. Each says what was found and, when a detail says what to do, that: + +``` +coverage (C++ in lib): +4.2 points, needed for Level 2 (Analysis); consider running gcovr in CI +``` -The next level's blockers come first, lowest level first. Then come core cells before auxiliary ones, then the larger -gains. +`python -m project_validator --explain CHECK` says what a gate looks for, why it matters, and the tools it recognises +for each language. ## JSON With `--format json --score`, the output is `{"results": [...], "score": {...}}`. `results` is exactly what `--format json` prints without `--score`. `score` holds: -- `version` and `preview`; -- `level`, `completeness` (0 to 1), `depth` and `locked_depth`; -- `cells`, each with its check, level, ecosystem, unit, tier, status, tools, points and whether they are counted; -- `opportunities`, each with its check, ecosystem, unit, tier, status, level, completeness, depth, blocks and unlocks. - -## Not yet in the preview +- `version`, `percent` (with any extra credit), `base` (the share of slots filled), `extra` and `held`; +- `level` and `level_name`, `filled` and `slots`, and the `summary` line; +- `breakdown`: each language's filled slots and slots (`""` for the whole project's own gates); +- `cells`: each slot's check, level, language, unit, tier, status, tools, weight, filled share and extra credit; +- `next_steps`: each step's check, language, unit, tier, status, level, points, `needed_for`, `completes`, the + message found and the hint. -These parts of the design need facts the readers do not record yet: -- **Strength**, from disabled diagnostics (`-Wno-conversion`, clang-tidy `-check`, ruff `ignore`) and inline - suppression density; -- **Advisory runs** at half points (`|| true`, `continue-on-error`); -- **Tool families**, which share a rank; -- **Verified points** from CI artefacts. +## What the score is not -They arrive with version 1. The score measures tooling coverage, not code quality or the cost of CI. +It measures whether quality gates are in place, not the quality of the code, nor the cost of the CI. A gate that runs +but can not fail CI (`|| true`) still counts for now; reading that, and verified points from CI artefacts, are for a +later version. The score's version is printed with it, so numbers from different versions are never compared. ## The leaderboard [The leaderboard](https://cpp-best-practices.github.io/project_validator/leaderboard/) scores an opt-in list of -open-source projects every night, one board per language. See [leaderboard/README.md](../leaderboard/README.md). +open-source projects every night, ranked by this score. See [leaderboard/README.md](../leaderboard/README.md). diff --git a/leaderboard/README.md b/leaderboard/README.md index b175820d..bf9e0532 100644 --- a/leaderboard/README.md +++ b/leaderboard/README.md @@ -3,13 +3,14 @@ An opt-in list of open-source projects. Every night, each project is scored by the latest validator with `--score` (see [docs/score.md](../docs/score.md)), and the results are published to the [project site](https://cpp-best-practices.github.io/project_validator/leaderboard/): -- one board per language, plus an all-languages view; -- a page per project, with its history and next steps; +- one board, with a tab per language; +- a page per project, with its history and next steps, and its full HTML report; - a badge per project. The design is upstream issue #295. -Boards rank by **level**, then **completeness**. **Depth** only breaks ties, since it is the least comparable number. +Boards rank by the score: **100% means every quality gate that applies to the project is in place**, and +complementary tools earn extra credit above it. The level breaks ties. Every project is scored by the same validator version on the same night, and the page prints the scoring version. The score measures tooling coverage, not code quality. The board is a showcase, not a wall of shame. @@ -44,8 +45,8 @@ The `leaderboard-check` workflow checks each entry the pull request adds or chan - it has consent; - it is not already listed. -It then scores the project. The `leaderboard-comment` workflow posts the preview on the pull request: the level, -completeness and depth, and the top next steps, so the submitter sees where the project will land. +It then scores the project. The `leaderboard-comment` workflow posts the preview on the pull request: the score, +the level, and the top next steps, so the submitter sees where the project will land. ## Every night @@ -62,9 +63,11 @@ The `leaderboard` workflow runs at 03:17 UTC, and on demand. 2. **Record.** Adds the night to the `leaderboard-data` branch: - `latest/` holds tonight's full results; - `previous/` holds the night before's; + - `reports/` holds each project's full HTML report, tonight's only; - `history/` holds one line per night per project. - This is the only job that can write, and it writes only to that branch. + The branch is one commit, replaced each night, so the reports never grow its history; `history/` keeps every + night's numbers. This is the only job that can write, and it writes only to that branch. 3. **Publish.** Calls the `pages` workflow, which builds the documentation site with the leaderboard (`tests/build_site.py --leaderboard DATA`) and deploys it. @@ -75,7 +78,7 @@ file, just as the corpus is used. ## Running it locally ```sh -python -m leaderboard evaluate out/results # every project; or name some: ... uber/h3 +python -m leaderboard evaluate out/results # every project (and its HTML report); or: ... uber/h3 python -m leaderboard record out/results out/data --date 2026-11-18 python tests/build_site.py out/site --leaderboard out/data # the site, leaderboard included python -m leaderboard check --base old-projects.toml --out preview.md diff --git a/leaderboard/__main__.py b/leaderboard/__main__.py index 68d61945..26176f1e 100644 --- a/leaderboard/__main__.py +++ b/leaderboard/__main__.py @@ -21,7 +21,6 @@ from leaderboard.evaluation import evaluate, failed, fetch, write from leaderboard.history import record from leaderboard.rules import Repository, changed, duplicates, github_repository, problems, token -from leaderboard.site import percent from project_validator.score import SCORE_VERSION PREVIEW_MARKER = "" @@ -66,14 +65,13 @@ def _preview_lines(entry: Entry, found: list[str], result: dict[str, object] | N scored = result.get("score") if result else None if not isinstance(scored, dict): return [*lines, f"Could not be scored: {result.get('error') if result else 'no result'}", ""] - complete = percent(scored["completeness"]) - lines += [f"**Level {scored['level']} · {complete} complete · {scored['depth']} depth**", ""] - opportunities = scored.get("opportunities") - if isinstance(opportunities, list) and opportunities: + lines += [f"**{scored['summary']}**", ""] + steps = scored.get("next_steps") + if isinstance(steps, list) and steps: lines += ["Next steps that would raise it most:", ""] - for opportunity in opportunities[:PREVIEW_STEPS]: - where = " in ".join(part for part in (opportunity["ecosystem"], opportunity["unit"]) if part) - lines.append(f"- `{opportunity['check']}`{f' ({where})' if where else ''}") + for step in steps[:PREVIEW_STEPS]: + where = " in ".join(part for part in (step["ecosystem"], step["unit"]) if part and part != ".") + lines.append(f"- `{step['check']}`{f' ({where})' if where else ''}: +{float(step['points']):.1f} points") lines.append("") return lines @@ -98,7 +96,10 @@ def check( found = problems(entry, repository(entry.name)) ok = ok and not found lines += _preview_lines(entry, found, None if found else evaluated(entry)) - lines.append(f"Scored by score version {SCORE_VERSION} (a preview). The board ranks by level, then completeness.") + lines.append( + f"Scored by score version {SCORE_VERSION}. The board ranks by the score: 100% is every quality gate that " + "applies in place." + ) return ok, "\n".join(lines) + "\n" diff --git a/leaderboard/evaluation.py b/leaderboard/evaluation.py index dbc1ce67..67d8c628 100644 --- a/leaderboard/evaluation.py +++ b/leaderboard/evaluation.py @@ -16,10 +16,15 @@ from pathlib import Path, PurePosixPath from leaderboard import Entry +from project_validator.analysis import from_reports from project_validator.core import Context, Options, Project, Status from project_validator.plugins import discover from project_validator.runner import Report, run_checks from project_validator.score import score +from project_validator.views.html import render as html_report + +# The key of a result that holds its HTML report, which `write` puts beside the JSON rather than in it. +REPORT = "report" def _git(directory: Path, *arguments: str) -> subprocess.CompletedProcess[str]: @@ -92,6 +97,7 @@ def evaluate( if (failure := context.extraction_error) is not None: result["error"] = str(failure).replace(str(directory.resolve()), "") result["score"] = score(judged, every_check).as_dict() + result[REPORT] = html_report(from_reports(context, judged, every_check)) return result @@ -101,7 +107,12 @@ def failed(entry: Entry, error: str, *, validator: str, now: datetime | None = N def write(result: dict[str, object], directory: Path) -> Path: + """Write the result as `.json` in `directory`, and its HTML report, if any, beside it as `.html`.""" directory.mkdir(parents=True, exist_ok=True) + result = dict(result) + report = result.pop(REPORT, None) path = directory / f"{str(result['name']).replace('/', '--')}.json" path.write_text(json.dumps(result, indent=2, sort_keys=True, ensure_ascii=False) + "\n", encoding="utf-8") + if isinstance(report, str): + path.with_suffix(".html").write_text(report, encoding="utf-8") return path diff --git a/leaderboard/history.py b/leaderboard/history.py index 793b5905..f8092b94 100644 --- a/leaderboard/history.py +++ b/leaderboard/history.py @@ -1,9 +1,10 @@ """The leaderboard's memory: each night's results added to the data directory (the `leaderboard-data` branch), and what changed since the night before. - latest/--.json tonight's full result (score, cells, opportunities, each check's status) + latest/--.json tonight's full result (score, cells, next steps, each check's status) previous/--.json the night before's, for what changed - history/--.jsonl one line per night: the date, commit, validator, version and the three numbers + reports/--.html tonight's full HTML report (the latest only) + history/--.jsonl one line per night: the date, commit, validator, score version, percent and level A project whose numbers change while its commit does not was changed by the validator, not by its maintainers: the movement says so, and the change is for the validator's developers to look at. @@ -15,7 +16,17 @@ from collections.abc import Mapping, Sequence from pathlib import Path -HISTORY_FIELDS = ("date", "commit", "validator", "version", "level", "completeness", "depth") +from project_validator.score import SCORE_VERSION + +SCORED = ("version", "percent", "level", "filled", "slots") +HISTORY_FIELDS = ("date", "commit", "validator", *SCORED) + + +def scored(result: Mapping[str, object] | None) -> Mapping[str, object] | None: + """The result's score when this version of the score made it; None when it was not scored, or an earlier version + scored it (other numbers, never compared with these).""" + found = result.get("score") if result else None + return found if isinstance(found, dict) and found.get("version") == SCORE_VERSION else None def _read(path: Path) -> dict[str, object] | None: @@ -26,7 +37,7 @@ def _summary(result: Mapping[str, object], date: str) -> dict[str, object]: scored = result.get("score") numbers = scored if isinstance(scored, dict) else {} line: dict[str, object] = {"date": date, "commit": result.get("commit"), "validator": result.get("validator")} - line |= {key: numbers.get(key) for key in ("version", "level", "completeness", "depth")} + line |= {key: numbers.get(key) for key in SCORED} return line @@ -47,11 +58,21 @@ def record(results: Path, data: Path, date: str) -> list[str]: previous.write_bytes(latest.read_bytes()) lines.append(_summary(result, date)) latest.write_text(path.read_text(encoding="utf-8"), encoding="utf-8") + _keep_report(path.with_suffix(".html"), data / "reports" / f"{path.stem}.html") history.write_text("".join(json.dumps(line, sort_keys=True) + "\n" for line in lines), encoding="utf-8") recorded.append(str(result["name"])) return recorded +def _keep_report(report: Path, kept: Path) -> None: + """Keep tonight's HTML report of a project (the latest only), or none when tonight has none.""" + if report.is_file(): + kept.parent.mkdir(parents=True, exist_ok=True) + kept.write_bytes(report.read_bytes()) + else: + kept.unlink(missing_ok=True) + + def read_history(path: Path) -> list[dict[str, object]]: if not path.is_file(): return [] @@ -77,16 +98,21 @@ def _tools(result: Mapping[str, object] | None) -> set[tuple[str, str]]: return {(str(cell["check"]), str(tool)) for cell in cells for tool in cell["tools"]} -def _numbers(result: Mapping[str, object] | None) -> tuple[object, object, object] | None: - scored = result.get("score") if result else None - if not isinstance(scored, dict): +def _numbers(result: Mapping[str, object] | None) -> tuple[float, float] | None: + """The result's level and percent; None when it was not scored.""" + numbers = scored(result) + if numbers is None: return None - return scored.get("level"), scored.get("completeness"), scored.get("depth") + level, percent = numbers.get("level"), numbers.get("percent") + return ( + float(level) if isinstance(level, int | float) else 0.0, + float(percent) if isinstance(percent, int | float) else 0.0, + ) def movement(before: Mapping[str, object] | None, after: Mapping[str, object]) -> list[str]: - """What changed between two nights' results, in words: the tools that arrived or left (by check), the level, the - completeness and the depth; and, when the commit is the same, that the validator changed it.""" + """What changed between two nights' results, in words: the tools that arrived or left (by check), the level and + the percent; and, when the commit is the same, that the validator changed it.""" if before is None: return ["new on the board"] changes = [f"+{tool} ({check})" for check, tool in sorted(_tools(after) - _tools(before))] @@ -94,24 +120,22 @@ def movement(before: Mapping[str, object] | None, after: Mapping[str, object]) - old, new = _numbers(before), _numbers(after) if old and new: if old[0] != new[0]: - changes.append(f"Level {old[0]} → {new[0]}") - if isinstance(old[1], float | int) and isinstance(new[1], float | int) and old[1] != new[1]: - changes.append(f"{new[1] - old[1]:+.1%} completeness") - if isinstance(old[2], float | int) and isinstance(new[2], float | int) and old[2] != new[2]: - changes.append(f"{new[2] - old[2]:+g} depth") + changes.append(f"Level {old[0]:g} → {new[0]:g}") + if round(new[1] - old[1], 1): + changes.append(f"{new[1] - old[1]:+.1f} points") if changes and before.get("commit") == after.get("commit"): changes.append("same commit: the validator changed") return changes def ranked(results: Sequence[Mapping[str, object]]) -> list[Mapping[str, object]]: - """The results in board order: by level, then completeness; depth breaks ties, and the unscored come last.""" + """The results in board order: by percent (extra credit included), then level; the unscored come last.""" - def key(result: Mapping[str, object]) -> tuple[int, float, float, float, str]: + def key(result: Mapping[str, object]) -> tuple[int, float, float, str]: numbers = _numbers(result) if numbers is None: - return (1, 0.0, 0.0, 0.0, str(result["name"]).lower()) - level, completeness, depth = (float(value) if isinstance(value, int | float) else 0.0 for value in numbers) - return (0, -level, -completeness, -depth, str(result["name"]).lower()) + return (1, 0.0, 0.0, str(result["name"]).lower()) + level, percent = numbers + return (0, -percent, -level, str(result["name"]).lower()) return sorted(results, key=key) diff --git a/leaderboard/projects.toml b/leaderboard/projects.toml index dfc5e092..8de18914 100644 --- a/leaderboard/projects.toml +++ b/leaderboard/projects.toml @@ -19,7 +19,12 @@ consent = "seed" [[project]] name = "uber/h3" -language = "C/C++" +language = "C" +consent = "seed" + +[[project]] +name = "catchorg/Catch2" +language = "C++" consent = "seed" [[project]] @@ -59,12 +64,9 @@ consent = "seed" license = "BSD-3-Clause" [[project]] -name = "compiler-explorer/compiler-explorer" -language = "JavaScript/TypeScript" +name = "expressjs/express" +language = "JavaScript" consent = "seed" -# Its examples/ and test inputs hold programs in about 100 languages, which would otherwise count as its own code -# (upstream #182). -auxiliary = ["example", "test"] [[project]] name = "jump-dev/JuMP.jl" @@ -139,6 +141,14 @@ name = "Alamofire/Alamofire" language = "Swift" consent = "seed" +[[project]] +name = "compiler-explorer/compiler-explorer" +language = "TypeScript" +consent = "seed" +# Its examples/ and test inputs hold programs in about 100 languages, which would otherwise count as its own code +# (upstream #182). +auxiliary = ["example", "test"] + [[project]] name = "zigtools/zls" language = "Zig" diff --git a/leaderboard/site.py b/leaderboard/site.py index ac1f2d69..4f7bf066 100644 --- a/leaderboard/site.py +++ b/leaderboard/site.py @@ -1,173 +1,239 @@ """The leaderboard's pages, for the documentation site (`tests/build_site.py --leaderboard DATA`) to render with its -navigation and style: Markdown by site path, and the files served as they are (badges, data). +navigation and style: each page's source by site path (a title heading, then HTML), and the files served as they are. - leaderboard/index.html every project ranked, then one board per language - leaderboard/projects/--.html a project: its numbers, history, what changed, next steps, cells - leaderboard/badges/--.json a shields.io endpoint: `project_validator | Level 3 · 91%` - leaderboard/data/latest.json every project's numbers, for anyone to use + leaderboard/index.html every project ranked, with a tab per language + leaderboard/projects/--.html a project: its score, history, what changed, next steps, every gate + leaderboard/reports/--.html its full HTML report, from the night it was scored + leaderboard/badges/--.json a shields.io endpoint: `project_validator | 91% · Level 3` + leaderboard/data/latest.json every project's numbers, for anyone to use -Boards rank by level, then completeness; depth only breaks ties, since it is the least comparable number. +Boards rank by the score's percent (100%: every quality gate that applies is in place; extra credit above), then +level. Everything the projects supply is escaped. """ from __future__ import annotations -import html import json import math from collections.abc import Mapping, Sequence from pathlib import Path from leaderboard import Entry -from leaderboard.history import latest, movement, previous, ranked, read_history +from leaderboard.history import latest, movement, previous, ranked, read_history, scored +from project_validator.core import Status +from project_validator.score import SCORE_VERSION +from project_validator.views.html import bar, e, pill, ring, table NEXT_STEPS = 10 SPARKLINE_NIGHTS = 60 _BADGE_COLORS = ("red", "orange", "yellow", "yellowgreen", "brightgreen") -def _text(value: object) -> str: - """Text safe in a Markdown table cell.""" - return html.escape(str(value)).replace("|", "\\|").replace("\n", " ") - - def percent(value: object) -> str: - return f"{math.floor(round(float(value) * 100, 6))}%" if isinstance(value, int | float) else "-" + """A score's percent as the boards show it: floored, so 99.9% is never shown as 100%.""" + return f"{math.floor(round(float(value), 6))}%" if isinstance(value, int | float) else "-" def _score(result: Mapping[str, object]) -> Mapping[str, object] | None: - scored = result.get("score") - return scored if isinstance(scored, dict) else None + return scored(result) -def _numbers(result: Mapping[str, object]) -> tuple[str, str, str]: - scored = _score(result) - if scored is None: - return "-", "-", "-" - return str(scored["level"]), percent(scored["completeness"]), str(scored["depth"]) +def _unscored(result: Mapping[str, object]) -> str: + """Why a result has no score to show: its error, or the earlier score version that scored it.""" + found = result.get("score") + if isinstance(found, dict): + return f"scored by score version {found.get('version')}; this version scores it next" + return str(result.get("error", "no result")) def _slug(name: str) -> str: return name.replace("/", "--") -def _row(position: int, result: Mapping[str, object], changes: Sequence[str], *, language: bool) -> str: - name = str(result["name"]) - level, completeness, depth = _numbers(result) - cells = [str(position), f"[{_text(name)}](projects/{_slug(name)}.md)"] - if language: - cells.append(_text(result["language"])) - status = "error: " + _text(result["error"]) if "error" in result and _score(result) is None else "" - cells += [level, completeness, depth, status or _text(", ".join(changes) or "-")] - return "| " + " | ".join(cells) + " |" - - -def _board(results: Sequence[Mapping[str, object]], changes: Mapping[str, list[str]], *, language: bool) -> list[str]: - header = ["#", "Project", *(["Language"] if language else []), "Level", "Completeness", "Depth", "Since last night"] - lines = ["| " + " | ".join(header) + " |", "|" + "---|" * len(header)] - lines += [ - _row(position, result, changes[str(result["name"])], language=language) - for position, result in enumerate(ranked(results), 1) +def _number(value: object) -> float: + return float(value) if isinstance(value, int | float) else 0.0 + + +def _level(scored: Mapping[str, object]) -> str: + return f'Level {e(scored["level"])} · {e(scored["level_name"])}' + + +def _score_cell(scored: Mapping[str, object] | None) -> str: + if scored is None: + return '-' + return f'
{bar(_number(scored["percent"]))}{percent(scored["percent"])}
' + + +def _row(position: int, result: Mapping[str, object], changes: Sequence[str]) -> str: + name, language, scored = str(result["name"]), str(result["language"]), _score(result) + seed = ' seed' if result.get("seed") else "" + if scored is None: + status = f'error {e(result.get("error", ""))}' + else: + status = f'{e(", ".join(changes) or "-")}' + return ( + f'{position}' + f'{e(name)}{seed}' + f"{e(language)}{_score_cell(scored)}" + f"{_level(scored) if scored else ''}{status}" + ) + + +def _tabs(results: Sequence[Mapping[str, object]]) -> str: + languages = sorted({str(result["language"]) for result in results}, key=str.lower) + buttons = [ + f'' ] - return lines + for language in languages: + count = sum(1 for result in results if result["language"] == language) + buttons.append( + f'' + ) + return f'
{"".join(buttons)}
' + + +BOARD_SCRIPT = ( + "" +) + + +INTRO = ( + "Open-source projects that opted in, scored every night by the latest validator. **100% means every quality " + "gate that applies to the project is in place**; complementary tools earn extra credit above it " + "([how the score works](../docs/score.md)). The score measures tooling, not code quality: the board is a " + "showcase, not a wall of shame. Seeds await a maintainer's confirmation. [How to join](README.md)." +) def index( listed: Sequence[Entry], results: Mapping[str, Mapping[str, object]], changes: Mapping[str, list[str]] ) -> str: - lines = [ - "# Leaderboard", - "", - "Open-source projects that opted in, scored every night by the latest validator with `--score` " - "([how the score works](../docs/score.md)). Boards rank by **level**, then **completeness**; depth only " - "breaks ties. The score is a preview: it measures tooling coverage, not code quality. Seeds await a " - "maintainer's confirmation. To add a project, see [how to join](README.md).", - "", - ] shown = [results[entry.name] for entry in listed if entry.name in results] if not shown: - lines += ["No nightly results yet. The projects listed:", ""] - lines += [f"- [{_text(entry.name)}]({entry.url}) ({_text(entry.language)})" for entry in listed] - return "\n".join(lines) + "\n" - lines += ["## All languages", "", *_board(shown, changes, language=True), "", "## By language", ""] - for language in sorted({str(result["language"]) for result in shown}, key=str.lower): - board = [result for result in shown if result["language"] == language] - lines += [f"### {_text(language)}", "", *_board(board, changes, language=False), ""] - return "\n".join(lines) + cards = "".join( + f'
{e(entry.name)}' + f'
{e(entry.language)}
' + for entry in listed + ) + return ( + f'# Leaderboard\n\n{INTRO}\n\n

No nightly results yet

' + f'
{cards}
\n' + ) + rows = "".join( + _row(position, result, changes[str(result["name"])]) for position, result in enumerate(ranked(shown), 1) + ) + head = "".join(f"{name}" for name in ("#", "Project", "Language", "Score", "Level", "Since last night")) + return ( + f'# Leaderboard\n\n{INTRO}\n\n
{_tabs(shown)}' + f'
{head}{rows}' + f"
{BOARD_SCRIPT}
\n" + ) def sparkline(values: Sequence[float], width: int = 240, height: int = 40) -> str: - """An inline SVG of the values (completeness, 0 to 1) over the nights, oldest first.""" + """An inline SVG of the values (the score's percent) over the nights, oldest first, from 0 to 100% (or the most + extra credit).""" if len(values) < 2: return "" + top = max(100.0, *values) step = width / (len(values) - 1) - points = " ".join(f"{index * step:.1f},{height - value * height:.1f}" for index, value in enumerate(values)) + points = " ".join(f"{index * step:.1f},{height - value / top * height:.1f}" for index, value in enumerate(values)) return ( - f'' - f'' + f'' + f'' ) -def _facts(entry: Entry | None, result: Mapping[str, object]) -> list[str]: +def _facts(entry: Entry | None, result: Mapping[str, object], report: bool) -> str: name = str(result["name"]) url = entry.url if entry else f"https://github.com/{name}" - facts = [f"- Repository: [{_text(name)}]({url}), on the {_text(result['language'])} board"] + facts = [f'{e(name)} on the {e(result["language"])} board'] if result.get("seed"): - facts.append("- A seed: awaiting a maintainer's confirmation") + facts.append("a seed, awaiting a maintainer's confirmation") if commit := result.get("commit"): - facts.append(f"- Commit evaluated: [{str(commit)[:12]}]({url}/commit/{commit})") + facts.append(f'commit {e(str(commit)[:12])}') scored = _score(result) - version = f", score version {scored['version']}" if scored else "" + version = f", score version {e(scored['version'])}" if scored else "" facts.append( - f"- Evaluated {_text(result.get('evaluated', '?'))} by validator {str(result.get('validator'))[:12]}{version}" + f"evaluated {e(result.get('evaluated', '?'))} by validator {e(str(result.get('validator'))[:12])}" + f"{version}" ) if unknowns := result.get("unknowns"): - facts.append(f"- {unknowns} check(s) judged by what could be read (`--allow-unknown`): validator gaps to fix") - return facts - - -def _opportunities(scored: Mapping[str, object]) -> list[str]: - found = scored.get("opportunities") - opportunities = found if isinstance(found, list) else [] - if not opportunities: - return ["Every applicable cell is covered."] - lines = ["| Check | Where | Tier | Now | Completeness | Depth | Level |", "|---|---|---|---|---|---|---|"] - for opportunity in opportunities[:NEXT_STEPS]: - where = " in ".join(part for part in (opportunity["ecosystem"], opportunity["unit"]) if part) or "the project" - level = ( - f"unlocks {opportunity['unlocks']}" - if opportunity.get("unlocks") - else (f"toward {opportunity['blocks']}" if opportunity.get("blocks") else "") - ) - lines.append( - f"| `{_text(opportunity['check'])}` | {_text(where)} | {opportunity['tier']} | {opportunity['status']} " - f"| +{float(opportunity['completeness']):.1%} | +{opportunity['depth']} | {level} |" - ) - if len(opportunities) > NEXT_STEPS: - lines += ["", f"And {len(opportunities) - NEXT_STEPS} more."] - return lines + facts.append(f"{e(unknowns)} check(s) judged by what could be read (--allow-unknown): validator gaps to fix") + if report: + facts.append(f'the full report →') + return "".join(f"
  • {fact}
  • " for fact in facts) + + +def _step_row(step: Mapping[str, object]) -> tuple[str, ...]: + where = " in ".join(str(part) for part in (step["ecosystem"], step["unit"]) if part and part != ".") + needed = step.get("needed_for") + verb = "completes" if step.get("completes") else "for" + level = f' {verb} Level {e(needed)}' if needed else "" + return ( + f'+{_number(step["points"]):.1f}', + f"{e(step['check'])}{level}", + e(where or "the project"), + pill(Status(str(step["status"]))), + e(step.get("hint") or step.get("message") or ""), + ) + + +def _next_steps(scored: Mapping[str, object]) -> str: + found = scored.get("next_steps") + steps = found if isinstance(found, list) else [] + if not steps: + return "

    Every quality gate that applies is in place.

    " + more = f'

    And {len(steps) - NEXT_STEPS} more.

    ' if len(steps) > NEXT_STEPS else "" + rows = [_step_row(step) for step in steps[:NEXT_STEPS]] + return table(("Points", "Gate", "Where", "Now", "To do"), rows) + more + + +def _cell_row(cell: Mapping[str, object]) -> tuple[str, ...]: + found = cell["tools"] + tools = "".join(f'{e(tool)}' for tool in found) if isinstance(found, list) else "" + extra = f" +{e(cell['extra'])}" if cell.get("extra") else "" + return ( + f"{e(cell['check'])}", + e(cell["level"]), + e(cell["ecosystem"] or "the project"), + e(cell["unit"] or "-"), + e(cell["tier"]), + pill(Status(str(cell["status"]))), + f'{tools}' if tools else '-', + f"{e(cell['filled'])} of {e(cell['weight'])}{extra}", + ) -def _cells(scored: Mapping[str, object]) -> list[str]: +def _cells(scored: Mapping[str, object]) -> str: found = scored.get("cells") cells = found if isinstance(found, list) else [] - lines = [ - "| Check | Level | Ecosystem | Unit | Tier | Status | Tools | Points |", - "|---|---|---|---|---|---|---|---|", + ordered = sorted(cells, key=lambda cell: (cell["level"], cell["check"], cell["unit"], cell["ecosystem"])) + headers = ("Gate", "Level", "Language", "Unit", "Code", "Status", "Tools", "Filled") + return table(headers, [_cell_row(cell) for cell in ordered]) + + +def _history(history: Sequence[Mapping[str, object]]) -> str: + values = [ + float(value) + for night in history + if night.get("version") == SCORE_VERSION and isinstance(value := night.get("percent"), int | float) ] - for cell in sorted(cells, key=lambda cell: (cell["level"], cell["check"], cell["unit"], cell["ecosystem"])): - points = str(cell["points"]) if cell["counted"] else f"{cell['points']} (locked)" - lines.append( - f"| `{_text(cell['check'])}` | {cell['level']} | {_text(cell['ecosystem'] or '-')} " - f"| {_text(cell['unit'] or '-')} | {cell['tier']} | {cell['status']} " - f"| {_text(', '.join(cell['tools']) or '-')} | {points} |" - ) - return lines + drawn = sparkline(values[-SPARKLINE_NIGHTS:], width=520, height=80) + return drawn or '

    The history starts after a second night.

    ' -def _history_line(history: Sequence[Mapping[str, object]]) -> str: - values = [float(value) for night in history if isinstance(value := night.get("completeness"), int | float)] - return sparkline(values[-SPARKLINE_NIGHTS:]) +def _badge_section(badge_url: str) -> str: + image = f"![project_validator score](https://img.shields.io/endpoint?url={badge_url})" + return ( + f'

    Badge

    project_validator score

    {e(image)}
    ' + ) def project_page( @@ -176,28 +242,30 @@ def project_page( history: Sequence[Mapping[str, object]], changes: Sequence[str], badge_url: str, + *, + report: bool = False, ) -> str: - lines = [f"# {_text(result['name'])}", "", *_facts(entry, result), ""] + """A project's page: its score, the facts of its night, its history, what changed, next steps and every gate.""" + title = f"# {e(result['name'])}\n\n" scored = _score(result) + facts = f'
      {_facts(entry, result, report)}
    ' if scored is None: - lines += [f"Not scored tonight: {_text(result.get('error', 'no result'))}", ""] - return "\n".join(lines) - locked = ( - f" ({scored['locked_depth']} more locked until the levels below are complete)" if scored["locked_depth"] else "" + return title + f'
    {facts}

    Not scored tonight: {e(_unscored(result))}

    \n' + value = _number(scored["percent"]) + since = "".join(f"
  • {e(change)}
  • " for change in changes) or "
  • No change.
  • " + return title + ( + f'
    {ring(value, f"score {value:.0f} percent")}
    ' + f'
    {_level(scored)}{e(_gates(scored))}
    {facts}
    ' + f'

    The score, night by night

    ' + f'{_history(history)}

    Since last night

      {since}
    ' + f'

    Next steps

    {_next_steps(scored)}
    ' + f'

    Every gate

    {_cells(scored)}
    {_badge_section(badge_url)}\n' ) - level, completeness, depth = _numbers(result) - lines += [f"**Level {level} · {completeness} complete · {depth} depth**{locked}", ""] - if drawn := _history_line(history): - lines += [drawn, ""] - lines += ["## Since last night", "", _text(", ".join(changes) or "No change."), ""] - lines += ["## Next steps", "", *_opportunities(scored), ""] - lines += ["## Cells", "", *_cells(scored), ""] - return "\n".join([*lines, *_badge_section(badge_url)]) -def _badge_section(badge_url: str) -> list[str]: - image = f"![project_validator score](https://img.shields.io/endpoint?url={badge_url})" - return ["## Badge", "", image, "", "```markdown", image, "```", ""] +def _gates(scored: Mapping[str, object]) -> str: + """The score's summary without the percent and level the page shows already: `31 of 51 gates in place`.""" + return " · ".join(str(scored["summary"]).split(" · ")[2:]) def badge(result: Mapping[str, object]) -> dict[str, object]: @@ -206,7 +274,7 @@ def badge(result: Mapping[str, object]) -> dict[str, object]: if scored is None: return {"schemaVersion": 1, "label": "project_validator", "message": "error", "color": "lightgrey"} level = int(str(scored["level"])) - message = f"Level {level} · {percent(scored['completeness'])}" + message = f"{percent(scored['percent'])} · Level {level}" return {"schemaVersion": 1, "label": "project_validator", "message": message, "color": _BADGE_COLORS[level]} @@ -217,13 +285,13 @@ def _summary(result: Mapping[str, object]) -> dict[str, object]: "language": result["language"], "commit": result.get("commit"), "evaluated": result.get("evaluated"), - **{key: scored.get(key) for key in ("version", "level", "completeness", "depth")}, + **{key: scored.get(key) for key in ("version", "percent", "level", "level_name", "filled", "slots")}, } def build(listed: Sequence[Entry], data: Path | None, pages_url: str) -> tuple[dict[str, str], dict[str, str]]: - """The leaderboard's pages (Markdown by site path) and its other files (text by site path), from the results in - `data` (none yet when it is None or empty). `pages_url` is where the site is published, for the badges.""" + """The leaderboard's pages (by site path) and its other files (text by site path), from the results in `data` + (none yet when it is None or empty). `pages_url` is where the site is published, for the badges.""" results = latest(data) if data is not None else {} by_name = {entry.name: entry for entry in listed} current = {name: result for name, result in results.items() if name in by_name} @@ -235,11 +303,17 @@ def build(listed: Sequence[Entry], data: Path | None, pages_url: str) -> tuple[d for name, result in current.items(): slug = _slug(name) history = read_history(data / "history" / f"{slug}.jsonl") if data else [] + report = data / "reports" / f"{slug}.html" if data else None + if report is not None and report.is_file(): + files[f"leaderboard/reports/{slug}.html"] = report.read_text(encoding="utf-8") badge_url = f"{pages_url.rstrip('/')}/leaderboard/badges/{slug}.json" pages[f"leaderboard/projects/{slug}.html"] = project_page( - by_name[name], result, history, changes[name], badge_url + by_name[name], result, history, changes[name], badge_url, report=f"leaderboard/reports/{slug}.html" in files ) files[f"leaderboard/badges/{slug}.json"] = json.dumps(badge(result), sort_keys=True) + "\n" summaries = [_summary(result) for result in ranked(list(current.values()))] files["leaderboard/data/latest.json"] = json.dumps(summaries, indent=2, sort_keys=True) + "\n" return pages, files + + +__all__ = ["badge", "build", "index", "percent", "project_page", "sparkline"] diff --git a/project_validator/analysis.py b/project_validator/analysis.py new file mode 100644 index 00000000..2083e787 --- /dev/null +++ b/project_validator/analysis.py @@ -0,0 +1,283 @@ +"""One analysis of a project: what was detected and how it was read, each check's result and the score. Every view +(plain text, the console, markdown, JSON, the HTML report, the TUI) renders an `Analysis`, so they all tell the same +story. + +`analyse` runs the extraction and the checks, telling the context's observers what it does (`Progress`), so a view +can show it while it works. +""" + +from __future__ import annotations + +import contextlib +import re +import subprocess +import time +from collections.abc import Iterable, Sequence +from dataclasses import dataclass, field +from pathlib import Path, PurePosixPath + +from project_validator import __version__ +from project_validator.core import Check, Context, ExtractionError, Observer, Progress +from project_validator.ecosystems import formats +from project_validator.facts import Facts +from project_validator.facts.auxiliary import selectors +from project_validator.facts.roles import AUXILIARY +from project_validator.facts.structure import SourceFile +from project_validator.project_map import ProjectStructure +from project_validator.runner import Report, run_checks +from project_validator.score import Score, score + +# How many directories a role summary names. +ROLE_DIRECTORIES = 5 + + +@dataclass(frozen=True, slots=True, kw_only=True) +class Stage: + """An extraction stage: how long it took and how many facts it found.""" + + name: str + seconds: float + found: int + + def as_dict(self) -> dict[str, object]: + return {"name": self.name, "seconds": round(self.seconds, 4), "found": self.found} + + +@dataclass(frozen=True, slots=True, kw_only=True) +class RoleSummary: + """The project's own sources in one role (product, test, example, docs, tooling, benchmark, vendored): the + top-level directories they are in, how many files, in which languages, and whether `--auxiliary` names the role.""" + + role: str + directories: tuple[str, ...] + files: int + languages: tuple[str, ...] + auxiliary: bool = False + + @property + def suggestion(self) -> str | None: + """The option that would judge this code as auxiliary, when it could be and is not yet.""" + return f"--auxiliary {self.role}" if self.role in AUXILIARY and not self.auxiliary else None + + def as_dict(self) -> dict[str, object]: + return { + "role": self.role, + "directories": list(self.directories), + "files": self.files, + "languages": list(self.languages), + "auxiliary": self.auxiliary, + "suggestion": self.suggestion, + } + + +@dataclass(frozen=True, slots=True, kw_only=True) +class Git: + """The checkout the project is in, if any: its commit, and where its files can be seen on the web.""" + + commit: str | None = None + branch: str | None = None + web: str | None = None + + def as_dict(self) -> dict[str, object]: + return {"commit": self.commit, "branch": self.branch, "web": self.web} + + +@dataclass(frozen=True, slots=True, kw_only=True) +class Analysis: + project: Path + validator: str + options: dict[str, object] + structure: ProjectStructure | None + facts: Facts + reports: tuple[Report, ...] + score: Score | None + stages: tuple[Stage, ...] + roles: tuple[RoleSummary, ...] + seconds: float + git: Git = field(default_factory=Git) + error: ExtractionError | None = None + + @property + def name(self) -> str: + return self.project.name + + def as_dict(self) -> dict[str, object]: + from project_validator.cli import report_dicts # the results as --format json prints them + + return { + "project": {"name": self.name, "path": str(self.project)}, + "validator": self.validator, + "options": self.options, + "seconds": round(self.seconds, 3), + "git": self.git.as_dict(), + "stages": [stage.as_dict() for stage in self.stages], + "structure": self.structure.as_dict() if self.structure is not None else None, + "roles": [role.as_dict() for role in self.roles], + "results": report_dicts(list(self.reports)), + "score": self.score.as_dict() if self.score is not None else None, + } + + +def _top(path: str) -> str: + parts = PurePosixPath(path).parts + return parts[0] if len(parts) > 1 else "." + + +def roles(facts: Facts, named: Iterable[str] = ()) -> tuple[RoleSummary, ...]: + """The project's sources by role (its code, not its data files), the product first; `named` are the roles + `--auxiliary` names.""" + by_role: dict[str, list[SourceFile]] = {} + known = formats() + for source in facts.of(SourceFile): + if (source.language is not None and source.language not in known) or source.vendored: + by_role.setdefault(source.role, []).append(source) + named = set(named) + order = sorted(by_role, key=lambda role: (role != "product", role == "vendored", role)) + return tuple( + RoleSummary( + role=role, + directories=tuple(dict.fromkeys(_top(source.path) for source in by_role[role]))[:ROLE_DIRECTORIES], + files=len(by_role[role]), + languages=tuple(sorted({source.language for source in by_role[role] if source.language})), + auxiliary=role in named, + ) + for role in order + ) + + +def _git(directory: Path, *arguments: str) -> str | None: + try: + found = subprocess.run( # noqa: S603 - git, with the validator's own arguments + ["git", "-C", str(directory), *arguments], # noqa: S607 - git from PATH, as the user runs it + capture_output=True, + text=True, + timeout=10, + check=False, + ) + except (OSError, subprocess.SubprocessError): + return None + return found.stdout.strip() or None if found.returncode == 0 else None + + +_SSH = re.compile(r"^(?:ssh://)?git@(?P[^:/]+)[:/](?P.+?)(?:\.git)?/?$") +_HTTPS = re.compile(r"^https?://(?:[^@/]+@)?(?P[^/]+)/(?P.+?)(?:\.git)?/?$") + + +def web_url(remote: str) -> str | None: + """Where a git remote's files can be seen in a browser (`git@github.com:o/r.git` is https://github.com/o/r).""" + found = _SSH.match(remote) or _HTTPS.match(remote) + return f"https://{found['host']}/{found['path']}" if found else None + + +def git_of(directory: Path) -> Git: + """The checkout `directory` is the top of, if it is one.""" + top = _git(directory, "rev-parse", "--show-toplevel") + if top is None or Path(top).resolve() != directory.resolve(): + return Git() + remote = _git(directory, "remote", "get-url", "origin") + return Git( + commit=_git(directory, "rev-parse", "HEAD"), + branch=_git(directory, "rev-parse", "--abbrev-ref", "HEAD"), + web=web_url(remote) if remote else None, + ) + + +_LINE = re.compile(r"^(?P[^:]+):(?P\d+)$") + + +def file_url(git: Git, origin: str) -> str | None: + """Where a fact's origin (`src/a.py`, `src/a.py:3`) can be seen on the web, at the commit analysed.""" + if git.web is None or git.commit is None or not origin or origin == ".": + return None + path, line = origin, None + if found := _LINE.match(origin): + path, line = found["path"], found["line"] + path = path.split(":", 1)[0] + return f"{git.web}/blob/{git.commit}/{path}{f'#L{line}' if line else ''}" + + +def _options(context: Context) -> dict[str, object]: + options = context.options + return { + "build": options.build, + "allow_unknown": options.allow_unknown, + "allow_official_tags": options.allow_official_tags, + "max_file_size": options.max_file_size, + "exclude": sorted(map(str, context.project.excluded)), + "auxiliary": list(context.project.auxiliary), + } + + +def analyse( + context: Context, + checks: Sequence[Check], + *, + every_check: Iterable[str] | None = None, + scored: bool = True, + progress: Observer | None = None, +) -> Analysis: + """Extract the facts about the project `context` reads and run `checks` on it, telling `progress` (and the + context's other observers) what it does. The score counts `every_check` (the names of every check there is, + `checks` by default) for the top level.""" + stages: list[Stage] = [] + context.observe(lambda event: _record(event, stages)) + if progress is not None: + context.observe(progress) + started = time.perf_counter() + with contextlib.suppress(ExtractionError): + _ = context.facts # first, so that the stages are told before the checks; a failure is kept for the checks + reports = tuple(run_checks(checks, context)) + names = [check.name for check in checks] if every_check is None else list(every_check) + return _finished(context, reports, tuple(stages), score_of=names if scored else None, started=started) + + +def _finished( + context: Context, + reports: tuple[Report, ...], + stages: tuple[Stage, ...], + *, + score_of: list[str] | None, + started: float, +) -> Analysis: + """The analysis of a run: scored against `score_of` (every check's name), unless it is None.""" + error = context.extraction_error + facts = Facts(()) if error is not None else context.facts + return Analysis( + project=context.project.root, + validator=__version__, + options=_options(context), + structure=None if error is not None else context.structure, + facts=facts, + reports=reports, + score=score(reports, score_of) if score_of is not None and error is None else None, + stages=stages, + roles=roles(facts, selectors(facts).roles if error is None else ()), + seconds=time.perf_counter() - started, + git=git_of(context.project.root), + error=error, + ) + + +def from_reports(context: Context, reports: Sequence[Report], every_check: Iterable[str]) -> Analysis: + """The analysis of reports already run on `context` (the stages are not known then).""" + return _finished(context, tuple(reports), (), score_of=list(every_check), started=time.perf_counter()) + + +def _record(event: Progress, stages: list[Stage]) -> None: + if event.kind == "stage" and event.done: + stages.append(Stage(name=event.name, seconds=event.seconds, found=event.found)) + + +__all__ = [ + "Analysis", + "Git", + "Progress", + "RoleSummary", + "Stage", + "analyse", + "file_url", + "from_reports", + "git_of", + "roles", + "web_url", +] diff --git a/project_validator/build_systems/cmake/ctest.py b/project_validator/build_systems/cmake/ctest.py index 9cc0c15e..f343e461 100644 --- a/project_validator/build_systems/cmake/ctest.py +++ b/project_validator/build_systems/cmake/ctest.py @@ -1,6 +1,6 @@ -"""C/C++ tests: registered with CTest in the CMake files (`enable_testing()`, then `add_test` or a `*_discover_tests` -call, as `project_validator.build_systems.cmake` reads them), or, with `--build`, listed by ctest after a real build. -ctest runs them.""" +"""C and C++ tests: registered with CTest in the CMake files (`enable_testing()`, then `add_test` or a +`*_discover_tests` call, as `project_validator.build_systems.cmake` reads them), or, with `--build`, listed by ctest +after a real build. ctest runs them.""" from __future__ import annotations diff --git a/project_validator/c_family/__init__.py b/project_validator/c_family/__init__.py new file mode 100644 index 00000000..a8842767 --- /dev/null +++ b/project_validator/c_family/__init__.py @@ -0,0 +1,6 @@ +"""What C and C++ share: their compilers, build directory, and the tools and practices of this package's modules, +which judge each of the two languages on its own. + +C and C++ are separate languages and separate ecosystems (`project_validator.ecosystems.c` and `.cpp`, which share +their build systems, CMake and Meson); a rule here applies to both and is asked of each separately. +""" diff --git a/project_validator/ecosystems/c_cpp/analysis.py b/project_validator/c_family/analysis.py similarity index 100% rename from project_validator/ecosystems/c_cpp/analysis.py rename to project_validator/c_family/analysis.py diff --git a/project_validator/c_family/build.py b/project_validator/c_family/build.py new file mode 100644 index 00000000..4fb91c38 --- /dev/null +++ b/project_validator/c_family/build.py @@ -0,0 +1,37 @@ +"""What C and C++ builds share: the compilers CI builds with (the platform matrix's toolchain axis) and the build +directory, which is never committed and always ignored.""" + +from __future__ import annotations + +from project_validator.c_family.compiler_flags import builds_c_or_cxx +from project_validator.ecosystems.model import C_FAMILY +from project_validator.facts.axes import ToolchainAxis +from project_validator.facts.jobs import Job +from project_validator.facts.outputs import BuildOutput, directories, ignored_at_top_level + + +def _compilers(job: Job) -> frozenset[str]: + return job.compilers if builds_c_or_cxx(job) else frozenset() + + +def _uses_runner_default_compiler(job: Job) -> bool: + return job.default_compiler and builds_c_or_cxx(job) + + +COMPILERS = ToolchainAxis( + languages=C_FAMILY, noun="compiler", of_job=_compilers, runner_default=_uses_runner_default_compiler, compiled=True +) + + +BUILD_DIRECTORY = BuildOutput( + languages=C_FAMILY, + name="the build directory", + globs=ignored_at_top_level(r"(?:\[Bb\]uild|_?build|out|cmake-build)(?:[-_*][\w*-]*)?"), + paths=directories("build", "out", "_build", "cmake-build-debug"), + hint="consider ignoring the build directory (e.g. build/ and out/)", + artifacts=( + *("*.o", "*.obj", "*.a", "*.lib", "*.so", "*.so.*", "*.dylib", "*.dll", "*.exe", "*.pdb", "*.ilk"), + *("CMakeCache.txt", "CMakeFiles/", "CMakeUserPresets.json", "cmake-build-*/"), + *("/build/", "/out/", "/builddir/"), + ), +) diff --git a/project_validator/ecosystems/c_cpp/clang_tidy.py b/project_validator/c_family/clang_tidy.py similarity index 95% rename from project_validator/ecosystems/c_cpp/clang_tidy.py rename to project_validator/c_family/clang_tidy.py index 0052c8c1..d431cb25 100644 --- a/project_validator/ecosystems/c_cpp/clang_tidy.py +++ b/project_validator/c_family/clang_tidy.py @@ -1,12 +1,12 @@ """clang-tidy's settings (a `.clang-tidy`: the checks it enables and their options), and its readability-function-size -check, which limits C/C++ function length when clang-tidy runs with a line or statement threshold.""" +check, which limits C and C++ function length when clang-tidy runs with a line or statement threshold.""" from __future__ import annotations from collections.abc import Iterator, Mapping, Sequence from fnmatch import fnmatchcase -from project_validator.ecosystems.c_cpp.analysis import CLANG_TIDY +from project_validator.c_family.analysis import CLANG_TIDY from project_validator.ecosystems.model import C_FAMILY from project_validator.facts import Fact, Facts, Setting from project_validator.facts.limits import Rule, limiter diff --git a/project_validator/c_family/compiler_flags.py b/project_validator/c_family/compiler_flags.py new file mode 100644 index 00000000..b9eed185 --- /dev/null +++ b/project_validator/c_family/compiler_flags.py @@ -0,0 +1,125 @@ +"""C and C++ compiler flags: the strict warning set and warnings as errors, for each compiler CI builds with, and +security hardening.""" + +from __future__ import annotations + +from collections.abc import Callable + +from project_validator.ecosystems.model import C_FAMILY +from project_validator.facts import Facts +from project_validator.facts.flags import errors_requirements, flag_requirements, warning_requirements +from project_validator.facts.jobs import Job +from project_validator.facts.practices import Practice, PracticeName, Requirement, Wording +from project_validator.tools.toolchains import ( + FHARDENED, + GCC_HARDENING, + MSVC_HARDENING, + Flag, + hardening_flags, + warning_flags, + warnings_as_errors_flag, +) + +# The readers of the build files whose options the compiler flags are found among. +BUILD_FILES = ("CMake", "Meson") +PRESET_FILES = ("CMakePresets.json", "CMakeUserPresets.json") + + +# --- warnings and warnings as errors + + +def builds_c_or_cxx(job: Job) -> bool: + """A job that names a compiler builds C or C++; one that only uses its runner's default compiler builds C or C++ + unless it is seen using another ecosystem's tools and not C or C++ build tools.""" + return not job.default_compiler or not job.ecosystems or bool(C_FAMILY & job.ecosystems) + + +def ci_compilers(facts: Facts) -> tuple[str, ...]: + """The compilers CI builds C or C++ with; GCC's flags are asked for when CI names none.""" + found = {compiler for job in facts.of(Job) if builds_c_or_cxx(job) for compiler in job.compilers} + return tuple(sorted(found)) or ("gcc",) + + +def _warnings(language: str) -> Callable[[Facts, str | None], tuple[Requirement, ...]]: + return lambda _facts, compiler: warning_requirements(warning_flags(compiler or "gcc"), frozenset({language})) + + +def _errors(language: str) -> Callable[[Facts, str | None], tuple[Requirement, ...]]: + return lambda _facts, compiler: errors_requirements( + warnings_as_errors_flag(compiler or "gcc"), frozenset({language}) + ) + + +def _warnings_practice(language: str) -> Practice: + """The strict warning set, asked of `language`'s compilations alone: C++'s flags (`CMAKE_CXX_FLAGS`, + `$`) do not warn about C, nor C's about C++.""" + return Practice( + name=PracticeName.WARNINGS, + languages=frozenset({language}), + requirements=_warnings(language), + reads=BUILD_FILES, + compilers=ci_compilers, + words=Wording( + kind="compiler warning flags", + separator=" ", + hint="enable -Wall -Wextra -Wpedantic -Wshadow -Wconversion (MSVC: /W4 /permissive-) for each compiler " + "CI uses", + ), + ) + + +def _errors_practice(language: str) -> Practice: + return Practice( + name=PracticeName.WARNINGS_AS_ERRORS, + languages=frozenset({language}), + requirements=_errors(language), + any_one=True, + reads=BUILD_FILES, + compilers=ci_compilers, + words=Wording( + kind="warnings as errors", + searched="CI configuration or the build files (CMake files, presets, meson.build)", + hint="add -Werror (GCC/Clang), /WX (MSVC) or set CMAKE_COMPILE_WARNING_AS_ERROR (Meson: werror=true), " + "at least as an option", + ), + ) + + +C_WARNINGS, CXX_WARNINGS = _warnings_practice("C"), _warnings_practice("C++") +C_WARNINGS_AS_ERRORS, CXX_WARNINGS_AS_ERRORS = _errors_practice("C"), _errors_practice("C++") + +# --- hardening + +# The C++ standard library's assertions: hardening of C++ alone. +CXX_LIBRARY_HARDENING = frozenset({"_GLIBCXX_ASSERTIONS or _LIBCPP_HARDENING_MODE"}) + + +def _hardening_flags(language: str, compiler: str) -> tuple[Flag, ...]: + flags = hardening_flags(compiler) + return flags if language == "C++" else tuple(flag for flag in flags if flag.name not in CXX_LIBRARY_HARDENING) + + +def _hardening(language: str) -> Callable[[Facts, str | None], tuple[Requirement, ...]]: + return lambda _facts, compiler: flag_requirements( + _hardening_flags(language, compiler or "gcc"), frozenset({language}) + ) + + +def _hardening_practice(language: str) -> Practice: + """Hardening, asked of `language`'s compilations: C is not asked for the C++ standard library's assertions.""" + gcc = [flag.name for flag in GCC_HARDENING if language == "C++" or flag.name not in CXX_LIBRARY_HARDENING] + return Practice( + name=PracticeName.HARDENING, + languages=frozenset({language}), + requirements=_hardening(language), + reads=BUILD_FILES, + compilers=ci_compilers, + words=Wording( + kind="hardening options", + hint=f"enable {FHARDENED} (GCC 14+) or {', '.join(gcc)}; for MSVC " + f"{', '.join(flag.name for flag in MSVC_HARDENING)}", + ), + ) + + +C_HARDENING, CXX_HARDENING = _hardening_practice("C"), _hardening_practice("C++") diff --git a/project_validator/ecosystems/c_cpp/dependencies.py b/project_validator/c_family/dependencies.py similarity index 100% rename from project_validator/ecosystems/c_cpp/dependencies.py rename to project_validator/c_family/dependencies.py diff --git a/project_validator/ecosystems/c_cpp/extensions.py b/project_validator/c_family/extensions.py similarity index 97% rename from project_validator/ecosystems/c_cpp/extensions.py rename to project_validator/c_family/extensions.py index 62615829..9c60590e 100644 --- a/project_validator/ecosystems/c_cpp/extensions.py +++ b/project_validator/c_family/extensions.py @@ -36,7 +36,7 @@ def found(facts: Facts, _compiler: str | None) -> Iterator[Evidence]: def _sources_of(language: str) -> Callable[[Facts], str | None]: - """A C/C++ project counts both languages; one whose sources are all in the other does not compile `language`.""" + """A project whose C-family sources are all in the other language does not compile `language`.""" def skipped(facts: Facts) -> str | None: languages = {source.language for source in facts.of(SourceFile)} & C_FAMILY diff --git a/project_validator/ecosystems/c_cpp/formatting.py b/project_validator/c_family/formatting.py similarity index 100% rename from project_validator/ecosystems/c_cpp/formatting.py rename to project_validator/c_family/formatting.py diff --git a/project_validator/ecosystems/c_cpp/fuzzing.py b/project_validator/c_family/fuzzing.py similarity index 92% rename from project_validator/ecosystems/c_cpp/fuzzing.py rename to project_validator/c_family/fuzzing.py index f060dc41..050f4a3c 100644 --- a/project_validator/ecosystems/c_cpp/fuzzing.py +++ b/project_validator/c_family/fuzzing.py @@ -5,21 +5,21 @@ import re -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.model import C_FAMILY from project_validator.facts import Command, Facts, resolved from project_validator.facts.fuzzing import LIBFUZZER_OPTION, FuzzTargets, PropertyTests, dotnet_target, fuzzed, fuzzer from project_validator.facts.tools import Run, all_of, known_tools, starts, when C_FUZZ_TARGETS = FuzzTargets( name="libFuzzer or AFL++ fuzz targets (LLVMFuzzerTestOneInput, __AFL_LOOP)", - languages=C_AND_CXX.languages, + languages=C_FAMILY, path=re.compile(r"\.(?:c|cc|cpp|cxx|C)$"), # On a line where no `//` comment comes first (ghostty's shim names __AFL_LOOP in a comment only). contains=re.compile(r"^[^/\n]*(?:\bLLVMFuzzerTestOneInput\b|__AFL_LOOP|__AFL_FUZZ_TESTCASE_BUF)", re.MULTILINE), ) C_PROPERTY_TESTS = PropertyTests( name="RapidCheck tests", - languages=C_AND_CXX.languages, + languages=C_FAMILY, path=re.compile(r"\.(?:c|cc|cpp|cxx|C|h|hpp)$"), contains=re.compile(r"\brc::check\b|\bRC_GTEST_PROP\b|\bRC_BOOST_PROP\b"), ) @@ -42,7 +42,7 @@ def _libfuzzer_binary(command: Command, facts: Facts) -> Run | None: LIBFUZZER = fuzzer( name="libFuzzer", - languages=C_AND_CXX.languages, + languages=C_FAMILY, how="a fuzz target binary with -max_total_time= (or ClusterFuzzLite or CIFuzz)", runs=_libfuzzer_binary, targets=(C_FUZZ_TARGETS,), @@ -50,7 +50,7 @@ def _libfuzzer_binary(command: Command, facts: Facts) -> Run | None: AFL = fuzzer( name="AFL++", - languages=C_AND_CXX.languages, + languages=C_FAMILY, how="afl-fuzz -i -o -- ", runs=when(all_of(starts(("afl-fuzz",)), lambda command: not dotnet_target(command)), fuzzed), targets=(C_FUZZ_TARGETS,), diff --git a/project_validator/ecosystems/c_cpp/layout.py b/project_validator/c_family/layout.py similarity index 98% rename from project_validator/ecosystems/c_cpp/layout.py rename to project_validator/c_family/layout.py index 396eeec5..d8f66a23 100644 --- a/project_validator/ecosystems/c_cpp/layout.py +++ b/project_validator/c_family/layout.py @@ -1,4 +1,4 @@ -"""How a C/C++ build is laid out for the people and tools that use it: in-source builds are prevented +"""How a C or C++ build is laid out for the people and tools that use it: in-source builds are prevented (`out-of-source-build`), `compile_commands.json` is exported for clang-based tooling (`compile-commands`), and the tests and developer-only settings are guarded for a consumer that builds the project as a subproject (`top-level-guard`). Each is read from the build files: what an `if()` guards on is a `guard` setting the evaluators record, as written. diff --git a/project_validator/ecosystems/c_cpp/mutation.py b/project_validator/c_family/mutation.py similarity index 87% rename from project_validator/ecosystems/c_cpp/mutation.py rename to project_validator/c_family/mutation.py index 8125c06e..0b0d73e6 100644 --- a/project_validator/ecosystems/c_cpp/mutation.py +++ b/project_validator/c_family/mutation.py @@ -4,7 +4,7 @@ from __future__ import annotations -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.model import C_FAMILY from project_validator.facts.mutation import mutated, mutation_tool from project_validator.facts.settings import file_reader from project_validator.facts.tools import defined_by, starts, when @@ -14,14 +14,14 @@ MULL = mutation_tool( name="Mull", - languages=C_AND_CXX.languages, + languages=C_FAMILY, how="mull-runner", runs=when(starts(("mull-runner",), ("mull-cxx",)), mutated), defined=defined_by(files=(MULL_SETTINGS.name,)), ) DEXTOOL = mutation_tool( name="dextool mutate", - languages=C_AND_CXX.languages, + languages=C_FAMILY, how="dextool mutate", runs=when(starts(("dextool", "mutate")), mutated), defined=defined_by(files=(DEXTOOL_SETTINGS.name,)), diff --git a/project_validator/ecosystems/c_cpp/sanitizers.py b/project_validator/c_family/sanitizers.py similarity index 96% rename from project_validator/ecosystems/c_cpp/sanitizers.py rename to project_validator/c_family/sanitizers.py index 46ab46d7..45be9cc1 100644 --- a/project_validator/ecosystems/c_cpp/sanitizers.py +++ b/project_validator/c_family/sanitizers.py @@ -1,4 +1,4 @@ -"""C/C++ sanitizers: AddressSanitizer and UndefinedBehaviorSanitizer are used in at least one configuration of the +"""C and C++ sanitizers: AddressSanitizer and UndefinedBehaviorSanitizer are used in at least one configuration of the build, whatever the compiler: `-fsanitize=address,undefined` (MSVC's `/fsanitize=address`) among the build files' options, on a CI command line, behind an option CI turns on (cmake_template's `ENABLE_SANITIZER_ADDRESS` and `ENABLE_SANITIZER_UNDEFINED_BEHAVIOR`, with or without a project prefix), or Meson's `b_sanitize`. ThreadSanitizer and diff --git a/project_validator/checks/cxx_extensions.py b/project_validator/checks/compiler_extensions.py similarity index 54% rename from project_validator/checks/cxx_extensions.py rename to project_validator/checks/compiler_extensions.py index f7292b71..7fe5569d 100644 --- a/project_validator/checks/cxx_extensions.py +++ b/project_validator/checks/compiler_extensions.py @@ -1,4 +1,5 @@ -"""C and C++ are compiled as standardised, without the compilers' extensions (-std=c++NN rather than -std=gnu++NN).""" +"""Code is compiled as standardised, without the compilers' extensions: -std=c++NN rather than -std=gnu++NN for C++, +-std=cNN rather than -std=gnuNN for C, a standard -std= for Fortran.""" from __future__ import annotations @@ -7,10 +8,11 @@ from project_validator.policy.practices import judge_any_one from project_validator.questions.practices import practice_answers -cxx_extensions = answered_check( +compiler_extensions = answered_check( name=PracticeName.EXTENSIONS, - description="Compiler extensions are disabled (-std=c++NN rather than -std=gnu++NN)", + description="Compiler extensions are disabled (-std=c++NN or -std=cNN rather than -std=gnu++NN or -std=gnuNN)", languages=handled(PracticeName.EXTENSIONS), answers=practice_answers(PracticeName.EXTENSIONS), judge=judge_any_one, + aliases=("cxx-extensions",), ) diff --git a/project_validator/checks/sanitizers.py b/project_validator/checks/sanitizers.py index 4cb1344c..057f88ab 100644 --- a/project_validator/checks/sanitizers.py +++ b/project_validator/checks/sanitizers.py @@ -1,5 +1,5 @@ -"""Sanitizers are used: AddressSanitizer and UndefinedBehaviorSanitizer in some configuration of a C/C++ build (one of -the two warns, neither fails), Miri or `-Zsanitizer` for Rust, the race detector (`go test -race`) for Go. Which +"""Sanitizers are used: AddressSanitizer and UndefinedBehaviorSanitizer in some configuration of a C or C++ build (one +of the two warns, neither fails), Miri or `-Zsanitizer` for Rust, the race detector (`go test -race`) for Go. Which sanitizers, where `ci-build-types` asks that each platform builds with and without any.""" from __future__ import annotations @@ -12,7 +12,7 @@ sanitizers = answered_check( name=PracticeName.SANITIZERS, description="Sanitizers are used in some configuration: AddressSanitizer and UndefinedBehaviorSanitizer for " - "C/C++ (one of the two warns), cargo miri test or -Zsanitizer for Rust, go test -race for Go", + "C and C++ (one of the two warns), cargo miri test or -Zsanitizer for Rust, go test -race for Go", languages=handled(PracticeName.SANITIZERS), answers=sanitizer_answers, judge=judge_settings, diff --git a/project_validator/checks/tests_run.py b/project_validator/checks/tests_run.py index 251dcb10..42109077 100644 --- a/project_validator/checks/tests_run.py +++ b/project_validator/checks/tests_run.py @@ -7,7 +7,7 @@ tests_run = answered_check( name="tests-run", - description="Tests exist (registered with CTest or Meson for C/C++) and CI runs them", + description="Tests exist (registered with CTest or Meson for C and C++) and CI runs them", aspect=TEST, answers=tests, judge=judge_tests, diff --git a/project_validator/ci/__init__.py b/project_validator/ci/__init__.py index 70575a73..0244efcf 100644 --- a/project_validator/ci/__init__.py +++ b/project_validator/ci/__init__.py @@ -233,13 +233,33 @@ def job_facts(facts: Facts, project: Project) -> Iterator[Job]: by_job.setdefault(fact.job, []).append(fact) pinned = pinned_versions(project) compiled = _compiles(facts) + within = _project_families(facts) return ( - _job(job, tuple(by_job.get(job.id, ())), project, pinned, compiled=compiled) + _within(_job(job, tuple(by_job.get(job.id, ())), project, pinned, compiled=compiled), within) for job in facts.of(CiJob) if job.builds ) +def _project_families(facts: Facts) -> frozenset[str]: + """The labels of the ecosystems of a family (C and C++) that are not the project's while another of the family + is: a job that runs cmake in a C++ project builds C++, not C.""" + from project_validator.facts.structure import project_languages # structure reads the profiles + + languages = project_languages(facts) + return frozenset( + ecosystem.label + for ecosystem in registered() + if ecosystem.family is not None + and not ecosystem.languages & languages + and any(other.family == ecosystem.family and other.languages & languages for other in registered()) + ) + + +def _within(job: Job, others: frozenset[str]) -> Job: + return replace(job, ecosystems=job.ecosystems - others) if job.ecosystems & others else job + + def _compiles(facts: Facts) -> bool: """Whether the project compiles C, C++ or Fortran (or shows no language at all, as a bare CI file does).""" from project_validator.facts.structure import project_languages # structure reads the profiles diff --git a/project_validator/cli.py b/project_validator/cli.py index c2c0765d..3cb5cecd 100644 --- a/project_validator/cli.py +++ b/project_validator/cli.py @@ -3,6 +3,7 @@ from __future__ import annotations import argparse +import contextlib import json import os import sys @@ -10,16 +11,22 @@ from collections.abc import Sequence from pathlib import Path, PurePosixPath -from project_validator import pretty, yaml_support -from project_validator.core import DEFAULT_MAX_FILE_SIZE, Check, Context, ExtractionError, Options, Project +from project_validator import yaml_support +from project_validator.analysis import Analysis, analyse +from project_validator.core import DEFAULT_MAX_FILE_SIZE, Check, Context, ExtractionError, Observer, Options, Project from project_validator.ecosystems import applies_to +from project_validator.explanations import explain from project_validator.facts.auxiliary import Selectors from project_validator.grid import render_grid from project_validator.plugins import PluginError, discover from project_validator.questions.answers import answers -from project_validator.runner import Report, SelectionError, run_checks, select, succeeded -from project_validator.score import SCORE_VERSION, Score, score +from project_validator.runner import Report, SelectionError, select, succeeded from project_validator.support_matrix import as_dict, render, support_matrix +from project_validator.views import console as console_view +from project_validator.views import html as html_view +from project_validator.views import text as text_view +from project_validator.views import tui as tui_view +from project_validator.views.progress import ProgressView EXIT_SUCCESS = 0 EXIT_FAILURE = 1 @@ -85,6 +92,11 @@ def _add_listing_options(parser: argparse.ArgumentParser) -> None: ) for name, what in _DUMPS.items(): parser.add_argument(f"--{name}", action="store_true", help=f"print {what} as JSON and exit") + parser.add_argument( + "--explain", + metavar="CHECK", + help="explain a check: what it looks for, why it matters, and the tools it recognises for each language", + ) def _add_scope_options(parser: argparse.ArgumentParser) -> None: @@ -103,7 +115,7 @@ def _add_scope_options(parser: argparse.ArgumentParser) -> None: default=[], metavar="WHAT", help="judge this code as auxiliary, not the product's: by role (tooling, docs, example, benchmark, test), " - "language or ecosystem (python, c/c++), or directory (scripts/); its failures are warnings, labelled; " + "language or ecosystem (python, c++), or directory (scripts/); its failures are warnings, labelled; " "may be repeated", ) @@ -112,9 +124,19 @@ def _add_output_options(parser: argparse.ArgumentParser) -> None: """The options that choose how the results are printed.""" parser.add_argument( "--format", - choices=("text", "json", "markdown"), + choices=("text", "json", "markdown", "html"), default="text", - help="output format (markdown: a grid of checks by ecosystem, for a job summary)", + help="output format (text: in color with rich on a terminal; markdown: a grid of checks by language, for a " + "job summary; html: the self-contained HTML report)", + ) + parser.add_argument( + "--html", type=Path, metavar="FILE", help="also write the self-contained HTML report of the findings to FILE" + ) + parser.add_argument( + "-v", "--verbose", action="store_true", help="show every detail, the checks that do not apply and the stages" + ) + parser.add_argument( + "--tui", action="store_true", help="browse the results and the facts interactively (needs textual)" ) parser.add_argument( "--color", choices=("auto", "always", "never"), default="auto", help="color the text output (needs rich)" @@ -122,8 +144,9 @@ def _add_output_options(parser: argparse.ArgumentParser) -> None: parser.add_argument( "--score", action="store_true", - help="also score the project's tooling: its level, completeness and depth, and the next steps that raise " - "them (a preview; the statuses and exit code do not change)", + help="also score the project's tooling: the share of the quality gates that apply to it that are in place " + "(100%%: all of them; extra credit above for complementary tools), its level, and the next steps (the " + "statuses and exit code do not change)", ) @@ -160,14 +183,6 @@ def _options(arguments: argparse.Namespace) -> Options: ) -def _format_text(reports: list[Report]) -> str: - lines: list[str] = [] - for report in reports: - lines.append(f"[{report.result.status}] {report.check.name}: {report.result.message}") - lines.extend(f" {detail}" for detail in report.result.details) - return "\n".join(lines) - - def report_dicts(reports: list[Report]) -> list[dict[str, object]]: """The reports as `--format json` prints them: each check's result, and one result per ecosystem in each unit (the places), as the markdown grid lays them out.""" @@ -204,15 +219,6 @@ def _use_color(choice: str) -> bool: return choice == "always" -def _print_text(reports: list[Report], color: bool) -> None: - if color and pretty.available(): - pretty.print_reports(reports, sys.stdout) - return - if color: - print("note: install rich for colored output", file=sys.stderr) - print(_format_text(reports)) - - def _format_list(checks: Sequence[Check]) -> str: width = max((len(c.name) for c in checks), default=0) return "\n".join(f"{c.name:<{width}} {c.description}" for c in checks) @@ -250,32 +256,34 @@ def _usage_error(parser: argparse.ArgumentParser, message: str) -> int: return EXIT_USAGE -NEXT_STEPS = 5 # how many opportunities the text and markdown reports list - - -def _score_lines(scored: Score, *, markdown: bool) -> list[str]: - title = f"Score (preview v{SCORE_VERSION}):" - lines = [f"**{title}** {scored.summary()}" if markdown else f"{title} {scored.summary()}"] - if scored.opportunities: - lines.append("Next:") - lines.extend(f" - {opportunity.describe()}" for opportunity in scored.opportunities[:NEXT_STEPS]) - return lines - - -def _print_reports(reports: list[Report], arguments: argparse.Namespace, every_check: Sequence[str]) -> None: - scored = score(reports, every_check) if arguments.score else None +def _print_analysis(analysis: Analysis, arguments: argparse.Namespace) -> None: + """Print the analysis in the format asked for, and write the HTML report when `--html` asks for one.""" + if arguments.html is not None: + arguments.html.write_text(html_view.render(analysis), encoding="utf-8") + reports = list(analysis.reports) if arguments.format == "json": - if scored is None: - print(_format_json(reports)) - else: - print(json.dumps({"results": report_dicts(reports), "score": scored.as_dict()}, indent=2)) - return - if arguments.format == "markdown": + results = report_dicts(reports) + scored = analysis.score.as_dict() if arguments.score and analysis.score else None + print(json.dumps(results if scored is None else {"results": results, "score": scored}, indent=2)) + elif arguments.format == "html": + print(html_view.render(analysis), end="") + elif arguments.format == "markdown": print(render_grid(reports), end="") + if arguments.score and analysis.score is not None: + print("\n" + "\n".join(text_view.score_lines(analysis.score, markdown=True))) + elif _use_color(arguments.color) and console_view.available(): + console_view.render(analysis, sys.stdout, verbose=arguments.verbose) else: - _print_text(reports, _use_color(arguments.color)) - if scored is not None: - print("\n" + "\n".join(_score_lines(scored, markdown=arguments.format == "markdown"))) + if _use_color(arguments.color): + print("note: install rich for colored output (pip install project_validator[pretty])", file=sys.stderr) + print(text_view.render(analysis, scored=arguments.score)) + + +def _progress(arguments: argparse.Namespace) -> contextlib.AbstractContextManager[Observer | None]: + """Progress on stderr while the validator works, when stderr is a terminal and rich is installed.""" + if arguments.tui or not sys.stderr.isatty() or not console_view.available() or arguments.color == "never": + return contextlib.nullcontext(None) + return ProgressView(sys.stderr) def _dump(context: Context, arguments: argparse.Namespace) -> object: @@ -301,6 +309,13 @@ def main(argv: Sequence[str] | None = None) -> int: if arguments.list or arguments.support_matrix: _print_listing(plugins.checks, arguments) return EXIT_SUCCESS + if arguments.explain: + try: + (found,) = select(plugins.checks, [arguments.explain]) + except SelectionError as error: + return _usage_error(parser, str(error)) + print("\n".join(explain(found, tuple(plugins.checks)).lines())) + return EXIT_SUCCESS if not yaml_support.available(): return _usage_error(parser, yaml_support.MISSING_MESSAGE) if not arguments.path.is_dir(): @@ -318,7 +333,7 @@ def _run( selected: list[Check], every_check: Sequence[str], ) -> int: - """Print what was asked (a dump, or the reports) and say how it went; `every_check` names every check there is, + """Print what was asked (a dump, or the analysis) and say how it went; `every_check` names every check there is, for the score.""" if arguments.facts or arguments.map or arguments.answers: try: @@ -326,11 +341,14 @@ def _run( except ExtractionError as failed: return _extraction_failed(parser, failed) return EXIT_SUCCESS - reports = run_checks(selected, context) - _print_reports(reports, arguments, every_check) - if (cause := context.extraction_error) is not None: + if arguments.tui: + return tui_view.run(context, selected, every_check) + with _progress(arguments) as progress: + analysis = analyse(context, selected, every_check=every_check, progress=progress) + _print_analysis(analysis, arguments) + if (cause := analysis.error) is not None: return _extraction_failed(parser, cause) - return EXIT_SUCCESS if succeeded(reports, strict=arguments.strict) else EXIT_FAILURE + return EXIT_SUCCESS if succeeded(list(analysis.reports), strict=arguments.strict) else EXIT_FAILURE def _extraction_failed(parser: argparse.ArgumentParser, failed: ExtractionError) -> int: diff --git a/project_validator/components.py b/project_validator/components.py index 7c3fb12c..f5483b18 100644 --- a/project_validator/components.py +++ b/project_validator/components.py @@ -1,9 +1,10 @@ """Components (command expanders, actions, settings readers, tools, questions) are found in the modules that define them, never listed. -A built-in component lives in a module of the shared build systems (`project_validator.build_systems`), the shared -tools (`project_validator.tools`), the questions (`project_validator.questions`), or the profile of the only language -that uses it (see docs/architecture.md). A plugin's components live in its own module (see `add_plugin_modules`). +A built-in component lives in a module of the shared build systems (`project_validator.build_systems`), the C family +(`project_validator.c_family`: what C and C++ share), the shared tools (`project_validator.tools`), the questions +(`project_validator.questions`), or the profile of the only language that uses it (see docs/architecture.md). A plugin's +components live in its own module (see `add_plugin_modules`). """ from __future__ import annotations @@ -20,6 +21,7 @@ # The packages whose modules may define components, besides the profiles. _PACKAGES = ( "project_validator.build_systems", + "project_validator.c_family", "project_validator.ci", "project_validator.tools", "project_validator.questions", diff --git a/project_validator/core.py b/project_validator/core.py index 948bb9a8..58c1d07f 100644 --- a/project_validator/core.py +++ b/project_validator/core.py @@ -10,7 +10,7 @@ from dataclasses import dataclass, field from functools import cached_property from pathlib import Path, PurePosixPath -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING, Literal, cast if TYPE_CHECKING: from project_validator.ci import CiAnalysis, CiFile, CiProvider @@ -178,8 +178,19 @@ def _git_tracked_files(self) -> list[str]: if listed.returncode != 0: return self.files() paths = listed.stdout.decode("utf-8", errors="replace").split("\0") + if not any(paths) and self._ignored(git): + return self.files() return sorted(path for path in paths if path and not self._excludes(path) and (self.root / path).is_file()) + def _ignored(self, git: str) -> bool: + """Whether the checkout around the project ignores its directory (mutmut's mutants/): then it is no checkout of + the project, and every file counts as tracked.""" + root = self.root.resolve() + ignored = subprocess.run( # noqa: S603 - argv list, no shell + [git, "-C", str(root.parent), "check-ignore", "-q", root.name], capture_output=True, check=False + ) + return ignored.returncode == 0 + def _excludes(self, relative: str) -> bool: return any(parent in self.excluded for parent in PurePosixPath(relative).parents) @@ -214,6 +225,23 @@ def __init__(self, stage: str, error: Exception) -> None: self.error = error +@dataclass(frozen=True, slots=True, kw_only=True) +class Progress: + """What the validator is doing, for a view to show while it works: an extraction stage or a check, starting or + done. A stage that is done says how long it took and how many facts it `found`; a check is `index` of `total`.""" + + kind: Literal["stage", "check"] + name: str + done: bool + seconds: float = 0.0 + found: int = 0 + index: int = 0 + total: int = 0 + + +type Observer = Callable[[Progress], None] + + class Context: """Everything a check may inspect; CI discovery is computed once and shared between checks.""" @@ -223,6 +251,15 @@ def __init__(self, project: Project, providers: tuple[CiProvider, ...], options: self.options = options self._shared: dict[str, object] = {} self._extracted: Facts | ExtractionError | None = None + self._observers: list[Observer] = [] + + def observe(self, observer: Observer) -> None: + """Have `observer` told what the validator does from now on (see `Progress`).""" + self._observers.append(observer) + + def notify(self, event: Progress) -> None: + for observer in self._observers: + observer(event) def shared[T](self, key: str, compute: Callable[[], T]) -> T: """What `compute` returns, computed once: extractors that read the same files (CMake's, for its facts and its diff --git a/project_validator/ecosystems/__init__.py b/project_validator/ecosystems/__init__.py index 8dcc030d..065e3620 100644 --- a/project_validator/ecosystems/__init__.py +++ b/project_validator/ecosystems/__init__.py @@ -140,6 +140,15 @@ def isolated_registry() -> Iterator[None]: forget() +def families() -> tuple[frozenset[str], ...]: + """The languages of each family of ecosystems (see `Ecosystem.family`).""" + found: dict[str, frozenset[str]] = {} + for ecosystem in _registered: + if ecosystem.family is not None: + found[ecosystem.family] = found.get(ecosystem.family, frozenset()) | ecosystem.languages + return tuple(found.values()) + + def build_systems() -> tuple[BuildSystem, ...]: return tuple(system for ecosystem in _registered for system in ecosystem.build_systems) @@ -170,6 +179,7 @@ def is_build_tree(directory: Path) -> bool: "build_systems", "claim_conflicts", "ecosystems_for", + "families", "formats", "is_build_tree", "isolated_registry", diff --git a/project_validator/ecosystems/c.py b/project_validator/ecosystems/c.py new file mode 100644 index 00000000..90355e90 --- /dev/null +++ b/project_validator/ecosystems/c.py @@ -0,0 +1,63 @@ +"""C: built with CMake or Meson, judged by its compilers. C and C++ are separate languages and separate ecosystems, +which share their build systems, CI programs and tools (`project_validator.c_family`); C is judged on its own, with +C's flags (`CMAKE_C_FLAGS`, `c_std`), never C++'s. A project with neither build system is judged as a CMake project. + +The shape of a C-family ecosystem (`c_family_ecosystem`) is here, and the C++ profile builds its ecosystem with it. +""" + +from __future__ import annotations + +import re +from collections.abc import Mapping +from types import MappingProxyType + +from project_validator.build_systems.cmake.build import CMAKE +from project_validator.build_systems.meson.build import MESON +from project_validator.ecosystems.model import Ecosystem + +# Building C or C++, as opposed to running another ecosystem's tools on a runner that has a C or C++ compiler. +# The build tools a CI job builds C or C++ with, and what else in a job shows it does: a source file, a compiler. +CI_PROGRAMS = tuple( + (program,) + for program in ( + # Not make, which runs whatever a Makefile says (`make lint` in a Python project), nor devenv alone, which is + # Nix's devenv too: Visual Studio's names a solution (see CI_USAGE). + *("cmake", "ctest", "meson", "ninja", "msbuild", "bazel", "conan", "vcpkg"), + *("xmake", "premake", "premake4", "premake5", "scons"), + ) +) +CI_USAGE = re.compile( + r"\.(?:c|cc|cpp|cxx)\b|\bg\+\+(?!-multilib)|\bgcc\b(?!-multilib)|\bclang(?:\+\+|-cl)?\b|\bcl\.exe\b" + r"|\bdevenv(?:\.exe|\.com)?\s+\S+\.sln\b" +) + + +# The suffixes only one of the two languages uses. +C_SOURCES = {".c": "C"} +CXX_SOURCES = dict.fromkeys((".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx", ".ixx", ".cppm"), "C++") +# Headers (and included .inc files) do not tell C from C++: each is the language of the sources around it (see +# `facts.structure`). CMake modules belong to a C or C++ project only once it is recognised, as other ecosystems use +# some of these suffixes too, and the C++ template files to a C++ one. +SHARED_HEADERS = (".h", ".inc") +CXX_TEMPLATES = dict.fromkeys((".inl", ".ipp", ".tpp", ".txx"), "C++") + + +def c_family_ecosystem( + language: str, sources: Mapping[str, str], ambiguous: Mapping[str, str] = MappingProxyType({}) +) -> Ecosystem: + """The ecosystem of C or C++ (`language`): its own `sources`, the shared headers, CMake modules, and any more + `ambiguous` suffixes of its own.""" + return Ecosystem( + label=language, + languages=frozenset({language}), + build_systems=(CMAKE, MESON), + default_build_system=CMAKE, + ci_programs=CI_PROGRAMS, + ci_usage=CI_USAGE, + source_suffixes=dict(sources), + ambiguous_suffixes={**dict.fromkeys(SHARED_HEADERS, language), ".cmake": None, **ambiguous}, + family="C family", + ) + + +C = c_family_ecosystem("C", C_SOURCES) diff --git a/project_validator/ecosystems/c_cpp/__init__.py b/project_validator/ecosystems/c_cpp/__init__.py deleted file mode 100644 index ff5af201..00000000 --- a/project_validator/ecosystems/c_cpp/__init__.py +++ /dev/null @@ -1,92 +0,0 @@ -"""C and C++: built with CMake or Meson, judged by their compilers. - -Rules that depend on the build system are in the `cmake` and `meson` modules; a project with neither is judged as a -CMake project. -""" - -from __future__ import annotations - -import re - -from project_validator.build_systems.cmake.build import CMAKE -from project_validator.build_systems.meson.build import MESON -from project_validator.ecosystems.c_cpp.compiler_flags import builds_c_or_cxx -from project_validator.ecosystems.model import C_FAMILY, Ecosystem -from project_validator.facts.axes import ToolchainAxis -from project_validator.facts.jobs import Job -from project_validator.facts.outputs import BuildOutput, directories, ignored_at_top_level - -# Building C or C++, as opposed to running another ecosystem's tools on a runner that has a C/C++ compiler. -# The build tools a CI job builds C or C++ with, and what else in a job shows it does: a source file, a compiler. -CI_PROGRAMS = tuple( - (program,) - for program in ( - # Not make, which runs whatever a Makefile says (`make lint` in a Python project), nor devenv alone, which is - # Nix's devenv too: Visual Studio's names a solution (see CI_USAGE). - *("cmake", "ctest", "meson", "ninja", "msbuild", "bazel", "conan", "vcpkg"), - *("xmake", "premake", "premake4", "premake5", "scons"), - ) -) -CI_USAGE = re.compile( - r"\.(?:c|cc|cpp|cxx)\b|\bg\+\+(?!-multilib)|\bgcc\b(?!-multilib)|\bclang(?:\+\+|-cl)?\b|\bcl\.exe\b" - r"|\bdevenv(?:\.exe|\.com)?\s+\S+\.sln\b" -) - - -def _compilers(job: Job) -> frozenset[str]: - return job.compilers if builds_c_or_cxx(job) else frozenset() - - -def _uses_runner_default_compiler(job: Job) -> bool: - return job.default_compiler and builds_c_or_cxx(job) - - -COMPILERS = ToolchainAxis( - languages=C_FAMILY, noun="compiler", of_job=_compilers, runner_default=_uses_runner_default_compiler, compiled=True -) - - -BUILD_DIRECTORY = BuildOutput( - languages=C_FAMILY, - name="the build directory", - globs=ignored_at_top_level(r"(?:\[Bb\]uild|_?build|out|cmake-build)(?:[-_*][\w*-]*)?"), - paths=directories("build", "out", "_build", "cmake-build-debug"), - hint="consider ignoring the build directory (e.g. build/ and out/)", - artifacts=( - *("*.o", "*.obj", "*.a", "*.lib", "*.so", "*.so.*", "*.dylib", "*.dll", "*.exe", "*.pdb", "*.ilk"), - *("CMakeCache.txt", "CMakeFiles/", "CMakeUserPresets.json", "cmake-build-*/"), - *("/build/", "/out/", "/builddir/"), - ), -) - -# `.h` is deliberately absent: it is used by both C and C++. -C_AND_CXX = Ecosystem( - label="C/C++", - languages=C_FAMILY, - build_systems=(CMAKE, MESON), - default_build_system=CMAKE, - ci_programs=CI_PROGRAMS, - ci_usage=CI_USAGE, - source_suffixes={ - ".c": "C", - ".cpp": "C++", - ".cc": "C++", - ".cxx": "C++", - ".hpp": "C++", - ".hh": "C++", - ".hxx": "C++", - ".ixx": "C++", - ".cppm": "C++", - }, - # Headers (and included .inc files) do not tell C from C++, and CMake modules and C++ template files belong to - # a C/C++ project only once it is recognised: other ecosystems use some of these suffixes too. - ambiguous_suffixes={ - ".h": None, - ".inc": None, - ".cmake": None, - ".inl": "C++", - ".ipp": "C++", - ".tpp": "C++", - ".txx": "C++", - }, -) diff --git a/project_validator/ecosystems/c_cpp/compiler_flags.py b/project_validator/ecosystems/c_cpp/compiler_flags.py deleted file mode 100644 index da4f70d9..00000000 --- a/project_validator/ecosystems/c_cpp/compiler_flags.py +++ /dev/null @@ -1,93 +0,0 @@ -"""C/C++ compiler flags: the strict warning set and warnings as errors, for each compiler CI builds with, and security -hardening.""" - -from __future__ import annotations - -from project_validator.ecosystems.model import C_FAMILY -from project_validator.facts import Facts -from project_validator.facts.flags import errors_requirements, flag_requirements, warning_requirements -from project_validator.facts.jobs import Job -from project_validator.facts.practices import Practice, PracticeName, Requirement, Wording -from project_validator.tools.toolchains import ( - FHARDENED, - GCC_HARDENING, - MSVC_HARDENING, - hardening_flags, - warning_flags, - warnings_as_errors_flag, -) - -# The readers of the build files whose options the compiler flags are found among. -BUILD_FILES = ("CMake", "Meson") -PRESET_FILES = ("CMakePresets.json", "CMakeUserPresets.json") - - -# --- warnings and warnings as errors - - -def builds_c_or_cxx(job: Job) -> bool: - """A job that names a compiler builds C/C++; one that only uses its runner's default compiler builds C/C++ - unless it is seen using another ecosystem's tools and not C/C++ build tools.""" - return not job.default_compiler or not job.ecosystems or "C/C++" in job.ecosystems - - -def ci_compilers(facts: Facts) -> tuple[str, ...]: - """The compilers CI builds C/C++ with; GCC's flags are asked for when CI names none.""" - found = {compiler for job in facts.of(Job) if builds_c_or_cxx(job) for compiler in job.compilers} - return tuple(sorted(found)) or ("gcc",) - - -def _warnings(_facts: Facts, compiler: str | None) -> tuple[Requirement, ...]: - return warning_requirements(warning_flags(compiler or "gcc"), C_FAMILY) - - -def _errors(_facts: Facts, compiler: str | None) -> tuple[Requirement, ...]: - return errors_requirements(warnings_as_errors_flag(compiler or "gcc"), C_FAMILY) - - -WARNINGS = Practice( - name=PracticeName.WARNINGS, - languages=C_FAMILY, - requirements=_warnings, - reads=BUILD_FILES, - compilers=ci_compilers, - words=Wording( - kind="compiler warning flags", - separator=" ", - hint="enable -Wall -Wextra -Wpedantic -Wshadow -Wconversion (MSVC: /W4 /permissive-) for each compiler CI uses", - ), -) -WARNINGS_AS_ERRORS = Practice( - name=PracticeName.WARNINGS_AS_ERRORS, - languages=C_FAMILY, - requirements=_errors, - any_one=True, - reads=BUILD_FILES, - compilers=ci_compilers, - words=Wording( - kind="warnings as errors", - searched="CI configuration or the build files (CMake files, presets, meson.build)", - hint="add -Werror (GCC/Clang), /WX (MSVC) or set CMAKE_COMPILE_WARNING_AS_ERROR (Meson: werror=true), " - "at least as an option", - ), -) - -# --- hardening - - -def _hardening(_facts: Facts, compiler: str | None) -> tuple[Requirement, ...]: - return flag_requirements(hardening_flags(compiler or "gcc"), C_FAMILY) - - -HARDENING = Practice( - name=PracticeName.HARDENING, - languages=C_FAMILY, - requirements=_hardening, - reads=BUILD_FILES, - compilers=ci_compilers, - words=Wording( - kind="hardening options", - hint=f"enable {FHARDENED} (GCC 14+) or {', '.join(flag.name for flag in GCC_HARDENING)}; for MSVC " - f"{', '.join(flag.name for flag in MSVC_HARDENING)}", - ), -) diff --git a/project_validator/ecosystems/cpp.py b/project_validator/ecosystems/cpp.py new file mode 100644 index 00000000..a76cb6a1 --- /dev/null +++ b/project_validator/ecosystems/cpp.py @@ -0,0 +1,9 @@ +"""C++: built with CMake or Meson, judged by its compilers. C++ is judged on its own, with C++'s flags +(`CMAKE_CXX_FLAGS`, `cpp_std`), never C's; what the two share is in `project_validator.c_family`, and the shape of +their ecosystems in the C profile.""" + +from __future__ import annotations + +from project_validator.ecosystems.c import CXX_SOURCES, CXX_TEMPLATES, c_family_ecosystem + +CXX = c_family_ecosystem("C++", CXX_SOURCES, CXX_TEMPLATES) diff --git a/project_validator/ecosystems/fortran.py b/project_validator/ecosystems/fortran.py index 3547c107..8717439a 100644 --- a/project_validator/ecosystems/fortran.py +++ b/project_validator/ecosystems/fortran.py @@ -136,7 +136,7 @@ def _fpm_test(command: Command, _facts: Facts) -> Run | None: def builds_fortran(job: Job) -> bool: """A job builds Fortran when it is seen doing so, or building with the tools Fortran shares with C and C++.""" - return not job.ecosystems or bool({FORTRAN, "C/C++"} & job.ecosystems) + return not job.ecosystems or bool({FORTRAN, "C", "C++"} & job.ecosystems) def _compilers(job: Job) -> frozenset[str]: diff --git a/project_validator/ecosystems/javascript/__init__.py b/project_validator/ecosystems/javascript/__init__.py index 323e2625..237a6f6e 100644 --- a/project_validator/ecosystems/javascript/__init__.py +++ b/project_validator/ecosystems/javascript/__init__.py @@ -1,5 +1,10 @@ -"""JavaScript and TypeScript: packaged with package.json (npm, pnpm, yarn, bun) or deno.json, judged by the Node.js, -Deno and Bun versions CI runs. +"""JavaScript: packaged with package.json (npm, pnpm, yarn, bun) or deno.json, judged by the Node.js, Deno and Bun +versions CI runs. + +TypeScript is a separate language and ecosystem (`project_validator.ecosystems.typescript`) built on JavaScript's +platform: it shares this profile's build systems, runtimes and tools (their `JS_LANGUAGES` are both), and only +TypeScript is asked for type checking, its defining gate. JavaScript tool configuration (`eslint.config.js`) in a +TypeScript project is configuration, not JavaScript code. Much of a JavaScript project's tooling runs through the scripts of its package.json (`npm run lint`), so the scripts CI runs count as CI configuration wherever a rule reads more than CI configuration. @@ -695,27 +700,46 @@ def _pnpm_runtime(inputs: Mapping[str, str]) -> str | None: re.compile(r"\boven/bun:(\d+(?:\.\d+)*)"), ) -JAVASCRIPT_AND_TYPESCRIPT = Ecosystem( - label="JavaScript/TypeScript", - languages=frozenset({JAVASCRIPT, TYPESCRIPT}), - build_systems=(NPM, DENO), - source_suffixes={ - **dict.fromkeys(JS_SUFFIXES, JAVASCRIPT), - **dict.fromkeys(TS_SUFFIXES, TYPESCRIPT), - }, - toolchain=toolchain_patterns( - "JavaScript runtime", - more=RUNTIME_VERSIONS, - # Not npx alone: other ecosystems' CI runs tools such as jscpd with it. - programs=( - *subcommands("npm", "ci", "install", "i", "test", "t", "run"), - *("pnpm", "yarn", "node"), - *subcommands("deno", "test", "task", "run", "check", "lint", "fmt"), - *subcommands("bun", "install", "test", "run"), - ), - setup=("deno", "bun"), - steps=(("actions/setup-node", _setup_node), ("pnpm/setup", _pnpm_runtime)), - ), +# The tool configuration written in JavaScript, which a TypeScript project's tools read: configuration, not sources. +TOOL_CONFIGURATION = ( + "*.config.js", + "*.config.mjs", + "*.config.cjs", + ".*rc.js", + ".*rc.cjs", + ".*rc.mjs", + "gulpfile.js", + "Gruntfile.js", + "Jakefile.js", ) + +def ecmascript_ecosystem(language: str, suffixes: tuple[str, ...]) -> Ecosystem: + """The ecosystem of JavaScript or TypeScript (`language`, recognised by its `suffixes`): separate languages, which + share package.json, Deno, their runtimes and their tools (this profile's components).""" + return Ecosystem( + label=language, + languages=frozenset({language}), + build_systems=(NPM, DENO), + source_suffixes=dict.fromkeys(suffixes, language), + family="ECMAScript", + tool_configuration=TOOL_CONFIGURATION if language == JAVASCRIPT else (), + toolchain=toolchain_patterns( + "JavaScript runtime", + more=RUNTIME_VERSIONS, + # Not npx alone: other ecosystems' CI runs tools such as jscpd with it. + programs=( + *subcommands("npm", "ci", "install", "i", "test", "t", "run"), + *("pnpm", "yarn", "node"), + *subcommands("deno", "test", "task", "run", "check", "lint", "fmt"), + *subcommands("bun", "install", "test", "run"), + ), + setup=("deno", "bun"), + steps=(("actions/setup-node", _setup_node), ("pnpm/setup", _pnpm_runtime)), + ), + ) + + +JAVASCRIPT_ECOSYSTEM = ecmascript_ecosystem(JAVASCRIPT, JS_SUFFIXES) + RUNTIME_AXIS = versions_axis("runtime version", "JavaScript runtime", JS_LANGUAGES) diff --git a/project_validator/ecosystems/javascript/analysis.py b/project_validator/ecosystems/javascript/analysis.py index b3e9bc50..bf3e47c6 100644 --- a/project_validator/ecosystems/javascript/analysis.py +++ b/project_validator/ecosystems/javascript/analysis.py @@ -8,7 +8,13 @@ from collections.abc import Callable from pathlib import PurePosixPath -from project_validator.ecosystems.javascript import DENO_CONFIG_FILES, ESLINT_CONFIG_FILES, JS_LANGUAGES, PACKAGE_JSON +from project_validator.ecosystems.javascript import ( + DENO_CONFIG_FILES, + ESLINT_CONFIG_FILES, + JS_LANGUAGES, + PACKAGE_JSON, + TYPESCRIPT, +) from project_validator.facts import Command, Facts, Setting, resolved from project_validator.facts.analysis import Strictness, analysed, analyzer, type_checked, type_checker from project_validator.facts.arguments import option_values @@ -149,9 +155,9 @@ def _deno_check(command: Command, facts: Facts) -> Run | None: TSC = type_checker( name="tsc", - languages=JS_LANGUAGES, + languages=frozenset({TYPESCRIPT}), can={ - Strictness.CHECKS: "tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json)", + Strictness.CHECKS: "tsc --noEmit", Strictness.STRICT: '"strict": true in the compilerOptions of tsconfig.json', }, checks=_tsc, @@ -160,7 +166,7 @@ def _deno_check(command: Command, facts: Facts) -> Run | None: ) DENO_CHECK = type_checker( name="deno check", - languages=JS_LANGUAGES, + languages=frozenset({TYPESCRIPT}), can={Strictness.CHECKS: "deno check", Strictness.STRICT: "deno check (strict by default)"}, checks=_deno_check, configuration=defined_by(settings=("Deno",)), diff --git a/project_validator/ecosystems/model.py b/project_validator/ecosystems/model.py index 0dd7d6d5..fd1bff5e 100644 --- a/project_validator/ecosystems/model.py +++ b/project_validator/ecosystems/model.py @@ -171,6 +171,12 @@ class Ecosystem: maps to the language it adds, or to None for a file of the ecosystem that adds no language. A project using none of its `build_systems` is taken to use `default_build_system`. + + Ecosystems of one `family` (C and C++; JavaScript and TypeScript) are separate languages that share build files + and tools, so what only says "this family" gives way to the sources: a build file that declares a language of the + family (CMake's default C and C++, package.json's `main`) adds it only where no source of the family says + otherwise, and a source whose name matches `tool_configuration` (`eslint.config.js`) is tool configuration, not + a source of its language, where the family's other languages have sources. """ label: str @@ -187,6 +193,8 @@ class Ecosystem: ci_programs: tuple[tuple[str, ...], ...] = () ci_usage: re.Pattern[str] | None = None default_build_system: BuildSystem | None = None + family: str | None = None + tool_configuration: tuple[str, ...] = () def __post_init__(self) -> None: if self.kind == "format" and self.toolchain is not None: diff --git a/project_validator/ecosystems/typescript.py b/project_validator/ecosystems/typescript.py new file mode 100644 index 00000000..27bdc615 --- /dev/null +++ b/project_validator/ecosystems/typescript.py @@ -0,0 +1,10 @@ +"""TypeScript: JavaScript's platform (package.json or deno.json, the Node.js, Deno and Bun runtimes, and their tools, +in the JavaScript profile), with type checking (tsc, deno check) as its defining gate, which JavaScript is not asked +for. A package.json's `main` names the JavaScript a TypeScript package publishes, which makes it no JavaScript +project.""" + +from __future__ import annotations + +from project_validator.ecosystems.javascript import TS_SUFFIXES, TYPESCRIPT, ecmascript_ecosystem + +TYPESCRIPT_ECOSYSTEM = ecmascript_ecosystem(TYPESCRIPT, TS_SUFFIXES) diff --git a/project_validator/explanations.py b/project_validator/explanations.py new file mode 100644 index 00000000..83b07870 --- /dev/null +++ b/project_validator/explanations.py @@ -0,0 +1,291 @@ +"""Why each check matters, in a sentence or two, and its category, for the reports to explain a result and for +`--explain CHECK`. What a check looks for is its description; the tools it recognises are the support matrix's. + +A plugin's check without an explanation is explained by its description alone. +""" + +from __future__ import annotations + +from collections.abc import Mapping +from dataclasses import dataclass + +from project_validator.core import Check +from project_validator.ecosystems import applies_to +from project_validator.score import LEVEL_NAMES, UNSCORED, level_of +from project_validator.support_matrix import support_matrix + +# The categories the reports group the checks by, in order. +CATEGORIES = ("Build", "Tests", "Analysis", "Security", "CI", "Dependencies", "Repository", "Data and schemas") + + +@dataclass(frozen=True, slots=True) +class Why: + category: str + why: str + + +WHY: Mapping[str, Why] = { + "action-pinning": Why( + "Security", + "A tag can be moved to point at different code; a commit cannot. Pinning each action to a full commit means " + "a compromised or rewritten release can not run in your CI with your secrets.", + ), + "ci-build-types": Why( + "CI", + "Debug and release builds exercise different code: assertions, optimisations and undefined behaviour show up " + "in one and not the other. Building both, with and without sanitizers, everywhere, catches what each hides.", + ), + "ci-lint": Why( + "CI", + "CI configuration is code too. A linter catches the typo that silently skips a job, and the injection or " + "permission mistake that a workflow runs with every push.", + ), + "ci-present": Why( + "CI", + "Every other gate depends on it: a check only protects the project when something runs it on every change.", + ), + "code-formatting": Why( + "Analysis", + "A formatter enforced by CI ends style debates in review and keeps diffs about behaviour, so reviewers read " + "what changed rather than how it was spaced.", + ), + "committed-artifacts": Why( + "Repository", + "Build outputs in version control go stale, bloat every clone, cause merge conflicts and can hide code that " + "does not match its sources.", + ), + "compile-commands": Why( + "Build", + "compile_commands.json is how clang-tidy, clangd and IDEs learn how each file is built. Without it they guess, " + "and analysis is wrong or impossible.", + ), + "compiler-extensions": Why( + "Build", + "Compiler extensions tie the code to one compiler and hide portability bugs. Asking for the standard " + "(-std=c++20, not gnu++20) keeps every compiler honest.", + ), + "compiler-warnings": Why( + "Analysis", + "Warnings are the cheapest static analysis there is: the compiler already knows about conversions, shadowing " + "and unused results. A strict set turns them on.", + ), + "copy-paste-detection": Why( + "Analysis", + "Duplicated code duplicates bugs: a fix applied to one copy leaves the others broken. Detecting copies in CI " + "keeps them from spreading.", + ), + "coverage": Why( + "Tests", + "Coverage shows what the tests never run. Branch coverage, reported and gated in CI, keeps untested code " + "from growing unnoticed.", + ), + "data-wellformed": Why( + "Data and schemas", + "A data file that does not parse fails at the worst moment: when something finally reads it. Parsing each " + "one in CI fails early instead.", + ), + "dependency-audit": Why( + "Security", + "Most of a program is its dependencies. Auditing them against known vulnerabilities in CI finds the one that " + "needs updating before an attacker does.", + ), + "dependency-management": Why( + "Dependencies", + "Dependencies declared to a package manager and locked are reproducible, auditable and updatable; copies " + "committed by hand are none of these.", + ), + "dependency-updates": Why( + "Dependencies", + "Dependencies age. Automated update pull requests keep them current in small, testable steps instead of one " + "painful upgrade years later.", + ), + "function-limits": Why( + "Analysis", + "Long functions are hard to read, test and change. A length limit in CI keeps each function small enough to " + "understand.", + ), + "fuzz-testing": Why( + "Tests", + "Fuzzers find the inputs nobody thought to test: crashes, hangs and memory errors in parsers and decoders. " + "Running them in CI keeps finding them.", + ), + "hardening": Why( + "Security", + "Hardening flags make the binary itself resist exploitation (stack protectors, control-flow protection, " + "fortified library calls), so a bug is less likely to become an exploit.", + ), + "large-files": Why( + "Repository", + "Large binaries in git make every clone slow forever, even after they are deleted. Git LFS or DVC keeps them " + "out of the history.", + ), + "license": Why( + "Repository", + "Without a licence nobody may legally use, change or share the code. A known licence file says what they " + "may do.", + ), + "link-check": Why( + "Data and schemas", + "Documentation with broken links fails its readers. Checking links in CI catches pages that moved or " + "disappeared.", + ), + "migration-safety": Why( + "Data and schemas", + "Some schema migrations lock tables or lose data when applied to a live database. A migration linter in CI " + "flags them before they reach production.", + ), + "mutation-testing": Why( + "Tests", + "Coverage says the tests run the code; mutation testing says whether they would notice it breaking. Each " + "surviving mutant is a bug the tests would miss.", + ), + "out-of-source-build": Why( + "Build", + "An in-source build mixes generated files with sources, pollutes the repository and breaks a second build " + "configuration. Refusing it keeps the tree clean.", + ), + "platform-matrix": Why( + "CI", + "Code that works on one OS with one compiler (or one interpreter version) often fails on another. A matrix " + "in CI finds it before users do.", + ), + "sanitizers": Why( + "Tests", + "Sanitizers turn silent memory errors, undefined behaviour and data races into loud failures while the " + "tests run, where they are cheap to fix.", + ), + "schema-compatibility": Why( + "Data and schemas", + "A schema change that breaks existing clients is an outage for someone else. Checking compatibility against " + "the published schema catches it in review.", + ), + "schema-declared": Why( + "Data and schemas", + "A schema that declares its dialect and identity can be validated and referenced unambiguously by every " + "tool that reads it.", + ), + "schema-examples": Why( + "Data and schemas", + "Examples that must pass, and invalid ones that must fail, test the schema itself: that it accepts what it " + "should and rejects what it should not.", + ), + "schema-validation": Why( + "Data and schemas", + "Documents validated against their schemas in CI fail in review rather than in production.", + ), + "secret-scanning": Why( + "Security", + "A key committed once is in the history forever. Scanning for secrets in CI catches them before they are " + "pushed, or at least before they are used.", + ), + "security-policy": Why( + "Security", + "Someone who finds a vulnerability needs to know how to report it privately; without a policy they open a " + "public issue, or give up.", + ), + "security-scanning": Why( + "Security", + "Security scanners know the patterns behind injections, unsafe deserialisation and weak crypto, and find " + "them in the code before an attacker does.", + ), + "static-analysis": Why( + "Analysis", + "Static analysers find whole classes of bugs without running the code: null dereferences, leaks, misuse of " + "APIs. Each one finds different things.", + ), + "status-badges": Why( + "Repository", + "Badges show visitors at a glance that CI runs and passes. Reported, but not scored: they are not a gate.", + ), + "tests-run": Why( + "Tests", + "Tests only protect the project when they run on every change. This is the foundation every other testing " + "gate builds on.", + ), + "top-level-guard": Why( + "Build", + "A library pulled in with FetchContent, CPM or add_subdirectory should not build its tests and developer " + "options into its users' builds.", + ), + "type-checking": Why( + "Analysis", + "In a dynamically typed language, a type checker finds the wrong argument, the missing attribute and the " + "None nobody handled, before the code runs.", + ), + "vcs-ignore": Why( + "Repository", + "An ignore file that covers the build outputs keeps them from being committed by accident.", + ), + "warnings-as-errors": Why( + "Analysis", + "Warnings that do not fail the build are soon ignored by the hundred. Treating them as errors in at least " + "one configuration keeps the count at zero.", + ), +} + + +def why(name: str) -> Why | None: + return WHY.get(name) + + +def category(name: str) -> str: + found = WHY.get(name) + return found.category if found else "Other" + + +@dataclass(frozen=True, slots=True, kw_only=True) +class Explanation: + """Everything a reader needs to understand a check.""" + + name: str + description: str + why: str + category: str + level: int + scored: bool + applies_to: tuple[str, ...] + tools: Mapping[str, tuple[str, ...]] # ecosystem -> the tools recognised for it + + def lines(self) -> list[str]: + """The explanation as `--explain` prints it.""" + level = f"Level {self.level} ({LEVEL_NAMES[self.level]})" if self.level < 4 else "Level 4 (Complete)" + lines = [self.name, "", f"What it looks for: {self.description}"] + if self.why: + lines.append(f"Why it matters: {self.why}") + scored = "" if self.scored else "; reported but not scored" + lines += [ + f"Category: {self.category}. Needed for {level}{scored}.", + f"Applies to: {', '.join(self.applies_to) or 'every project'}.", + ] + if self.tools: + lines += [ + "", + "Tools recognised:", + *(f" {label}: {', '.join(tools)}" for label, tools in self.tools.items()), + ] + return lines + + +def explain(found: Check, every_check: tuple[Check, ...]) -> Explanation: + """The explanation of `found`, with the tools the support matrix recognises for it in each ecosystem.""" + reason = WHY.get(found.name) + matrix = support_matrix(every_check) + row = next((row for row in matrix.rows if row.check == found.name), None) + tools = ( + {label: cell for label, cell in zip(matrix.ecosystems, row.cells, strict=True) if cell} + if row is not None + else {} + ) + return Explanation( + name=found.name, + description=found.description, + why=reason.why if reason else "", + category=reason.category if reason else "Other", + level=level_of(found.name), + scored=found.name not in UNSCORED, + applies_to=applies_to(found), + tools=tools, + ) + + +__all__ = ["CATEGORIES", "WHY", "Explanation", "Why", "category", "explain", "why"] diff --git a/project_validator/extraction.py b/project_validator/extraction.py index 918cdc86..4381a7df 100644 --- a/project_validator/extraction.py +++ b/project_validator/extraction.py @@ -19,11 +19,12 @@ from __future__ import annotations -from collections.abc import Callable +import time +from collections.abc import Callable, Sized from typing import TYPE_CHECKING from project_validator import ci -from project_validator.core import ExtractionError +from project_validator.core import ExtractionError, Progress from project_validator.facts import ( Facts, declaration, @@ -41,14 +42,23 @@ from project_validator.core import Context, Project -def _stage[T](name: str, compute: Callable[[], T]) -> T: - """What a stage computes; an extractor that raises makes the whole extraction an `ExtractionError` naming it.""" +def _stage[T](context: Context, name: str, compute: Callable[[], T], before: Facts | None = None) -> T: + """What a stage computes, its start and end told to the context's observers (with how long it took and how many + facts it found, beyond those it was given, `before`); an extractor that raises makes the whole extraction an + `ExtractionError` naming it.""" + context.notify(Progress(kind="stage", name=name, done=False)) + started = time.perf_counter() try: - return compute() + found = compute() except ExtractionError: raise except Exception as error: raise ExtractionError(name, error) from error + count = len(found.all) if isinstance(found, Facts) else len(found) if isinstance(found, Sized) else 0 + count -= len(before.all) if before is not None else 0 + seconds = time.perf_counter() - started + context.notify(Progress(kind="stage", name=name, done=True, seconds=seconds, found=count)) + return found def _data_facts(project: Project, found: Facts) -> Facts: @@ -57,33 +67,49 @@ def _data_facts(project: Project, found: Facts) -> Facts: return found + declaration.declaration_facts(project, found, declaration.known_declarers()) -def extract_facts(context: Context) -> Facts: - """Every fact about the project `context` reads, in the stages above; an `ExtractionError` when a stage fails.""" +def _project_facts(context: Context) -> Facts: + """The stages that read the project's own files: its structure, data, repository, tests (and build probes).""" project = context.project - found = _stage("the project's structure", lambda: Facts(structure.structure_facts(project))) - found = _stage("the data files", lambda: _data_facts(project, found)) + found = _stage(context, "the project's structure", lambda: Facts(structure.structure_facts(project))) + found = _stage(context, "the data files", lambda: _data_facts(project, found), before=found) # Only the build outputs of the project's languages, and of its formats (a documentation site's), can be # committed by it. names = structure.project_languages(found) | structure.project_formats(found) built = (out for out in outputs.known_build_outputs() if out.languages & names) - found = _stage("the repository", lambda: found + repository.repository_facts(project, built)) + found = _stage(context, "the repository", lambda: found + repository.repository_facts(project, built), before=found) found = _stage( - "the test files", lambda: found + testing.test_file_facts(project, found, testing.known_test_files()) + context, + "the test files", + lambda: found + testing.test_file_facts(project, found, testing.known_test_files()), + before=found, ) if context.options.build: probed = (fact for probe in testing.known_probes() for fact in probe.run(project, context.options)) - found = _stage("the build probes", lambda: found + probed) - jobs = _stage("the CI configuration", lambda: ci.ci_facts(project, context.ci_files)) + found = _stage(context, "the build probes", lambda: found + probed, before=found) + return found + + +def extract_facts(context: Context) -> Facts: + """Every fact about the project `context` reads, in the stages above; an `ExtractionError` when a stage fails.""" + project = context.project + found = _project_facts(context) + jobs = _stage(context, "the CI configuration", lambda: ci.ci_facts(project, context.ci_files)) expanders, actions = expansion.known_expanders(), expansion.known_actions() - found = _stage("the CI commands", lambda: found + expansion.expanded(jobs, context, expanders, actions)) - found = _stage("the CI jobs", lambda: found + ci.job_facts(found, project)) found = _stage( - "the settings", lambda: found + settings.settings_facts(context, settings.known_settings_readers(), found) + context, "the CI commands", lambda: found + expansion.expanded(jobs, context, expanders, actions), before=found + ) + found = _stage(context, "the CI jobs", lambda: found + ci.job_facts(found, project), before=found) + found = _stage( + context, + "the settings", + lambda: found + settings.settings_facts(context, settings.known_settings_readers(), found), + before=found, ) # Only the tools of the project's languages and formats can run on it: a run of another language's tool answers # nothing a question asks, and would only grow the facts with every profile that shares the tool. + names = structure.project_languages(found) | structure.project_formats(found) used = tuple(tool for tool in tools.known_tools() if tool.languages & names) - return _stage("the tool runs", lambda: found + tools.tool_runs(found, used)) + return _stage(context, "the tool runs", lambda: found + tools.tool_runs(found, used), before=found) __all__ = ["extract_facts"] diff --git a/project_validator/facts/auxiliary.py b/project_validator/facts/auxiliary.py index a8287337..5b4939b2 100644 --- a/project_validator/facts/auxiliary.py +++ b/project_validator/facts/auxiliary.py @@ -40,7 +40,7 @@ def _languages_named(name: str) -> frozenset[str]: class Selectors: """What `--auxiliary` named, resolved: each role, language (as the ecosystems spell it) and directory (without its trailing slash) to the name it was given as. A name is a role or a language before it is a directory - (`c/c++` is the ecosystem); a directory is anything else with a slash in it (`scripts/`, `tools/legacy`).""" + (`c++` is the language); a directory is anything else with a slash in it (`scripts/`, `tools/legacy`).""" roles: Mapping[str, str] languages: Mapping[str, str] diff --git a/project_validator/facts/practices.py b/project_validator/facts/practices.py index 7a10f483..c0f88246 100644 --- a/project_validator/facts/practices.py +++ b/project_validator/facts/practices.py @@ -29,7 +29,7 @@ class PracticeName(enum.StrEnum): WARNINGS = "compiler-warnings" WARNINGS_AS_ERRORS = "warnings-as-errors" HARDENING = "hardening" - EXTENSIONS = "cxx-extensions" + EXTENSIONS = "compiler-extensions" SANITIZERS = "sanitizers" OUT_OF_SOURCE = "out-of-source-build" COMPILE_COMMANDS = "compile-commands" diff --git a/project_validator/facts/structure.py b/project_validator/facts/structure.py index 3bb27bed..51821c2f 100644 --- a/project_validator/facts/structure.py +++ b/project_validator/facts/structure.py @@ -8,12 +8,12 @@ from collections import Counter from collections.abc import Callable, Iterable, Iterator -from dataclasses import dataclass +from dataclasses import dataclass, replace from fnmatch import fnmatchcase from pathlib import PurePosixPath from project_validator.core import Project -from project_validator.ecosystems import Ecosystem, Kind, build_systems, formats, registered +from project_validator.ecosystems import Ecosystem, Kind, build_systems, families, formats, registered from project_validator.facts import Fact, Facts, Origin from project_validator.facts.auxiliary import AuxiliaryCode, Selectors from project_validator.facts.roles import role @@ -189,13 +189,53 @@ def source_signal(path: str) -> str: return found[0] -def _ambiguous(files: list[str], confirmed: list[Ecosystem]) -> Iterator[SourceFile]: +def _ambiguous( + files: list[str], confirmed: list[Ecosystem], sources: Iterable[SourceFile], declared: frozenset[str] +) -> Iterator[SourceFile]: + """The sources with a suffix the `confirmed` ecosystems claim ambiguously. A file several of them claim for + different languages (a `.h` header, C's or C++'s) is the language of the sources around it (see `_neighbours`).""" + claims: dict[str, list[str | None]] = {} for ecosystem in confirmed: for suffix, language in sorted((ecosystem.ambiguous_suffixes or {}).items()): for path in files: if PurePosixPath(path).suffix == suffix: - origin = Origin(path=path) - yield SourceFile(origin=origin, language=language, ambiguous=True, role=role(path)) + claims.setdefault(path, []).append(language) + neighbours = _Neighbours(sources) + for path, candidates in claims.items(): + named = list(dict.fromkeys(language for language in candidates if language is not None)) + language = named[0] if len(named) == 1 else neighbours.language(path, named, declared) if named else None + yield SourceFile(origin=Origin(path=path), language=language, ambiguous=True, role=role(path)) + + +class _Neighbours: + """How many of the project's own sources of each language are below each directory.""" + + def __init__(self, sources: Iterable[SourceFile]) -> None: + self._below: dict[str, Counter[str]] = {} + for source in sources: + if source.language is not None and not source.vendored: + for directory in _ancestors(source.path): + self._below.setdefault(directory, Counter())[source.language] += 1 + + def language(self, path: str, candidates: list[str], declared: frozenset[str]) -> str: + """Of `candidates`, the language of most sources below the nearest ancestor of `path` that has any of them + (the first candidate on a tie); with none anywhere, the one candidate the build files `declared`, else the + first.""" + for directory in _ancestors(path): + counts = self._below.get(directory, Counter()) + if found := [language for language in candidates if counts[language]]: + return max(found, key=lambda language: counts[language]) + only = [language for language in candidates if language in declared] + return only[0] if len(only) == 1 else candidates[0] + + +def _ancestors(path: str) -> Iterator[str]: + """The directories `path` is in, nearest first, ending with the project's root (".").""" + parent = PurePosixPath(path).parent + while str(parent) != ".": + yield str(parent) + parent = parent.parent + yield "." def _own_sources(facts: Facts) -> Iterator[str]: @@ -208,13 +248,44 @@ def project_languages(facts: Facts) -> frozenset[str]: """The languages the project uses: those its build files build, its own sources are written in, or its content shows; not its formats.""" known = formats() - return frozenset( - { - *(language for build in facts.of(BuildFile) for language in build.languages), - *(name for name in _own_sources(facts) if name not in known), - *(name for name in _content_names(facts) if name not in known), - } - ) + own = {name for name in _own_sources(facts) if name not in known} + built = {language for build in facts.of(BuildFile) for language in build.languages} + return frozenset({*given_way(built, own), *own, *(name for name in _content_names(facts) if name not in known)}) + + +def given_way(declared: Iterable[str], sources: Iterable[str]) -> set[str]: + """The languages build files `declared`, but the languages of a family give way to the `sources` when there are + sources of the family (see `Ecosystem.family`): CMake's project() enables C and C++ unless told otherwise, and a + package.json's `main` names the JavaScript a TypeScript package publishes, neither of which says which language + the code is written in.""" + declared, sources = set(declared), set(sources) + for family in families(): + if sources & family: + declared -= family - sources + return declared + + +def _tool_configuration(sources: list[SourceFile]) -> Iterator[SourceFile]: + """`sources`, with the tool configuration of a family's language (`eslint.config.js`) adding no language where + the family's other languages have sources of their own (a TypeScript project's).""" + patterns = { + language: (ecosystem.tool_configuration, family) + for ecosystem in registered() + if ecosystem.tool_configuration and ecosystem.family + for family in families() + if ecosystem.languages <= family + for language in ecosystem.languages + } + + def configuration(source: SourceFile) -> bool: + found = patterns.get(source.language or "") + return found is not None and any(fnmatchcase(PurePosixPath(source.path).name, glob) for glob in found[0]) + + own = {source.language for source in sources if not source.vendored and not configuration(source)} + for source in sources: + family = patterns[source.language or ""][1] if configuration(source) else frozenset() + given = configuration(source) and bool(own & (family - {source.language})) + yield replace(source, language=None) if given else source def _content_names(facts: Facts) -> Iterator[str]: @@ -339,7 +410,8 @@ def _units(project: Project, facts: Facts, named: Selectors) -> Iterator[Unit]: # What a build file builds counts for its unit too, unless the build file only declares a workspace. for build in facts.of(BuildFile): if (directory := _directory(build)) not in workspaces or languages.get(directory): - languages.setdefault(owner(directory, roots), set()).update(_own(build.languages, build.origin.path, named)) + unit = languages.setdefault(owner(directory, roots), set()) + unit.update(given_way(_own(build.languages, build.origin.path, named), unit)) known = formats() for content in facts.of(ContentLanguages): names = _own(content.languages, ".", named, directory=True) @@ -364,10 +436,13 @@ def structure_facts(project: Project) -> Iterator[Fact]: named = Selectors.parse(project.auxiliary) yield AuxiliaryCode(origin=Origin(path="."), named=tuple(project.auxiliary)) found = list(_build_files(project, files)) - plain = Facts((*(fact for fact, _ in found if fact is not None), *_sources(project), *_content(project))) + found_sources = list(_tool_configuration(list(_sources(project)))) + plain = Facts((*(fact for fact, _ in found if fact is not None), *found_sources, *_content(project))) yield from plain names = project_languages(plain) | project_formats(plain) - ambiguous = list(_ambiguous(files, [ecosystem for ecosystem in registered() if ecosystem.languages & names])) + confirmed = [ecosystem for ecosystem in registered() if ecosystem.languages & names] + declared = frozenset(language for build in plain.of(BuildFile) for language in build.languages) + ambiguous = list(_ambiguous(files, confirmed, plain.of(SourceFile), declared)) yield from ambiguous sources = (*plain.of(SourceFile), *ambiguous) recognised = {signal for source in sources if (signal := source_signal(source.path)).startswith(".")} diff --git a/project_validator/platforms.py b/project_validator/platforms.py index 4c416950..9f08952d 100644 --- a/project_validator/platforms.py +++ b/project_validator/platforms.py @@ -34,7 +34,7 @@ RUNNER_DEFAULT_COMPILERS = {"linux": "gcc", "macos": "appleclang", "windows": "msvc"} # The ecosystems whose jobs compile with the runner's default compiler when they name none. -COMPILING_ECOSYSTEMS = frozenset({"C/C++", "Fortran"}) +COMPILING_ECOSYSTEMS = frozenset({"C", "C++", "Fortran"}) def detect_operating_systems(text: str) -> list[str]: diff --git a/project_validator/pretty.py b/project_validator/pretty.py deleted file mode 100644 index a7d64224..00000000 --- a/project_validator/pretty.py +++ /dev/null @@ -1,80 +0,0 @@ -"""Optional colored terminal output with rich; the plain text output is used when it is missing.""" - -from __future__ import annotations - -import importlib -from collections import Counter -from collections.abc import Sequence -from types import ModuleType -from typing import Any, TextIO - -from project_validator.core import Status -from project_validator.runner import Report - - -class PrettyError(Exception): - pass - - -def _import_rich() -> ModuleType | None: - try: - importlib.import_module("rich.console") - importlib.import_module("rich.text") - return importlib.import_module("rich") - except ImportError: - return None - - -_rich = _import_rich() - -_STYLES = { - Status.PASS: "bold green", - Status.WARN: "bold yellow", - Status.FAIL: "bold red", - Status.ERROR: "bold magenta", - Status.SKIP: "bold blue", -} -_OUTCOMES = { - Status.PASS: "passed", - Status.WARN: "warned", - Status.FAIL: "failed", - Status.ERROR: "errored", - Status.SKIP: "skipped", -} -_BADGE_WIDTH = max(len(status) for status in Status) + 2 - - -def available() -> bool: - return _rich is not None - - -def print_reports(reports: Sequence[Report], stream: TextIO) -> None: - if _rich is None: - raise PrettyError("rich is not available") - text = _rich.text - console = _rich.console.Console(file=stream, force_terminal=True, soft_wrap=True, highlight=False) - name_width = max((len(report.check.name) for report in reports), default=0) - for report in reports: - console.print(_report_line(text, report, name_width)) - for detail in report.result.details: - console.print(text.Text(f"{'':{_BADGE_WIDTH + 1}}{detail}", style="dim")) - console.print() - console.print(_summary(text, Counter(report.result.status for report in reports))) - - -def _report_line(text: ModuleType, report: Report, name_width: int) -> Any: - status = report.result.status - return text.Text.assemble( - (f"{status:^{_BADGE_WIDTH}}", f"reverse {_STYLES[status]}"), - " ", - (f"{report.check.name:<{name_width}}", "bold"), - " ", - report.result.message, - ) - - -def _summary(text: ModuleType, counts: Counter[Status]) -> Any: - outcomes = [(f"{counts[status]} {_OUTCOMES[status]}", _STYLES[status]) for status in Status if counts[status]] - if not outcomes: - return text.Text("no checks were run", style="dim") - return text.Text(", ").join(text.Text(outcome, style=style) for outcome, style in outcomes) diff --git a/project_validator/project_map.py b/project_validator/project_map.py index 75f2158a..a50c9dee 100644 --- a/project_validator/project_map.py +++ b/project_validator/project_map.py @@ -140,12 +140,13 @@ def _found_signals(facts: Facts) -> Iterator[tuple[frozenset[str], str]]: yield from ((frozenset({language}), f"{suffix} files") for suffix, language, ambiguous in sources if ambiguous) -def _signals(facts: Facts) -> dict[str, tuple[str, ...]]: - """Ecosystem label -> the signals that recognised it.""" +def _signals(facts: Facts, names: frozenset[str]) -> dict[str, tuple[str, ...]]: + """Ecosystem label -> the signals that recognised it, for the ecosystems of the project's languages and formats + (`names`): a CMake file that enables C and C++ by default does not make a C++ project a C one.""" signals: dict[str, dict[str, None]] = {} for languages, signal in _found_signals(facts): for ecosystem in registered(): - if ecosystem.languages & languages: + if ecosystem.languages & languages & names: signals.setdefault(ecosystem.label, {})[signal] = None return {label: tuple(found) for label, found in signals.items()} @@ -153,11 +154,12 @@ def _signals(facts: Facts) -> dict[str, tuple[str, ...]]: def map_project(facts: Facts, ci_files: tuple[CiFile, ...], analysis: CiAnalysis) -> ProjectStructure: """The project map: a view over the structure facts, and the CI the facts show.""" vendored = [source.path for source in facts.of(SourceFile) if source.vendored] + languages, formats_ = project_languages(facts), project_formats(facts) return ProjectStructure( - languages=project_languages(facts), - formats=project_formats(facts), + languages=languages, + formats=formats_, build_systems=frozenset(build.build_system for build in facts.of(BuildFile)), - recognised_by=_signals(facts), + recognised_by=_signals(facts, languages | formats_), unrecognised_suffixes=tuple((found.suffix, found.files) for found in facts.of(UnrecognisedSuffix)), vendored=tuple(vendored), units=facts.of(Unit), diff --git a/project_validator/runner.py b/project_validator/runner.py index 06ad8597..e50b6c40 100644 --- a/project_validator/runner.py +++ b/project_validator/runner.py @@ -2,10 +2,11 @@ from __future__ import annotations +import time from collections.abc import Iterable from dataclasses import dataclass -from project_validator.core import Check, Context, ExtractionError, Result, Status +from project_validator.core import Check, Context, ExtractionError, Progress, Result, Status class SelectionError(Exception): @@ -60,7 +61,18 @@ def run_check(selected: Check, context: Context) -> Result: def run_checks(selected: Iterable[Check], context: Context) -> list[Report]: - return [Report(check=c, result=run_check(c, context)) for c in selected] + """Each check's report, in order; each check's start and end are told to the context's observers.""" + selected = list(selected) + reports = [] + for index, chosen in enumerate(selected, 1): + context.notify(Progress(kind="check", name=chosen.name, done=False, index=index, total=len(selected))) + started = time.perf_counter() + reports.append(Report(check=chosen, result=run_check(chosen, context))) + seconds = time.perf_counter() - started + context.notify( + Progress(kind="check", name=chosen.name, done=True, seconds=seconds, index=index, total=len(selected)) + ) + return reports def succeeded(reports: Iterable[Report], *, strict: bool = False) -> bool: diff --git a/project_validator/score.py b/project_validator/score.py index fd3258a3..534966d3 100644 --- a/project_validator/score.py +++ b/project_validator/score.py @@ -1,35 +1,36 @@ -"""The tooling score (upstream #295): three numbers read from the reports, beside the statuses, which do not change. - -- **Level** is a gated tech tree: level N when the core and project cells of every check of levels 1 to N pass. - Level 4 needs every applicable cell, auxiliary ones included. -- **Completeness** is covered cells over applicable cells, averaged across units (the whole project's own cells - are one more unit). Auxiliary cells weigh half, a warning covers half a cell, a skip is not applicable, and an - error scores nothing but stays in the maximum, so neither adding untooled code nor hiding something ever pays. -- **Depth** is the high score: each tool in a covered cell earns points by its rank in the cell, by tier. Depth - earned in a level counts only once the levels below it are complete; the rest is shown as locked. - -A **cell** is one check's result for one ecosystem in one unit (a place); a check of the whole project (no places) -is one project cell. - -This is the preview (version 0): it reads only what the reports carry. Strength (disabled diagnostics, suppression -density), advisory runs at half points, tool families and verified points need facts the readers do not record yet, -and arrive with version 1. Until then a covered cell earns its first rank even when the check names no tool, so -checks that do not report their tools do not distort the comparison. +"""The tooling score (upstream #295), version 1: how many of the quality gates that apply to a project are in place. + +**100% means every gate that applies to each part of the project is in place.** A part is a language in a unit (one +check's result there is a *slot*); the gates of the whole project (a licence, CI) are one slot each. + +- **Fill.** A passing slot is filled, a warning half filled, anything else empty. A skip is not a slot (the gate does + not apply), and an error stays one: hiding something never helps. +- **Weight.** Auxiliary code (`--auxiliary`) weighs half, and is not asked for the gates of the product alone + (`NOT_FOR_AUXILIARY`: fuzzing tests, measuring their coverage, ...). Cosmetic checks (`UNSCORED`) are reported, not + scored. +- **Pooled.** `percent = 100 * filled / slots`: a folder of data files with one gate weighs one slot. +- **Extra credit**, only for gates where more tools find more (`EXTRA_CREDIT`: analysers, scanners, auditors, + fuzzers, sanitizers, type checkers): a second distinct tool in a slot earns a quarter slot more, a third a tenth; + tools of one family (ruff and flake8; golangci-lint and the linters it bundles) count once. It is **held** until + every slot is filled, so passing 100% always means every gate is in place. +- **Levels** are milestones: level N when the core and project slots of every check of levels 1 to N pass, and each + of those checks ran; level 4, Complete, is 100% with every check run. + +A next step is every slot not filled, with the points filling it is worth and the level it is needed for. """ from __future__ import annotations import math -from collections import defaultdict from collections.abc import Iterable, Iterator, Mapping, Sequence -from dataclasses import dataclass, replace +from dataclasses import dataclass, field -from project_validator.core import Status +from project_validator.core import Result, Status from project_validator.runner import Report -SCORE_VERSION = "0" +SCORE_VERSION = "1" -# The checks each level's core and project cells must pass, in order; every other check belongs to level 4. +# The checks each level's core and project slots must pass, in order; every other check belongs to the top level. LEVELS: Mapping[int, tuple[str, ...]] = { 1: ( "ci-present", @@ -44,52 +45,94 @@ 3: ("sanitizers", "fuzz-testing", "mutation-testing", "security-scanning", "action-pinning"), } TOP_LEVEL = 4 +LEVEL_NAMES: Mapping[int, str] = {0: "Getting started", 1: "Foundations", 2: "Analysis", 3: "Hardening", 4: "Complete"} + +# Reported, never scored: what a README shows is not a quality gate. +UNSCORED = frozenset({"status-badges"}) +# The gates of the product alone, which auxiliary code (tests, examples, scripts) is not asked for. +NOT_FOR_AUXILIARY = frozenset( + { + "coverage", + "fuzz-testing", + "mutation-testing", + "sanitizers", + "hardening", + "dependency-audit", + "platform-matrix", + "ci-build-types", + "security-scanning", + } +) +# The gates where each more tool finds more: two analysers are stronger than one; two formatters are not. +EXTRA_CREDIT = frozenset( + { + "static-analysis", + "security-scanning", + "dependency-audit", + "fuzz-testing", + "sanitizers", + "type-checking", + "compiler-warnings", + } +) +# The extra credit of the 2nd, 3rd, ... distinct tool family in a slot, in slots. +EXTRA = (0.25, 0.10) +# Tools that are one tool for the extra credit: reimplementations of each other's rules. +FAMILIES: Mapping[str, str] = {"flake8": "ruff", "pylint": "pylint", "ruff": "ruff"} CORE, AUXILIARY, PROJECT = "core", "auxiliary", "project" _WEIGHT = {CORE: 1.0, AUXILIARY: 0.5, PROJECT: 1.0} -# Points for the 1st, 2nd, 3rd, ... tool in a cell; tools past the end earn nothing. -_RANKS = {CORE: (10, 5, 2, 1, 1, 1), AUXILIARY: (5, 2, 1), PROJECT: (10, 5, 2, 1, 1, 1)} -_FLAT = 5 # a project cell that passes without naming a tool (a licence, a security policy) -_COVERS = {Status.PASS: 1.0, Status.WARN: 0.5} +_FILLS = {Status.PASS: 1.0, Status.WARN: 0.5} def level_of(check: str) -> int: return next((level for level, checks in LEVELS.items() if check in checks), TOP_LEVEL) +def family(tool: str) -> str: + """The family a tool counts in for the extra credit: a bundled linter's bundle (`golangci-lint's gosec`), a + reimplementation's original, else the tool itself.""" + bundle, separator, _ = tool.partition("'s ") + return bundle if separator else FAMILIES.get(tool, tool) + + @dataclass(frozen=True, slots=True, kw_only=True) class Cell: + """One slot: a check's result for a language in a unit (or for the whole project).""" + check: str level: int - ecosystem: str # "" for a project cell - unit: str # "" for a project cell + ecosystem: str # "" for the whole project + unit: str # "" for the whole project tier: str status: Status tools: tuple[str, ...] - points: float = 0.0 - counted: bool = False - - @property - def covered(self) -> float: - return _COVERS.get(self.status, 0.0) + message: str = "" + hint: str = "" @property def weight(self) -> float: return _WEIGHT[self.tier] @property - def first_rank(self) -> float: - return _FLAT if self.tier == PROJECT and not self.tools else _RANKS[self.tier][0] + def fill(self) -> float: + return _FILLS.get(self.status, 0.0) - def earned(self) -> float: - """The cell's points before gating: its tools by rank (at least its first rank, named or not), scaled by - how much of the cell is covered.""" - if not self.covered: + @property + def filled(self) -> float: + return self.weight * self.fill + + @property + def families(self) -> tuple[str, ...]: + return tuple(dict.fromkeys(family(tool) for tool in self.tools)) + + @property + def extra(self) -> float: + """The extra credit the slot earns, in slots: for each distinct tool family past the first, in a gate where + more tools find more.""" + if self.check not in EXTRA_CREDIT or not self.fill: return 0.0 - if self.tier == PROJECT and not self.tools: - return _FLAT * self.covered - ranks = _RANKS[self.tier] - return sum(ranks[: max(1, len(self.tools))]) * self.covered + return sum(EXTRA[: max(0, len(self.families) - 1)]) * self.weight * self.fill def as_dict(self) -> dict[str, object]: return { @@ -100,14 +143,15 @@ def as_dict(self) -> dict[str, object]: "tier": self.tier, "status": str(self.status), "tools": list(self.tools), - "points": _number(self.points), - "counted": self.counted, + "weight": self.weight, + "filled": self.filled, + "extra": _number(self.extra), } @dataclass(frozen=True, slots=True, kw_only=True) -class Opportunity: - """A cell that is not covered, and what covering it is worth.""" +class NextStep: + """A slot not filled, and what filling it is worth.""" check: str ecosystem: str @@ -115,10 +159,26 @@ class Opportunity: tier: str status: Status level: int # the level of its check - completeness: float # how much completeness would rise - depth: float # the first-rank points it would earn (0 while its level is locked) - blocks: int | None # the next level, when the cell stands in its way - unlocks: int | None # the next level, when the cell alone stands in its way + points: float # how much the percent rises + needed_for: int | None # the next level, when the slot stands in its way + completes: bool # whether it alone stands in the way of the next level + message: str = "" + hint: str = "" + + @property + def where(self) -> str: + unit = {"": "", ".": ""}.get(self.unit, self.unit) + return " in ".join(part for part in (self.ecosystem, unit) if part) + + def describe(self) -> str: + """`coverage (C++ in lib): +12 points, needed for Level 2 (Analysis); run gcovr in CI`.""" + where = f" ({self.where})" if self.where else "" + gains = [f"+{_points(self.points)} points"] + if self.needed_for is not None: + verb = "completes" if self.completes else "needed for" + gains.append(f"{verb} Level {self.needed_for} ({LEVEL_NAMES[self.needed_for]})") + hint = f"; {self.hint}" if self.hint else "" + return f"{self.check}{where}: {', '.join(gains)}{hint}" def as_dict(self) -> dict[str, object]: return { @@ -128,48 +188,87 @@ def as_dict(self) -> dict[str, object]: "tier": self.tier, "status": str(self.status), "level": self.level, - "completeness": round(self.completeness, 4), - "depth": _number(self.depth), - "blocks": self.blocks, - "unlocks": self.unlocks, + "points": round(self.points, 2), + "needed_for": self.needed_for, + "completes": self.completes, + "message": self.message, + "hint": self.hint, } - def describe(self) -> str: - unit = {"": "", ".": "the root"}.get(self.unit, f"unit {self.unit}") - where = " in ".join(part for part in (self.ecosystem, unit) if part) - gains = [f"+{self.completeness:.1%} completeness"] - if self.depth: - gains.append(f"+{_number(self.depth)} depth") - if self.unlocks is not None: - gains.append(f"unlocks Level {self.unlocks}") - elif self.blocks is not None: - gains.append(f"toward Level {self.blocks}") - return f"{self.check}{f' ({where})' if where else ''}: {', '.join(gains)}" - @dataclass(frozen=True, slots=True, kw_only=True) class Score: level: int - completeness: float - depth: float - locked_depth: float + filled: float + slots: float + extra_slots: float cells: tuple[Cell, ...] - opportunities: tuple[Opportunity, ...] + next_steps: tuple[NextStep, ...] = field(default=()) + + @property + def base(self) -> float: + """The share of the slots filled, in percent.""" + return 100.0 * self.filled / self.slots if self.slots else 100.0 + + @property + def complete(self) -> bool: + return math.isclose(self.filled, self.slots) + + @property + def extra(self) -> float: + """The extra credit, in percent: counted once every slot is filled.""" + return 100.0 * self.extra_slots / self.slots if self.slots and self.complete else 0.0 + + @property + def held(self) -> float: + """The extra credit earned but held until every slot is filled, in percent.""" + return 100.0 * self.extra_slots / self.slots if self.slots and not self.complete else 0.0 + + @property + def percent(self) -> float: + return 100.0 + self.extra if self.complete else self.base + + @property + def gates(self) -> int: + return sum(1 for cell in self.cells if cell.fill) + + @property + def level_name(self) -> str: + return LEVEL_NAMES[self.level] def summary(self) -> str: - percent = math.floor(round(self.completeness * 100, 6)) - return f"Level {self.level} · {percent}% complete · {_number(self.depth)} depth" + """`87% · Level 1 Foundations · 41 of 47 gates in place`.""" + head = f"{_floor(self.percent)}% · Level {self.level} {self.level_name}" + if self.complete: + gates = f"all {len(self.cells)} gates in place" + return f"{head} · {gates}, +{_credit(self.extra)} extra credit" if self.extra else f"{head} · {gates}" + gates = f"{self.gates} of {len(self.cells)} gates in place" + held = f" (+{_credit(self.held)} extra credit held until every gate is in place)" if self.held else "" + return f"{head} · {gates}{held}" + + def breakdown(self) -> dict[str, tuple[float, float]]: + """Language -> (filled, slots); the whole project's own gates are under "".""" + found: dict[str, tuple[float, float]] = {} + for cell in self.cells: + filled, slots = found.get(cell.ecosystem, (0.0, 0.0)) + found[cell.ecosystem] = (filled + cell.filled, slots + cell.weight) + return found def as_dict(self) -> dict[str, object]: return { "version": SCORE_VERSION, - "preview": True, + "percent": round(self.percent, 2), + "base": round(self.base, 2), + "extra": round(self.extra, 2), + "held": round(self.held, 2), "level": self.level, - "completeness": round(self.completeness, 4), - "depth": _number(self.depth), - "locked_depth": _number(self.locked_depth), + "level_name": self.level_name, + "filled": _number(self.filled), + "slots": _number(self.slots), + "summary": self.summary(), + "breakdown": {name: [_number(a), _number(b)] for name, (a, b) in self.breakdown().items()}, "cells": [cell.as_dict() for cell in self.cells], - "opportunities": [opportunity.as_dict() for opportunity in self.opportunities], + "next_steps": [step.as_dict() for step in self.next_steps], } @@ -177,33 +276,69 @@ def _number(value: float) -> float | int: return int(value) if float(value).is_integer() else round(value, 2) +def _floor(value: float) -> int: + return math.floor(round(value, 6)) + + +def _credit(value: float) -> str: + """Extra credit, in percent: a tenth below one point, whole points above.""" + return f"{value:.1f}" if value < 1 else str(_floor(value)) + + +def _points(value: float) -> str: + return str(_number(round(value, 1))) + + +# The first words of a detail that says what to do, rather than what was found (a file, a job). +_ADVICE = frozenset( + {"consider", "add", "remove", "commit", "run", "set", "enable", "pin", "fetch", "compare", "condition", "use"} +) + + +def _hint(details: Sequence[str]) -> str: + """The first detail that says what to do (`consider running gcovr in CI`), else "".""" + for detail in details: + words = detail.split(maxsplit=1) + if words and words[0].lower() in _ADVICE: + return detail + return "" + + def _report_cells(report: Report) -> Iterator[Cell]: - """The report's applicable cells: one per place that does not skip, or one project cell for a check of the whole - project.""" + """The report's slots: one per place that does not skip, or one for a check of the whole project; auxiliary + places of the product's own gates, and unscored checks, are left out.""" name, level = report.check.name, level_of(report.check.name) - if not report.result.places: - if report.result.status is not Status.SKIP: - yield Cell( - check=name, level=level, ecosystem="", unit="", tier=PROJECT, status=report.result.status, tools=() - ) + if name in UNSCORED: return - for place in report.result.places: - if place.result.status is not Status.SKIP: - tier = AUXILIARY if place.auxiliary else CORE - yield Cell( - check=name, - level=level, - ecosystem=place.ecosystem, - unit=place.unit, - tier=tier, - status=place.result.status, - tools=place.tools, - ) + result = report.result + if not result.places: + if result.status is not Status.SKIP: + yield _cell(name, level, "", "", PROJECT, result, ()) + return + for place in result.places: + tier = AUXILIARY if place.auxiliary else CORE + if place.result.status is Status.SKIP or (tier == AUXILIARY and name in NOT_FOR_AUXILIARY): + continue + yield _cell(name, level, place.ecosystem, place.unit, tier, place.result, place.tools) + + +def _cell(check: str, level: int, ecosystem: str, unit: str, tier: str, result: Result, tools: tuple[str, ...]) -> Cell: + return Cell( + check=check, + level=level, + ecosystem=ecosystem, + unit=unit, + tier=tier, + status=result.status, + tools=tools, + message=result.message, + hint=_hint(result.details), + ) def _blocking(cells: Iterable[Cell], level: int) -> list[Cell]: - """The cells that stand between the project and `level`: below the top level, the core and project cells of - levels 1 to `level` that do not pass; at the top, every cell that does not.""" + """The slots that stand between the project and `level`: below the top level, the core and project slots of + levels 1 to `level` that do not pass; at the top, every slot that does not.""" return [ cell for cell in cells @@ -217,72 +352,38 @@ def _ran_all(level: int, ran: frozenset[str], every_check: frozenset[str]) -> bo def _level(cells: Sequence[Cell], ran: frozenset[str], every_check: frozenset[str]) -> int: - """The highest level reached: no cell blocks it or a level below, and each check they need ran.""" reached = 0 while reached < TOP_LEVEL and not _blocking(cells, reached + 1) and _ran_all(reached + 1, ran, every_check): reached += 1 return reached -def _units(cells: Iterable[Cell]) -> dict[str, list[Cell]]: - units: dict[str, list[Cell]] = defaultdict(list) - for cell in cells: - units[cell.unit].append(cell) - return units - - -def _completeness(units: Mapping[str, Sequence[Cell]]) -> float: - if not units: - return 1.0 - return sum( - sum(cell.weight * cell.covered for cell in cells) / sum(cell.weight for cell in cells) - for cells in units.values() - ) / len(units) - - -def _opportunity(cell: Cell, unit_weight: float, units: int, level: int, blocking: Sequence[Cell]) -> Opportunity: - """What covering `cell` is worth, in a unit of `unit_weight` among `units`, at `level`.""" - missing = 1.0 - cell.covered - return Opportunity( - check=cell.check, - ecosystem=cell.ecosystem, - unit=cell.unit, - tier=cell.tier, - status=cell.status, - level=cell.level, - completeness=cell.weight * missing / unit_weight / units, - depth=cell.first_rank * missing if cell.level <= level + 1 else 0.0, - blocks=level + 1 if cell in blocking else None, - unlocks=level + 1 if list(blocking) == [cell] else None, - ) - - -def _rank(opportunity: Opportunity) -> tuple[bool, bool, int, bool, float, float, str]: - """The next level's blockers first (lowest level first), then core before auxiliary, then by what it is worth.""" - return ( - opportunity.blocks is None, - opportunity.unlocks is None, - opportunity.level, - opportunity.tier == AUXILIARY, - -opportunity.completeness, - -opportunity.depth, - opportunity.check, - ) +def _rank(step: NextStep) -> tuple[bool, bool, int, bool, float, str]: + """The next level's blockers first (the one that completes it first), lowest level first, then core before + auxiliary, then by the points.""" + return (step.needed_for is None, not step.completes, step.level, step.tier == AUXILIARY, -step.points, step.check) -def _opportunities( - cells: Sequence[Cell], units: Mapping[str, Sequence[Cell]], level: int, *, complete_run: bool -) -> tuple[Opportunity, ...]: - """Every cell not covered, ranked. A cell unlocks the next level when it alone stands in the way; nothing does - when the next level's checks did not all run.""" +def _next_steps(cells: Sequence[Cell], slots: float, level: int, *, complete_run: bool) -> tuple[NextStep, ...]: blocking = _blocking(cells, level + 1) if level < TOP_LEVEL and complete_run else [] - weights = {unit: sum(cell.weight for cell in members) for unit, members in units.items()} - found = ( - _opportunity(cell, weights[cell.unit], len(units), level, blocking) + steps = ( + NextStep( + check=cell.check, + ecosystem=cell.ecosystem, + unit=cell.unit, + tier=cell.tier, + status=cell.status, + level=cell.level, + points=100.0 * (cell.weight - cell.filled) / slots, + needed_for=level + 1 if cell in blocking else None, + completes=blocking == [cell], + message=cell.message, + hint=cell.hint, + ) for cell in cells if cell.status is not Status.PASS ) - return tuple(sorted(found, key=_rank)) + return tuple(sorted(steps, key=_rank)) def score(reports: Iterable[Report], every_check: Iterable[str] = ()) -> Score: @@ -290,19 +391,34 @@ def score(reports: Iterable[Report], every_check: Iterable[str] = ()) -> Score: only when `every_check` (the names of every check there is) ran too: a run narrowed by `--only` or `--skip` reaches no level past the checks it left out.""" reports = list(reports) - raw = [cell for report in reports for cell in _report_cells(report)] + cells = tuple(cell for report in reports for cell in _report_cells(report)) ran = frozenset(report.check.name for report in reports) everything = frozenset(every_check) - level = _level(raw, ran, everything) - cells = tuple(replace(cell, points=cell.earned(), counted=cell.level <= level + 1) for cell in raw) - units = _units(cells) + level = _level(cells, ran, everything) + slots = sum(cell.weight for cell in cells) + complete_run = level == TOP_LEVEL or _ran_all(level + 1, ran, everything) return Score( level=level, - completeness=_completeness(units), - depth=sum(cell.points for cell in cells if cell.counted), - locked_depth=sum(cell.points for cell in cells if not cell.counted), + filled=sum(cell.filled for cell in cells), + slots=slots, + extra_slots=sum(cell.extra for cell in cells), cells=cells, - opportunities=_opportunities( - cells, units, level, complete_run=level == TOP_LEVEL or _ran_all(level + 1, ran, everything) - ), + next_steps=_next_steps(cells, slots, level, complete_run=complete_run), ) + + +__all__ = [ + "EXTRA_CREDIT", + "LEVELS", + "LEVEL_NAMES", + "NOT_FOR_AUXILIARY", + "SCORE_VERSION", + "TOP_LEVEL", + "UNSCORED", + "Cell", + "NextStep", + "Score", + "family", + "level_of", + "score", +] diff --git a/project_validator/tools/toolchains.py b/project_validator/tools/toolchains.py index c0f8d10b..fb7dde7f 100644 --- a/project_validator/tools/toolchains.py +++ b/project_validator/tools/toolchains.py @@ -2,7 +2,7 @@ compilers that take GCC's flags (GCC, Clang, Apple Clang, Intel) and for MSVC. Build systems translate their own settings into these flags (CMake's `COMPILE_WARNING_AS_ERROR`, Meson's `werror` -and `warning_level`), and the C/C++ practices ask for them per compiler. +and `warning_level`), and the C and C++ practices ask for them per compiler. """ from __future__ import annotations diff --git a/project_validator/views/__init__.py b/project_validator/views/__init__.py new file mode 100644 index 00000000..4793d38c --- /dev/null +++ b/project_validator/views/__init__.py @@ -0,0 +1,3 @@ +"""The views of an analysis (`project_validator.analysis.Analysis`): plain text, the console (with rich), the HTML +report and the TUI (with textual). Each renders the same analysis, and the presentation they share is in `common`. +""" diff --git a/project_validator/views/assets/report.js b/project_validator/views/assets/report.js new file mode 100644 index 00000000..405b3676 --- /dev/null +++ b/project_validator/views/assets/report.js @@ -0,0 +1,143 @@ +// The HTML report's behaviour: the navigation follows the section on screen, the results filter by status and text, +// a link to a result opens it, and the facts (JSON in #facts-data) are browsed by kind and searched. +"use strict"; + +function element(tag, cls, text) { + var node = document.createElement(tag); + if (cls) node.className = cls; + if (text !== undefined) node.textContent = text; + return node; +} + +function followSections() { + var links = Array.prototype.slice.call(document.querySelectorAll(".topbar nav a")); + var sections = links.map(function (a) { return document.querySelector(a.getAttribute("href")); }); + function spy() { + var current = 0; + sections.forEach(function (s, i) { if (s && s.getBoundingClientRect().top < 120) current = i; }); + links.forEach(function (a, i) { a.classList.toggle("active", i === current); }); + } + document.addEventListener("scroll", spy, { passive: true }); + spy(); +} + +function visible(node) { return node.style.display !== "none"; } + +function filterResults(shown, search) { + var text = (search && search.value || "").toLowerCase(); + document.querySelectorAll("details.check").forEach(function (d) { + var ok = shown[d.dataset.status] !== false && (!text || d.dataset.search.indexOf(text) >= 0); + d.style.display = ok ? "" : "none"; + }); + document.querySelectorAll(".category").forEach(function (c) { + var checks = c.querySelectorAll("details.check"); + c.style.display = Array.prototype.some.call(checks, visible) ? "" : "none"; + }); +} + +function setUpFilters() { + var shown = {}, search = document.getElementById("result-search"); + var buttons = document.querySelectorAll(".filter"); + buttons.forEach(function (b) { shown[b.dataset.filter] = b.getAttribute("aria-pressed") === "true"; }); + buttons.forEach(function (b) { + b.addEventListener("click", function () { + shown[b.dataset.filter] = !shown[b.dataset.filter]; + b.setAttribute("aria-pressed", String(shown[b.dataset.filter])); + filterResults(shown, search); + }); + }); + if (search) search.addEventListener("input", function () { filterResults(shown, search); }); + filterResults(shown, search); +} + +function openLinkedResult() { + var target = location.hash && document.getElementById(location.hash.slice(1)); + if (target && target.tagName === "DETAILS") { target.open = true; target.style.display = ""; } +} + +function FactBrowser(data) { + this.data = data; + this.kinds = document.getElementById("fact-kinds"); + this.list = document.getElementById("fact-list"); + this.doc = document.getElementById("fact-doc"); + this.page = document.getElementById("fact-page"); + this.search = document.getElementById("fact-search"); + this.kind = null; + this.offset = 0; + this.size = 50; + this.docs = {}; +} + +FactBrowser.prototype.kindButton = function (name, count, title, kind) { + var self = this, button = element("button", kind === null ? "active" : ""); + button.appendChild(element("span", "", name)); + button.appendChild(element("span", "n", String(count))); + if (title) button.title = title; + button.addEventListener("click", function () { self.pick(kind, button); }); + this.kinds.appendChild(button); +}; + +FactBrowser.prototype.pick = function (kind, button) { + this.kind = kind; + this.offset = 0; + this.kinds.querySelectorAll("button").forEach(function (b) { b.classList.toggle("active", b === button); }); + this.render(); +}; + +FactBrowser.prototype.matching = function () { + var kind = this.kind, text = (this.search.value || "").toLowerCase(); + return this.data.facts.filter(function (f) { + if (kind && f.k !== kind) return false; + return !text || (f.k + " " + f.o + " " + JSON.stringify(f.f)).toLowerCase().indexOf(text) >= 0; + }); +}; + +FactBrowser.prototype.item = function (fact) { + var item = element("div", "fact"), head = element("div"), fields = element("dl"); + head.appendChild(element("strong", "", fact.k)); + head.appendChild(document.createTextNode(" ")); + var origin = element(fact.u ? "a" : "span", fact.u ? "origin" : "origin muted", fact.o); + if (fact.u) { origin.href = fact.u; origin.target = "_blank"; origin.rel = "noopener"; } + head.appendChild(origin); + Object.keys(fact.f).forEach(function (key) { + var value = fact.f[key]; + if (value === null || value === "" || value === false || (Array.isArray(value) && !value.length)) return; + fields.appendChild(element("dt", "", key)); + fields.appendChild(element("dd", "", typeof value === "string" ? value : JSON.stringify(value))); + }); + item.appendChild(head); + item.appendChild(fields); + return item; +}; + +FactBrowser.prototype.render = function () { + var self = this, found = this.matching(), last = Math.min(this.offset + this.size, found.length); + this.doc.textContent = this.kind ? this.docs[this.kind] || "" : "Every fact, in the order the stages found them."; + this.list.textContent = ""; + found.slice(this.offset, last).forEach(function (fact) { self.list.appendChild(self.item(fact)); }); + this.page.textContent = found.length ? (this.offset + 1) + " to " + last + " of " + found.length : "No fact matches."; + document.getElementById("fact-prev").disabled = this.offset === 0; + document.getElementById("fact-next").disabled = last >= found.length; +}; + +FactBrowser.prototype.start = function () { + var self = this; + this.kindButton("All facts", this.data.facts.length, "", null); + this.data.kinds.forEach(function (entry) { + self.docs[entry[0]] = entry[2]; + self.kindButton(entry[0], entry[1], entry[2], entry[0]); + }); + document.getElementById("fact-prev").addEventListener("click", function () { + self.offset = Math.max(0, self.offset - self.size); + self.render(); + }); + document.getElementById("fact-next").addEventListener("click", function () { self.offset += self.size; self.render(); }); + this.search.addEventListener("input", function () { self.offset = 0; self.render(); }); + this.render(); +}; + +followSections(); +setUpFilters(); +window.addEventListener("hashchange", openLinkedResult); +openLinkedResult(); +new FactBrowser(JSON.parse(document.getElementById("facts-data").textContent)).start(); diff --git a/project_validator/views/assets/site.css b/project_validator/views/assets/site.css new file mode 100644 index 00000000..34b59812 --- /dev/null +++ b/project_validator/views/assets/site.css @@ -0,0 +1,43 @@ +/* The documentation site and the leaderboard, on top of theme.css. */ +.page { padding: 2rem 0 1rem; } +.prose { max-width: 50rem; } +.prose h1 { font-size: 2rem; margin: .5rem 0 1rem; } +.prose h2 { padding-top: .5rem; border-top: 1px solid var(--border); } +.prose table { margin: 1rem 0; display: block; overflow-x: auto; } +.prose img { max-width: 100%; } +.prose li + li { margin-top: .2rem; } +.prose blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--accent); + background: var(--accent-soft); border-radius: 0 9px 9px 0; } +.page.wide .prose { max-width: none; } +.built { color: var(--muted); font-size: .82rem; white-space: nowrap; } + +/* the support matrix: sticky headers, centred cells */ +.support table { font-size: .8rem; display: block; overflow: auto; max-height: 80vh; } +.support th { position: sticky; top: 0; background: var(--surface); z-index: 1; } +.support td:first-child, .support th:first-child { position: sticky; left: 0; background: var(--surface); + font-family: var(--mono); white-space: nowrap; z-index: 2; } +.support td { text-align: center; white-space: nowrap; } +.support td.none { color: var(--border); } +.support td.applies { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); } +.support td:first-child { text-align: left; } + +/* the leaderboard */ +.lead { font-size: 1.05rem; color: var(--muted); } +.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; } +.tab { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; + padding: .3rem .85rem; cursor: pointer; font: inherit; font-size: .88rem; } +.tab .n { color: var(--muted); font-size: .8rem; margin-left: .2rem; } +.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; } +.tab.active .n { color: rgba(255, 255, 255, .8); } +.ranking td.rank { font-weight: 800; color: var(--muted); width: 2.5rem; font-variant-numeric: tabular-nums; } +.ranking tbody tr:nth-child(1) td.rank { color: #c99a06; } +.ranking tbody tr:nth-child(2) td.rank { color: #8a96a3; } +.ranking tbody tr:nth-child(3) td.rank { color: #b0702c; } +.scorebar { display: grid; grid-template-columns: minmax(6rem, 10rem) 3.2rem; gap: .6rem; align-items: center; } +.scorebar strong { text-align: right; font-variant-numeric: tabular-nums; } +.project-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; } +.facts-list { margin: .6rem 0 0; padding-left: 1.1rem; color: var(--muted); } +.facts-list a { font-weight: 500; } +.sparkline { color: var(--accent); width: 100%; height: auto; } +.plus { color: var(--pass); } +@media (max-width: 760px) { .project-hero { grid-template-columns: 1fr; justify-items: center; } } diff --git a/project_validator/views/assets/theme.css b/project_validator/views/assets/theme.css new file mode 100644 index 00000000..758d32ec --- /dev/null +++ b/project_validator/views/assets/theme.css @@ -0,0 +1,183 @@ +:root { + color-scheme: light dark; + --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1c2128; --muted: #5b6573; + --border: #d8dee4; --accent: #5b4bdb; --accent-2: #0e8a9b; --accent-soft: #ecebff; + --pass: #1a7f37; --warn: #a06800; --fail: #cf222e; --error: #8250df; --skip: #7b8590; + --pass-soft: #dafbe1; --warn-soft: #fff4d1; --fail-soft: #ffe4e4; --error-soft: #f1e8ff; --skip-soft: #eef0f2; + --shadow: 0 1px 2px rgba(31, 35, 40, .06), 0 4px 16px rgba(31, 35, 40, .06); + --radius: 12px; --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; + --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; +} +@media (prefers-color-scheme: dark) { + :root:not([data-theme="light"]) { + --bg: #0d1117; --surface: #151b23; --surface-2: #1c232d; --text: #e6edf3; --muted: #9aa5b1; + --border: #2d3540; --accent: #9d8cff; --accent-2: #3cc5d6; --accent-soft: #241f45; + --pass: #3fb950; --warn: #d6a32a; --fail: #ff6b63; --error: #b392ff; --skip: #8b949e; + --pass-soft: #12291a; --warn-soft: #2e2510; --fail-soft: #3a1618; --error-soft: #271c3d; --skip-soft: #1f252d; + --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); + } +} +:root[data-theme="dark"] { + --bg: #0d1117; --surface: #151b23; --surface-2: #1c232d; --text: #e6edf3; --muted: #9aa5b1; + --border: #2d3540; --accent: #9d8cff; --accent-2: #3cc5d6; --accent-soft: #241f45; + --pass: #3fb950; --warn: #d6a32a; --fail: #ff6b63; --error: #b392ff; --skip: #8b949e; + --pass-soft: #12291a; --warn-soft: #2e2510; --fail-soft: #3a1618; --error-soft: #271c3d; --skip-soft: #1f252d; + --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); +} +* { box-sizing: border-box; } +html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; } +body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); } +a { color: var(--accent); text-decoration: none; } +a:hover { text-decoration: underline; } +code, pre, kbd { font-family: var(--mono); font-size: .9em; } +code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; } +pre { background: var(--surface-2); padding: .9rem 1rem; border-radius: 10px; overflow-x: auto; } +pre code { background: none; padding: 0; } +h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; } +h2 { font-size: 1.3rem; margin: 2.2rem 0 .9rem; } +h3 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; } +.muted { color: var(--muted); } +.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; } + +/* the top bar */ +.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 88%, transparent); + backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--border); } +.topbar .wrap { display: flex; align-items: center; gap: 1.25rem; height: 3.5rem; } +.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); white-space: nowrap; } +.brand:hover { text-decoration: none; } +.brand .logo { width: 1.6rem; height: 1.6rem; border-radius: 7px; + background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; + color: #fff; font-size: .8rem; font-weight: 800; } +.topbar nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; } +.topbar nav a { color: var(--muted); padding: .35rem .7rem; border-radius: 8px; white-space: nowrap; font-weight: 500; } +.topbar nav a:hover, .topbar nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; } +.theme-toggle { font-size: .85rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; + padding: .3rem .55rem; cursor: pointer; font: inherit; } + +/* cards and layout */ +.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); + box-shadow: var(--shadow); padding: 1.25rem 1.4rem; } +.grid { display: grid; gap: 1rem; } +.grid.two { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); } +.grid.three { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } +.card h3:first-child, .card h2:first-child { margin-top: 0; } + +/* the hero */ +.hero { padding: 2rem 0 1rem; } +.hero .card { display: grid; grid-template-columns: auto 1fr; gap: 1.75rem; align-items: center; } +.hero h1 { margin: 0 0 .25rem; font-size: 1.9rem; } +.hero .where { color: var(--muted); font-size: .92rem; word-break: break-all; } +.ring { width: 9.5rem; height: 9.5rem; position: relative; } +.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); } +.ring .track { stroke: var(--surface-2); } +.ring .value { stroke-linecap: round; transition: stroke-dashoffset .6s ease; } +.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; } +.ring .label strong { font-size: 2.1rem; display: block; line-height: 1; } +.ring .label span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; } +.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; } +.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; + font-size: .82rem; font-weight: 600; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); } +.chip.level { background: var(--accent-soft); color: var(--accent); border-color: transparent; } + +/* statuses */ +.s-PASS { --s: var(--pass); --s-soft: var(--pass-soft); } +.s-WARN { --s: var(--warn); --s-soft: var(--warn-soft); } +.s-FAIL { --s: var(--fail); --s-soft: var(--fail-soft); } +.s-ERROR { --s: var(--error); --s-soft: var(--error-soft); } +.s-SKIP { --s: var(--skip); --s-soft: var(--skip-soft); } +.pill { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: 4.2rem; + padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; + color: var(--s); background: var(--s-soft); } +.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--s); display: inline-block; flex: none; } + +/* bars */ +.bar { height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; } +.bar > span { display: block; height: 100%; border-radius: 999px; + background: linear-gradient(90deg, var(--accent), var(--accent-2)); } +.breakdown { display: grid; grid-template-columns: minmax(7rem, auto) 1fr 3.5rem; gap: .5rem .9rem; + align-items: center; font-size: .9rem; } + +/* tables */ +table { width: 100%; border-collapse: collapse; font-size: .9rem; } +th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; } +th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; } +tbody tr:hover { background: var(--surface-2); } +td code, td .pill, td .chip { white-space: nowrap; } +.table-wrap { overflow-x: auto; } + +/* results */ +.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; } +.toolbar input[type=search] { flex: 1; min-width: 14rem; padding: .5rem .75rem; border-radius: 9px; + border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; } +.filter { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; + padding: .3rem .8rem; cursor: pointer; font: inherit; font-size: .85rem; display: inline-flex; gap: .4rem; + align-items: center; } +.filter[aria-pressed="false"] { opacity: .45; } +.category { margin-top: 1.5rem; } +.category > h3 { display: flex; align-items: center; gap: .6rem; } +.category > h3 .count { color: var(--muted); font-weight: 500; font-size: .85rem; } +details.check { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin: .45rem 0; + border-left: 4px solid var(--s); } +details.check > summary { list-style: none; cursor: pointer; padding: .7rem 1rem; display: grid; + grid-template-columns: auto minmax(10rem, 14rem) 1fr; gap: .9rem; align-items: baseline; } +details.check > summary::-webkit-details-marker { display: none; } +details.check > summary .name { font-family: var(--mono); font-weight: 600; font-size: .88rem; } +details.check > summary .message { color: var(--muted); } +details.check[open] > summary { border-bottom: 1px solid var(--border); } +details.check .body { padding: .9rem 1.1rem 1rem; } +.why { background: var(--accent-soft); border-radius: 9px; padding: .6rem .85rem; margin-bottom: .8rem; font-size: .9rem; } +.places td .details { margin: .3rem 0 0; padding-left: 1rem; color: var(--muted); font-size: .85rem; } +.tools { display: inline-flex; flex-wrap: wrap; gap: .25rem; } +.tool { font-family: var(--mono); font-size: .78rem; padding: .05rem .4rem; border-radius: 5px; + background: var(--surface-2); border: 1px solid var(--border); } + +/* the matrix */ +.matrix { width: auto; } +.matrix th.col { height: 9rem; vertical-align: bottom; text-align: center; padding: .3rem .2rem; + text-transform: none; letter-spacing: 0; font-size: .82rem; } +.matrix th.col span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; } +.matrix td.cell { text-align: center; padding: .3rem; } +.matrix td.cell a { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 7px; + background: var(--s-soft); color: var(--s); font-weight: 800; text-decoration: none; } +.matrix td.none { color: var(--border); text-align: center; } +.matrix th.row { font-family: var(--mono); font-size: .82rem; text-transform: none; letter-spacing: 0; + color: var(--text); white-space: nowrap; position: sticky; left: 0; background: var(--surface); } + +/* facts */ +.facts { display: grid; grid-template-columns: 16rem 1fr; gap: 1rem; align-items: start; } +.kinds { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; padding: .5rem; } +.kinds button { display: flex; width: 100%; justify-content: space-between; gap: .5rem; border: 0; + background: none; color: var(--text); padding: .4rem .6rem; border-radius: 7px; cursor: pointer; font: inherit; + font-size: .87rem; text-align: left; } +.kinds button:hover, .kinds button.active { background: var(--surface-2); } +.kinds button .n { color: var(--muted); font-variant-numeric: tabular-nums; } +.fact-doc { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; } +.fact { border-bottom: 1px solid var(--border); padding: .55rem 0; } +.fact .origin { font-family: var(--mono); font-size: .8rem; } +.fact dl { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .15rem .9rem; margin: .35rem 0 0; + font-size: .85rem; } +.fact dt { color: var(--muted); } +.fact dd { margin: 0; font-family: var(--mono); font-size: .8rem; word-break: break-word; } +.pager { display: flex; gap: .5rem; align-items: center; margin-top: .8rem; } +.pager button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 7px; + padding: .25rem .7rem; cursor: pointer; font: inherit; } + +/* stages */ +.stages { display: grid; gap: .4rem; } +.stage { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr 6rem; gap: .8rem; align-items: center; + font-size: .88rem; } +.stage .n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; } + +footer { color: var(--muted); font-size: .85rem; padding: 2.5rem 0 3rem; text-align: center; } +@media (max-width: 760px) { + .hero .card { grid-template-columns: 1fr; justify-items: center; text-align: center; } + .facts { grid-template-columns: 1fr; } + .kinds { position: static; max-height: 14rem; } + details.check > summary { grid-template-columns: auto 1fr; } + details.check > summary .message { grid-column: 1 / -1; } +} +@media print { + .topbar, .toolbar, .theme-toggle, .pager { display: none; } + details.check { break-inside: avoid; } + body { background: #fff; } +} diff --git a/project_validator/views/assets/theme.js b/project_validator/views/assets/theme.js new file mode 100644 index 00000000..feb8ffbe --- /dev/null +++ b/project_validator/views/assets/theme.js @@ -0,0 +1,14 @@ +(function () { + var root = document.documentElement, key = "pv-theme"; + var saved = null; + try { saved = localStorage.getItem(key); } catch (e) {} + if (saved) root.dataset.theme = saved; + document.addEventListener("click", function (event) { + var button = event.target.closest && event.target.closest(".theme-toggle"); + if (!button) return; + var dark = root.dataset.theme ? root.dataset.theme === "dark" + : window.matchMedia("(prefers-color-scheme: dark)").matches; + root.dataset.theme = dark ? "light" : "dark"; + try { localStorage.setItem(key, root.dataset.theme); } catch (e) {} + }); +})(); diff --git a/project_validator/views/common.py b/project_validator/views/common.py new file mode 100644 index 00000000..2fa5f488 --- /dev/null +++ b/project_validator/views/common.py @@ -0,0 +1,200 @@ +"""What the views share: how a result's places are named, how the checks are grouped, what was detected, in words. + +Everything here is plain data and text, so that every view says the same thing and the tests can read it. +""" + +from __future__ import annotations + +import math +from collections import Counter +from collections.abc import Iterable, Sequence +from dataclasses import dataclass + +from project_validator.analysis import Analysis, Git, RoleSummary +from project_validator.core import Placed, Status +from project_validator.explanations import CATEGORIES, category +from project_validator.runner import Report + +# How each status is shown, in words and as a symbol, worst first. +STATUS_ORDER = (Status.ERROR, Status.FAIL, Status.WARN, Status.PASS, Status.SKIP) +SYMBOLS = {Status.PASS: "✔", Status.WARN: "▲", Status.FAIL: "✘", Status.ERROR: "!", Status.SKIP: "-"} +OUTCOMES = { + Status.PASS: "passed", + Status.WARN: "warned", + Status.FAIL: "failed", + Status.ERROR: "errored", + Status.SKIP: "skipped", +} +ROLE_NAMES = { + "product": "the product", + "test": "tests", + "example": "examples", + "docs": "documentation", + "tooling": "tooling", + "benchmark": "benchmarks", + "template": "templates", + "vendored": "vendored code", +} + + +def branch_label(git: Git) -> str: + """The branch a checkout is on, or "detached".""" + return git.branch if git.branch not in (None, "HEAD") else "detached" + + +def credit(value: float) -> str: + """Extra credit, in percent, as the views show it: a tenth below one point, whole points above.""" + return f"{value:.1f}" if value < 1 else str(math.floor(round(value, 6))) + + +def dedupe(lines: Iterable[str]) -> list[str]: + """`lines` without repeats, in order.""" + return list(dict.fromkeys(lines)) + + +def place_label(place: Placed) -> str: + """`C++`, `C++ in lib`, `Python (auxiliary: tooling)`; "" for the whole project.""" + unit = "" if place.unit in ("", ".") else f" in {place.unit}" + auxiliary = f" (auxiliary: {', '.join(place.auxiliary)})" if place.auxiliary else "" + return f"{place.ecosystem}{unit}{auxiliary}" + + +def judged_places(report: Report) -> list[Placed]: + """The places a report judged (not skipped), worst first.""" + places = [place for place in report.result.places if place.result.status is not Status.SKIP] + return sorted(places, key=lambda place: STATUS_ORDER.index(place.result.status)) + + +def is_skipped(report: Report) -> bool: + return report.result.status is Status.SKIP + + +@dataclass(frozen=True, slots=True) +class Group: + category: str + reports: tuple[Report, ...] + + @property + def counts(self) -> Counter[Status]: + return Counter(report.result.status for report in self.reports) + + +def grouped(reports: Sequence[Report]) -> list[Group]: + """The judged reports by category, in the categories' order, worst first within each.""" + order = (*CATEGORIES, "Other") + by_category: dict[str, list[Report]] = {} + for report in reports: + if not is_skipped(report): + by_category.setdefault(category(report.check.name), []).append(report) + return [ + Group(name, tuple(sorted(by_category[name], key=lambda r: (STATUS_ORDER.index(r.result.status), r.check.name)))) + for name in order + if name in by_category + ] + + +def counts(reports: Iterable[Report]) -> Counter[Status]: + return Counter(report.result.status for report in reports) + + +def summary(reports: Sequence[Report]) -> str: + """`49 checks: 30 passed, 8 warned, 3 failed, 8 skipped`.""" + found = counts(reports) + outcomes = ", ".join(f"{found[status]} {OUTCOMES[status]}" for status in OUTCOMES if found[status]) + return f"{len(reports)} checks: {outcomes}" if reports else "no checks were run" + + +def ecosystems(analysis: Analysis) -> list[tuple[str, str]]: + """(ecosystem, what recognised it) for each ecosystem detected.""" + if analysis.structure is None: + return [] + return [(label, ", ".join(signals)) for label, signals in analysis.structure.recognised_by.items()] + + +def units(analysis: Analysis) -> list[tuple[str, str, str, str]]: + """(directory, role, build systems, languages and formats) for each unit.""" + if analysis.structure is None: + return [] + return [ + ( + unit.directory, + unit.role, + ", ".join(unit.build_systems) or "none", + ", ".join(sorted(unit.languages | unit.formats)) or "-", + ) + for unit in analysis.structure.units + ] + + +def role_line(summary_: RoleSummary) -> str: + """`tests: tests/ (12 files, C++, Python)`, with how it is judged.""" + directories = ", ".join(f"{directory}/" if directory != "." else "the root" for directory in summary_.directories) + languages = f", {', '.join(summary_.languages)}" if summary_.languages else "" + files = f"{summary_.files} file{'s' if summary_.files != 1 else ''}" + return f"{ROLE_NAMES.get(summary_.role, summary_.role)}: {directories} ({files}{languages})" + + +def role_judgement(summary_: RoleSummary) -> str: + """How the code in a role is judged, and how to change it.""" + if summary_.role == "vendored": + return "other projects' code: never judged" + if summary_.auxiliary: + return "judged as auxiliary code (--auxiliary)" + if summary_.suggestion: + return f"judged as the product; {summary_.suggestion} would judge it as auxiliary" + return "judged as the product" + + +def ci_summary(analysis: Analysis) -> str: + """`GitHub Actions, GitLab CI: 33 jobs in 6 files`, or that there is none.""" + structure = analysis.structure + if structure is None or not structure.ci_files: + return "none found" + jobs = len(structure.ci_jobs) + files = len(structure.ci_files) + providers = ", ".join(structure.ci_providers) + return f"{providers}: {jobs} job{'s' if jobs != 1 else ''} in {files} file{'s' if files != 1 else ''}" + + +def reading(analysis: Analysis) -> str: + """`1,500 facts in 0.31 s`: how much was read.""" + return f"{len(analysis.facts.all):,} facts in {analysis.seconds:.2f} s" + + +def unrecognised(analysis: Analysis) -> str: + """The suffixes no ecosystem recognised, most common first: languages the validator does not know yet.""" + if analysis.structure is None or not analysis.structure.unrecognised_suffixes: + return "" + return ", ".join(f"{suffix} ({count})" for suffix, count in analysis.structure.unrecognised_suffixes[:8]) + + +def fact_kinds(analysis: Analysis) -> list[tuple[str, int]]: + """Each kind of fact found, with how many, most first.""" + found = Counter(type(fact).__name__ for fact in analysis.facts.all) + return sorted(found.items(), key=lambda item: (-item[1], item[0])) + + +__all__ = [ + "OUTCOMES", + "ROLE_NAMES", + "STATUS_ORDER", + "SYMBOLS", + "Group", + "branch_label", + "ci_summary", + "counts", + "credit", + "dedupe", + "ecosystems", + "fact_kinds", + "grouped", + "is_skipped", + "judged_places", + "place_label", + "reading", + "role_judgement", + "role_line", + "summary", + "units", + "unrecognised", +] diff --git a/project_validator/views/console.py b/project_validator/views/console.py new file mode 100644 index 00000000..dc3ebe34 --- /dev/null +++ b/project_validator/views/console.py @@ -0,0 +1,270 @@ +"""The console report, with rich (`pip install project_validator[pretty]`): a header with the score, what was +detected and how it was read, the results grouped by category with each language's result on its own line, and the +score's breakdown and next steps. Skipped checks are counted, not listed, and long details are cut, unless +`verbose`. + +rich is optional: `available()` says whether it is installed, and the CLI falls back to the plain text report. +""" + +from __future__ import annotations + +import importlib +from types import ModuleType +from typing import Any, TextIO + +from project_validator.analysis import Analysis +from project_validator.core import Status +from project_validator.runner import Report +from project_validator.score import LEVEL_NAMES, Score +from project_validator.views.common import ( + SYMBOLS, + Group, + branch_label, + ci_summary, + credit, + dedupe, + ecosystems, + grouped, + is_skipped, + judged_places, + place_label, + reading, + role_judgement, + role_line, + summary, + units, + unrecognised, +) + + +class ConsoleError(Exception): + pass + + +def _import_rich() -> dict[str, ModuleType] | None: + try: + return { + name: importlib.import_module(f"rich.{name}") + for name in ("console", "text", "table", "panel", "rule", "progress_bar", "padding", "box") + } + except ImportError: + return None + + +_rich = _import_rich() + +STYLES = { + Status.PASS: "green", + Status.WARN: "yellow", + Status.FAIL: "red", + Status.ERROR: "magenta", + Status.SKIP: "bright_black", +} +DETAILS_SHOWN = 3 # details shown per result before they are cut, unless verbose +NEXT_STEPS = 8 +ACCENT = "cyan" + + +def available() -> bool: + return _rich is not None + + +def score_style(percent: float) -> str: + if percent >= 100: + return "bold green" + if percent >= 75: + return "green" + if percent >= 50: + return "yellow" + return "red" + + +class _Renderer: + def __init__(self, rich: dict[str, ModuleType], console: Any, *, verbose: bool) -> None: + self.rich, self.console, self.verbose = rich, console, verbose + self.text = rich["text"].Text + + def print(self, *renderables: Any) -> None: + self.console.print(*renderables) + + def status(self, status: Status) -> Any: + return self.text(SYMBOLS[status], style=f"bold {STYLES[status]}") + + def bar(self, percent: float, width: int = 30) -> Any: + return self.rich["progress_bar"].ProgressBar( + total=100, completed=min(percent, 100.0), width=width, complete_style=score_style(percent) + ) + + # --- the sections + + def header(self, analysis: Analysis) -> None: + title = self.text.assemble(("project_validator ", "bold"), (analysis.validator, "dim")) + top = self.text.assemble((analysis.name, f"bold {ACCENT}"), " ", (str(analysis.project), "dim")) + if analysis.git.commit: + top.append(f" {branch_label(analysis.git)} @ {analysis.git.commit[:10]}", style="dim") + body: list[Any] = [top] + if analysis.score is not None: + body.append(self._score_line(analysis.score)) + body.append(self.text(summary(analysis.reports), style="dim")) + group = self.rich["console"].Group(*body) + self.print(self.rich["panel"].Panel(group, title=title, title_align="left", border_style=ACCENT)) + + def _score_line(self, scored: Score) -> Any: + table = self.rich["table"].Table.grid(padding=(0, 2)) + line = self.text.assemble( + (f"{int(scored.percent)}%", score_style(scored.percent) + " bold"), + " ", + (f"Level {scored.level} {LEVEL_NAMES[scored.level]}", "bold"), + ) + gates = f"{scored.gates} of {len(scored.cells)} gates in place" + if scored.extra: + gates += f", +{credit(scored.extra)} extra credit" + table.add_row(line, self.bar(scored.percent), self.text(gates, style="dim")) + return table + + def table(self, *columns: str) -> Any: + found = self.rich["table"].Table(box=self.rich["box"].SIMPLE_HEAD, show_edge=False, pad_edge=False) + for column in columns: + found.add_column(column) + return found + + def detected(self, analysis: Analysis) -> None: + self.print(self.rich["rule"].Rule("[bold]What was detected", align="left", style=ACCENT)) + if analysis.structure is None: + self.print(self.text(f"The project could not be read: {analysis.error}", style="bold red")) + return + languages = self.table("Language or format", "Recognised by") + for label, signals in ecosystems(analysis): + languages.add_row(self.text(label, style=f"bold {ACCENT}"), signals) + self.print(languages) + found = self.table("Unit", "Role", "Built with", "Languages and formats") + for directory, role, systems, names in units(analysis): + found.add_row(directory if directory != "." else ". (the root)", role, systems, names) + self.print(found) + self.print(self.facts(analysis)) + if self.verbose: + for stage in analysis.stages: + self.print(self.text(f" {stage.name}: {stage.found:,} facts in {stage.seconds:.3f} s", style="dim")) + self.print() + + def facts(self, analysis: Analysis) -> Any: + """The code in each role and how it is judged, what was not recognised, the CI and how much was read.""" + grid = self.rich["table"].Table.grid(padding=(0, 2)) + grid.add_column(no_wrap=True, style="bold") + grid.add_column(ratio=1) + for found in analysis.roles: + style = "yellow" if found.suggestion else "dim" + label, _, where = role_line(found).partition(": ") + grid.add_row(f"Code: {label}", self.text.assemble(where, "\n", (role_judgement(found), style))) + if missing := unrecognised(analysis): + grid.add_row("Not recognised", self.text(missing, style="dim")) + grid.add_row("CI", ci_summary(analysis)) + grid.add_row("Read", reading(analysis)) + return grid + + def group(self, found: Group) -> None: + counts = found.counts + tally = " ".join(f"{SYMBOLS[status]} {counts[status]}" for status in SYMBOLS if counts[status]) + self.print(self.rich["rule"].Rule(f"[bold]{found.category}[/] [dim]{tally}[/]", align="left", style=ACCENT)) + grid = self.rich["table"].Table.grid(padding=(0, 1)) + grid.add_column(width=1) + grid.add_column(width=1) + grid.add_column(no_wrap=True, style="bold") + grid.add_column(ratio=1) + for report in found.reports: + grid.add_row("", self.status(report.result.status), report.check.name, self.result(report)) + self.print(grid) + self.print() + + def result(self, report: Report) -> Any: + """A report's result: its message and details, or one line per place when it was judged in several.""" + places = judged_places(report) + if len(places) <= 1: + result = places[0].result if places else report.result + return self.with_details(result.message, result.details) + grid = self.rich["table"].Table.grid(padding=(0, 1)) + grid.add_column(width=1) + grid.add_column(no_wrap=True, style=ACCENT) + grid.add_column(ratio=1) + for place in places: + body = self.with_details(place.result.message, place.result.details) + grid.add_row(self.status(place.result.status), place_label(place), body) + return grid + + def with_details(self, message: str, details: tuple[str, ...]) -> Any: + """The message, then its details (said once, and cut unless verbose), dimmed.""" + text = self.text(message) + lines = dedupe(details) + shown = lines if self.verbose else lines[:DETAILS_SHOWN] + for detail in shown: + text.append("\n" + detail, style="dim") + if hidden := len(lines) - len(shown): + text.append(f"\n… {hidden} more (--verbose shows them)", style="dim italic") + return text + + def skipped(self, reports: tuple[Report, ...]) -> None: + found = [report for report in reports if is_skipped(report)] + if not found: + return + if self.verbose: + self.print(self.rich["rule"].Rule("[bold]Not applicable", align="left", style="bright_black")) + for report in found: + self.print(self.text(f" {SYMBOLS[Status.SKIP]} {report.check.name}: {report.result.message}", "dim")) + else: + names = ", ".join(report.check.name for report in found) + self.print(self.text(f"{len(found)} checks do not apply here: {names} (--verbose says why)", "dim")) + self.print() + + def score(self, scored: Score) -> None: + self.print(self.rich["rule"].Rule("[bold]Score", align="left", style=ACCENT)) + self.print(self._score_line(scored)) + self.print(self.text(scored.summary(), style="dim")) + breakdown = self.rich["table"].Table(box=None, show_header=False, pad_edge=False, padding=(0, 2)) + for name, (filled, slots) in sorted(scored.breakdown().items()): + percent = 100.0 * filled / slots if slots else 100.0 + breakdown.add_row( + self.text(name or "the whole project", style=ACCENT), + self.bar(percent, 20), + self.text(f"{int(percent)}%", style=score_style(percent)), + self.text(f"{filled:g} of {slots:g} slots", style="dim"), + ) + self.print(breakdown) + if scored.next_steps: + self.next_steps(scored) + + def next_steps(self, scored: Score) -> None: + self.print() + self.print(self.text("Next steps", style="bold")) + steps = self.rich["table"].Table.grid(padding=(0, 2)) + steps.add_column(no_wrap=True, justify="right") + steps.add_column(ratio=1) + for step in scored.next_steps[: None if self.verbose else NEXT_STEPS]: + head = self.text.assemble((step.check, "bold")) + if step.where: + head.append(f" {step.where}", style=ACCENT) + if step.needed_for: + verb = "completes" if step.completes else "needed for" + head.append(f" {verb} Level {step.needed_for} {LEVEL_NAMES[step.needed_for]}", style="bold yellow") + head.append("\n" + (step.hint or step.message), style="dim") + steps.add_row(self.text(f"+{step.points:.1f}", style="bold green"), head) + self.print(steps) + if not self.verbose and len(scored.next_steps) > NEXT_STEPS: + self.print(self.text(f"… {len(scored.next_steps) - NEXT_STEPS} more (--verbose)", "dim italic")) + + +def render(analysis: Analysis, stream: TextIO, *, verbose: bool = False, width: int | None = None) -> None: + """Print the console report of `analysis` to `stream`.""" + if _rich is None: + raise ConsoleError("rich is not available") + console = _rich["console"].Console(file=stream, force_terminal=True, soft_wrap=False, highlight=False, width=width) + renderer = _Renderer(_rich, console, verbose=verbose) + renderer.header(analysis) + renderer.detected(analysis) + for found in grouped(analysis.reports): + renderer.group(found) + renderer.skipped(analysis.reports) + if analysis.score is not None: + renderer.score(analysis.score) + + +__all__ = ["ConsoleError", "available", "render"] diff --git a/project_validator/views/html.py b/project_validator/views/html.py new file mode 100644 index 00000000..59e8a2ed --- /dev/null +++ b/project_validator/views/html.py @@ -0,0 +1,519 @@ +"""The HTML report: one self-contained file (no network, nothing to install) with everything the analysis knows. + +- **Overview**: the score ring, the level, the status counts, each language's share of its gates, the next steps. +- **Detected**: the languages and formats and what recognised each, the units, the code in each role (and the + option that would judge it as auxiliary), the CI jobs with what each runs on, and how the project was read. +- **Results**: every check, grouped by category and filterable by status or text, each with why it matters and + its result in each place (language and unit), with the tools found. +- **Matrix**: the checks by language and unit, each cell linking to its result. +- **Facts**: every fact the validator extracted, by kind, searchable, each origin linking to the file on the web when + the project is a checkout with a known remote. +- **Run**: the validator's version, the options and the time each stage took. + +Everything the project supplies is escaped; the facts travel as JSON in a script element and are rendered by the +page's own script. +""" + +from __future__ import annotations + +import html +import inspect +import json +import math +from collections.abc import Iterable, Sequence +from datetime import UTC, datetime + +from project_validator.analysis import Analysis, file_url +from project_validator.core import Placed, Status +from project_validator.explanations import why +from project_validator.facts import as_dict +from project_validator.facts.jobs import Job +from project_validator.runner import Report +from project_validator.score import LEVEL_NAMES, Score +from project_validator.views.common import ( + OUTCOMES, + STATUS_ORDER, + SYMBOLS, + branch_label, + ci_summary, + counts, + credit, + dedupe, + ecosystems, + fact_kinds, + grouped, + is_skipped, + judged_places, + place_label, + reading, + role_judgement, + role_line, + summary, + units, + unrecognised, +) +from project_validator.views.theme import STYLESHEET, THEME_SCRIPT, asset + +UNIT_HEADERS = ("Directory", "Role", "Built with", "Languages and formats") +JOB_HEADERS = ("Job", "OS", "Compilers", "Toolchains", "Builds", "Configurations") +SECTIONS = ( + ("overview", "Overview"), + ("detected", "Detected"), + ("results", "Results"), + ("matrix", "Matrix"), + ("next", "Next steps"), + ("facts", "Facts"), + ("run", "Run"), +) + + +def e(value: object) -> str: + """`value` as HTML text.""" + return html.escape(str(value), quote=True) + + +def _anchor(name: str) -> str: + return "check-" + "".join(character if character.isalnum() else "-" for character in name) + + +def pill(status: Status) -> str: + return f'{SYMBOLS[status]} {status}' + + +def ring(percent: float, label: str) -> str: + radius, width = 52, 12 + circumference = 2 * math.pi * radius + shown = min(percent, 100.0) + offset = circumference * (1 - shown / 100) + colour = "var(--pass)" if percent >= 100 else "var(--accent)" if percent >= 50 else "var(--warn)" + return ( + f'' + ) + + +def bar(percent: float) -> str: + return f'
    ' + + +# --- the sections + + +def _status_chips(analysis: Analysis) -> str: + found = counts(analysis.reports) + return "".join( + f'{found[status]} {OUTCOMES[status]}' + for status in STATUS_ORDER + if found[status] + ) + + +def _score_chips(scored: Score) -> str: + chips = [ + f'Level {scored.level} · {e(LEVEL_NAMES[scored.level])}', + f'{scored.gates} of {len(scored.cells)} gates in place', + ] + if scored.extra: + chips.append(f'+{credit(scored.extra)} extra credit') + if scored.held: + chips.append(f'+{credit(scored.held)} extra credit held until 100%') + return "".join(chips) + + +def _commit(analysis: Analysis) -> str: + """` · main @ 1a2b3c4d5e`, linked to the commit on the web when the remote is known.""" + git = analysis.git + if not git.commit: + return "" + short = f"{e(git.commit[:10])}" + linked = f'{short}' if git.web else short + return f" · {e(branch_label(git))} @ {linked}" + + +def _hero(analysis: Analysis) -> str: + scored = analysis.score + drawn = ring(scored.percent, f"score {scored.percent:.0f} percent") if scored is not None else "" + chips = (_score_chips(scored) if scored is not None else "") + _status_chips(analysis) + return ( + f'
    {drawn}
    ' + f"

    {e(analysis.name)}

    " + f'
    {e(analysis.project)}{_commit(analysis)}
    ' + f'
    {chips}
    ' + f'

    {e(summary(analysis.reports))} · read {e(reading(analysis))}

    ' + f"
    " + ) + + +def _breakdown(scored: Score) -> str: + rows = [] + for name, (filled, slots) in sorted(scored.breakdown().items()): + percent = 100.0 * filled / slots if slots else 100.0 + rows.append( + f"
    {e(name or 'The whole project')}
    {bar(percent)}" + f'
    {math.floor(round(percent, 6))}%
    ' + ) + return f'
    {"".join(rows)}
    ' + + +def _top_steps(scored: Score) -> str: + items = [] + for step in scored.next_steps[:5]: + where = f" ({e(step.where)})" if step.where else "" + todo = f"
    {e(step.hint or step.message)}" if step.hint or step.message else "" + items.append( + f'
  • +{step.points:.1f} {e(step.check)}' + f"{where}{todo}
  • " + ) + return ( + f'
      {"".join(items)}
    ' if items else "

    Every gate is in place.

    " + ) + + +SCORE_EXPLAINED = ( + "100% means every quality gate that applies to each part of the project is in place. Each check's result for a " + "language in a unit is one slot: a pass fills it, a warning half; auxiliary code weighs half. Complementary " + "tools (a second analyser, scanner or fuzzer) earn extra credit above 100%, once every gate is in place." +) + + +def _overview(analysis: Analysis) -> str: + scored = analysis.score + if scored is None: + return "" + return ( + '
    ' + f'

    Gates in place, by language

    {_breakdown(scored)}' + f'

    {e(SCORE_EXPLAINED)}

    ' + f'

    Next steps

    {_top_steps(scored)}' + '

    All next steps →

    ' + "
    " + ) + + +def table(headers: Sequence[str], rows: Iterable[Sequence[str]]) -> str: + head = "".join(f"{e(header)}" for header in headers) + body = "".join("" + "".join(f"{cell}" for cell in row) + "" for row in rows) + return f'
    {head}{body}
    ' + + +def _languages_card(analysis: Analysis) -> str: + rows = ((f"{e(label)}", e(signals)) for label, signals in ecosystems(analysis)) + found = unrecognised(analysis) + extra = f'

    Not recognised: {e(found)}

    ' if found else "" + listed = table(("Language or format", "Recognised by"), rows) + return f'

    Languages and formats

    {listed}{extra}
    ' + + +def _units_card(analysis: Analysis) -> str: + rows = ( + (f"{e(directory)}", e(role), e(systems), e(names)) + for directory, role, systems, names in units(analysis) + ) + return f'

    Units

    {table(UNIT_HEADERS, rows)}
    ' + + +ROLES_EXPLAINED = ( + "Every source outside vendored code is judged as the product, unless --auxiliary names it (by role, " + "language or directory): auxiliary code weighs half in the score, is not asked for the product's own gates, and " + "its failures are warnings." +) + + +def _roles_card(analysis: Analysis, vendored: Sequence[str]) -> str: + rows = ( + ( + e(role_line(found).split(":", 1)[0]), + e(", ".join(f"{d}/" if d != "." else "the root" for d in found.directories)), + str(found.files), + e(", ".join(found.languages) or "-"), + e(role_judgement(found)), + ) + for found in analysis.roles + ) + more = f" and {len(vendored) - 8} more" if len(vendored) > 8 else "" + listed = f'

    Vendored (never judged): {e(", ".join(vendored[:8]) + more)}

    ' if vendored else "" + return ( + f'

    Code by role

    ' + f'

    {ROLES_EXPLAINED}

    ' + f"{table(('Role', 'Where', 'Files', 'Languages', 'Judged'), rows)}{listed}
    " + ) + + +def _job_row(job: Job) -> tuple[str, ...]: + def listed(values: Iterable[object]) -> str: + return e(", ".join(sorted(map(str, values))) or "-") + + return ( + e(job.name), + e(job.os or "-"), + listed(job.compilers), + listed(job.toolchains), + listed(job.ecosystems), + listed(job.configurations), + ) + + +def _ci_card(analysis: Analysis, jobs: Sequence[Job]) -> str: + return ( + f'

    CI ' + f"{e(ci_summary(analysis))}

    {_jobs([_job_row(job) for job in jobs], len(jobs))}
    " + ) + + +def _detected(analysis: Analysis) -> str: + structure = analysis.structure + if structure is None: + return ( + f'

    Detected

    ' + f"

    The project could not be read: {e(analysis.error)}

    " + ) + return ( + '

    What was detected

    ' + f'
    {_languages_card(analysis)}{_units_card(analysis)}
    ' + f"{_roles_card(analysis, structure.vendored)}{_ci_card(analysis, structure.ci_jobs)}
    " + ) + + +JOBS_SHOWN = 8 # CI jobs listed before the rest are folded away + + +def _jobs(rows: Iterable[Sequence[str]], count: int) -> str: + rows = list(rows) + if not rows: + return "" + shown = table(JOB_HEADERS, rows[:JOBS_SHOWN]) + if count <= JOBS_SHOWN: + return shown + rest = table(JOB_HEADERS, rows[JOBS_SHOWN:]) + return f'{shown}
    {count - JOBS_SHOWN} more jobs{rest}
    ' + + +def _places_table(analysis: Analysis, report: Report) -> str: + places = judged_places(report) or [ + Placed(ecosystem="", unit="", result=report.result) # a check of the whole project + ] + rows = [] + for place in places: + details = dedupe(place.result.details) + listed = "".join(f"
  • {e(detail)}
  • " for detail in details) + tools = "".join(f'{e(tool)}' for tool in place.tools) + rows.append( + ( + e(place_label(place) or "the whole project"), + pill(place.result.status), + e(place.result.message) + (f'
      {listed}
    ' if listed else ""), + f'{tools}' if tools else '-', + ) + ) + return f'
    {table(("Where", "Status", "Result", "Tools"), rows)}
    ' + + +def _check(analysis: Analysis, report: Report) -> str: + status = report.result.status + reason = why(report.check.name) + search = e(f"{report.check.name} {report.result.message} {' '.join(report.result.details)}".lower()) + why_html = f'
    Why it matters. {e(reason.why)}
    ' if reason else "" + return ( + f'
    ' + f'{pill(status)}{e(report.check.name)}' + f'{e(report.result.message)}' + f'
    {why_html}' + f'

    Looks for: {e(report.check.description)}

    ' + f"{_places_table(analysis, report)}
    " + ) + + +def _results(analysis: Analysis) -> str: + found = counts(analysis.reports) + filters = "".join( + f'' + for status in STATUS_ORDER + if found[status] + ) + groups = [] + for group in grouped(analysis.reports): + tally = " · ".join( + f"{group.counts[status]} {OUTCOMES[status]}" for status in STATUS_ORDER if group.counts[status] + ) + checks = "".join(_check(analysis, report) for report in group.reports) + groups.append( + f'

    {e(group.category)} {e(tally)}

    {checks}
    ' + ) + skipped = [report for report in analysis.reports if is_skipped(report)] + if skipped: + checks = "".join(_check(analysis, report) for report in skipped) + groups.append( + f'

    Not applicable {len(skipped)}

    ' + f"{checks}
    " + ) + return ( + '

    Results

    ' + f'
    {filters}
    {"".join(groups)}
    ' + ) + + +def _matrix_columns(reports: Sequence[Report]) -> list[tuple[str, str]]: + """Each (language, unit) a check judged, the root's first.""" + columns = {(place.ecosystem, place.unit): None for report in reports for place in report.result.places} + return sorted(columns, key=lambda key: (key[1] != ".", key[1], key[0])) + + +def _matrix_cell(report: Report, place: Placed | None) -> str: + if place is None or place.result.status is Status.SKIP: + return '·' + status = place.result.status + title = e(f"{report.check.name}, {place_label(place)}: {status}: {place.result.message}") + return ( + f'' + f"{SYMBOLS[status]}" + ) + + +def _matrix(analysis: Analysis) -> str: + ordered = _matrix_columns(analysis.reports) + if not ordered: + return "" + several_units = len({unit for _, unit in ordered}) > 1 + names = (f"{label} · {unit}" if several_units and unit not in (".", "") else label for label, unit in ordered) + head = "".join(f'{e(name)}' for name in names) + rows = [] + for report in analysis.reports: + by_place = {(place.ecosystem, place.unit): place for place in report.result.places} + if all(place.result.status is Status.SKIP for place in by_place.values()): + continue # no place, or none that it judged + cells = "".join(_matrix_cell(report, by_place.get(key)) for key in ordered) + rows.append(f'{e(report.check.name)}{cells}') + return ( + '

    Matrix

    ' + f'{head}{"".join(rows)}
    ' + "
    " + ) + + +def _next_steps(scored: Score | None) -> str: + if scored is None: + return "" + if not scored.next_steps: + return ( + '

    Next steps

    ' + "

    Every quality gate that applies is in place.

    " + ) + rows = ( + ( + f'+{step.points:.1f}', + f'{e(step.check)}' + + ( + f'
    {"completes" if step.completes else "for"} ' + f"Level {step.needed_for}" + if step.needed_for + else "" + ), + e(step.where or "the whole project"), + pill(step.status), + e(step.message) + (f'
    {e(step.hint)}' if step.hint else ""), + ) + for step in scored.next_steps + ) + return ( + '

    Next steps

    ' + '

    Each gate not yet in place, with the points filling it is worth; the ' + "next level's gates first.

    " + f"{table(('Points', 'Gate', 'Where', 'Now', 'What was found'), rows)}
    " + ) + + +def _fact_doc(kind: type) -> str: + doc = inspect.getdoc(kind) or "" + return doc.split("\n\n", 1)[0].replace("\n", " ") + + +def _facts_data(analysis: Analysis) -> str: + kinds: dict[str, type] = {} + rows = [] + for fact in analysis.facts.all: + data = as_dict(fact) + kind = str(data.pop("kind")) + kinds.setdefault(kind, type(fact)) + origin = str(data.pop("origin", "")) + rows.append({"k": kind, "o": origin, "u": file_url(analysis.git, origin), "f": data}) + documented = {kind: _fact_doc(found) for kind, found in kinds.items()} + payload = {"facts": rows, "kinds": [[kind, n, documented.get(kind, "")] for kind, n in fact_kinds(analysis)]} + # In a script element, " str: + return ( + '

    Facts

    ' + '

    Everything the validator read from the project, before judging it: the sources and build ' + "files, the CI jobs and the commands each runs, the tools' settings and runs. Each check's answer is built " + "from these. Pick a kind, or search them all.

    " + '
    ' + '
    ' + '

    ' + '
    ' + '
    ' + f'
    ' + ) + + +def _run(analysis: Analysis) -> str: + total = sum(stage.seconds for stage in analysis.stages) or 1.0 + stages = "".join( + f'
    {e(stage.name)}
    {bar(100.0 * stage.seconds / total)}' + f'
    {stage.found:,} · {stage.seconds:.2f} s
    ' + for stage in analysis.stages + ) + options = "".join( + f"{e(name)}{e(value if value not in ([], None) else '-')}" + for name, value in analysis.options.items() + ) + return ( + '

    How it was read

    ' + f'

    Extraction stages

    {stages}
    ' + f'

    {e(reading(analysis))}; facts found by each stage.

    ' + f'

    Run

    ' + f"{options}" + "
    Validatorproject_validator {e(analysis.validator)}
    " + ) + + +SCRIPT = asset("report.js") + + +TOPBAR = ( + '
    ' + 'project_validator' + '' + '' + "
    " +) + + +def render(analysis: Analysis, *, generated: datetime | None = None) -> str: + """The HTML report of `analysis`, as one self-contained document.""" + when = (generated or datetime.now(UTC)).strftime("%Y-%m-%d %H:%M UTC") + navigation = "".join(f'{e(label)}' for anchor, label in SECTIONS) + sections = (_hero, _overview, _detected, _results, _matrix, _facts, _run) + body = "".join(section(analysis) for section in sections[:5]) + _next_steps(analysis.score) + body += "".join(section(analysis) for section in sections[5:]) + return ( + '\n\n\n\n' + '\n' + f"{e(analysis.name)} · project_validator\n" + f"\n\n\n\n" + f"{TOPBAR.format(navigation=navigation)}\n
    {body}
    \n" + f"
    Generated by project_validator {e(analysis.validator)} on {e(when)} in " + f"{analysis.seconds:.2f} s.
    \n\n\n\n" + ) + + +__all__ = ["SECTIONS", "bar", "e", "pill", "render", "ring", "table"] diff --git a/project_validator/views/progress.py b/project_validator/views/progress.py new file mode 100644 index 00000000..0ab88720 --- /dev/null +++ b/project_validator/views/progress.py @@ -0,0 +1,67 @@ +"""Progress while the validator works, on a terminal's stderr (with rich): the extraction stage being read, then the +checks being run, so that a large project never looks like it hangs. The finished stages are listed as they end, +with what each found.""" + +from __future__ import annotations + +from types import TracebackType +from typing import Any, Self, TextIO + +from project_validator.core import Progress +from project_validator.views.console import ACCENT, available + +STAGE_NAMES = { + "the project's structure": "Finding the sources, build files and units", + "the data files": "Parsing the data files and schemas", + "the repository": "Reading what the repository tracks and ignores", + "the test files": "Finding the tests", + "the build probes": "Building the project (--build)", + "the CI configuration": "Reading the CI configuration", + "the CI commands": "Expanding what each CI job runs", + "the CI jobs": "Working out what each CI job builds, and on what", + "the settings": "Reading the tools' settings", + "the tool runs": "Matching the tools CI runs", +} + + +class ProgressView: + """A context manager that shows `Progress` events on `stream` while it is open (when rich is available).""" + + def __init__(self, stream: TextIO, *, transient: bool = True) -> None: + self.stream, self.transient = stream, transient + self._live: Any = None + self._status: Any = None + self._console: Any = None + + def __enter__(self) -> Self: + if available(): + from rich.console import Console + from rich.status import Status + + self._console = Console(file=self.stream, force_terminal=True, highlight=False) + self._status = Status("Starting", console=self._console, spinner="dots", spinner_style=ACCENT) + self._status.start() + return self + + def __call__(self, event: Progress) -> None: + if self._status is None: + return + if event.kind == "stage" and not event.done: + self._status.update(f"[bold]{STAGE_NAMES.get(event.name, event.name)}[/]…") + elif event.kind == "stage": + self._console.print( + f"[green]✔[/] {STAGE_NAMES.get(event.name, event.name)}" + f" [dim]{event.found:,} facts, {event.seconds:.2f} s[/]", + highlight=False, + ) + elif event.kind == "check" and not event.done: + self._status.update(f"[bold]Running the checks[/] [dim]{event.index}/{event.total}[/] {event.name}") + + def __exit__( + self, kind: type[BaseException] | None, error: BaseException | None, traceback: TracebackType | None + ) -> None: + if self._status is not None: + self._status.stop() + + +__all__ = ["STAGE_NAMES", "ProgressView"] diff --git a/project_validator/views/text.py b/project_validator/views/text.py new file mode 100644 index 00000000..f30a8bb8 --- /dev/null +++ b/project_validator/views/text.py @@ -0,0 +1,67 @@ +"""The plain text report, for CI logs and terminals without rich: what was detected, then one greppable line per check +(`[STATUS] check: message`, each detail indented below it, said once), then the totals and, with `--score`, the score. +""" + +from __future__ import annotations + +from project_validator.analysis import Analysis +from project_validator.runner import Report +from project_validator.score import Score +from project_validator.views.common import ( + ci_summary, + dedupe, + ecosystems, + reading, + role_judgement, + role_line, + summary, + units, + unrecognised, +) + +NEXT_STEPS = 5 # how many next steps the report lists + + +def detected_lines(analysis: Analysis) -> list[str]: + """What was detected, and how it was read.""" + if analysis.structure is None: + return [f"Detected: nothing, the project could not be read: {analysis.error}"] + lines = ["Detected:"] + lines += [f" {label}: {signals}" for label, signals in ecosystems(analysis)] or [" no recognised language"] + for directory, role, systems, names in units(analysis): + where = "the root" if directory == "." else directory + lines.append(f" Unit {where} ({role}): built with {systems}; {names}") + lines += [f" Code of {role_line(summary_)}: {role_judgement(summary_)}" for summary_ in analysis.roles] + if found := unrecognised(analysis): + lines.append(f" Not recognised: {found}") + lines.append(f" CI: {ci_summary(analysis)}") + lines.append(f" Read: {reading(analysis)}") + return lines + + +def report_lines(reports: list[Report]) -> list[str]: + lines: list[str] = [] + for report in reports: + lines.append(f"[{report.result.status}] {report.check.name}: {report.result.message}") + lines.extend(f" {detail}" for detail in dedupe(report.result.details)) + return lines + + +def score_lines(scored: Score, *, markdown: bool = False, steps: int = NEXT_STEPS) -> list[str]: + title = "Score:" + lines = [f"**{title}** {scored.summary()}" if markdown else f"{title} {scored.summary()}"] + if scored.next_steps: + lines.append("Next steps:") + lines.extend(f" - {step.describe()}" for step in scored.next_steps[:steps]) + return lines + + +def render(analysis: Analysis, *, scored: bool = False) -> str: + """The report: what was detected, each check, the totals, and the score when `scored`.""" + lines = [*detected_lines(analysis), "", *report_lines(list(analysis.reports)), "", summary(analysis.reports)] + if scored and analysis.score is not None: + lines += ["", *score_lines(analysis.score)] + return "\n".join(lines) + + +__all__ = ["NEXT_STEPS", "detected_lines", "render", "report_lines", "score_lines"] diff --git a/project_validator/views/theme.py b/project_validator/views/theme.py new file mode 100644 index 00000000..3ce140c8 --- /dev/null +++ b/project_validator/views/theme.py @@ -0,0 +1,24 @@ +"""The design shared by the HTML report, the documentation site and the leaderboard: one stylesheet, light and dark +(following the system, or chosen with the toggle), with the status colours every view uses (`assets/theme.css`), and +the script that switches the theme and remembers the choice (`assets/theme.js`). + +They are files of the package, read once, so that the HTML report stays one self-contained file and needs nothing +installed. +""" + +from __future__ import annotations + +from importlib.resources import files + +_ASSETS = files("project_validator.views") / "assets" + + +def asset(name: str) -> str: + """The text of one of the views' assets (`theme.css`, `report.js`).""" + return (_ASSETS / name).read_text(encoding="utf-8") + + +STYLESHEET = asset("theme.css") +THEME_SCRIPT = asset("theme.js") + +__all__ = ["STYLESHEET", "THEME_SCRIPT", "asset"] diff --git a/project_validator/views/tui.py b/project_validator/views/tui.py new file mode 100644 index 00000000..90bd8bc4 --- /dev/null +++ b/project_validator/views/tui.py @@ -0,0 +1,179 @@ +"""The TUI (`--tui`, with textual: `pip install project_validator[tui]`): browse an analysis in the terminal. + +While the project is read, each extraction stage is shown as it finishes. Then a tree on the left holds the +overview, what was detected, the results by category, the score's next steps and the facts by kind; the pane on the +right shows what is selected. `/` searches the facts, `q` quits. +""" + +from __future__ import annotations + +import importlib.util +from collections.abc import Sequence +from typing import TYPE_CHECKING + +from project_validator.analysis import Analysis +from project_validator.core import Check, Context, Status +from project_validator.explanations import why +from project_validator.facts import as_dict +from project_validator.runner import Report +from project_validator.score import LEVEL_NAMES +from project_validator.views.common import ( + SYMBOLS, + ci_summary, + dedupe, + ecosystems, + judged_places, + place_label, + reading, + role_judgement, + role_line, + summary, + units, +) +from project_validator.views.console import STYLES +from project_validator.views.progress import STAGE_NAMES + +if TYPE_CHECKING: + from textual.app import App + +FACTS_SHOWN = 500 # facts listed at once; the search narrows them + + +def available() -> bool: + return importlib.util.find_spec("textual") is not None + + +def markup(text: object) -> str: + """`text` safe in textual's markup.""" + return str(text).replace("[", r"\[") + + +def status_markup(status: Status) -> str: + return f"[bold {STYLES[status]}]{SYMBOLS[status]}[/]" + + +# --- the pages, as markup + + +def overview(analysis: Analysis) -> str: + lines = [f"[bold]{markup(analysis.name)}[/] [dim]{markup(analysis.project)}[/]", ""] + if analysis.score is not None: + scored = analysis.score + lines += [ + f"[bold]{int(scored.percent)}%[/] Level {scored.level} {LEVEL_NAMES[scored.level]}", + f"[dim]{markup(scored.summary())}[/]", + "", + ] + for name, (filled, slots) in sorted(scored.breakdown().items()): + percent = 100.0 * filled / slots if slots else 100.0 + width = 24 + done = round(width * min(percent, 100) / 100) + bar = f"[green]{'█' * done}[/][dim]{'░' * (width - done)}[/]" + lines.append(f" {markup(name or 'the whole project'):<22} {bar} {int(percent)}%") + lines.append("") + lines += [markup(summary(analysis.reports)), f"[dim]Read {markup(reading(analysis))}[/]"] + return "\n".join(lines) + + +def detected(analysis: Analysis) -> str: + if analysis.structure is None: + return f"[bold red]The project could not be read:[/] {markup(analysis.error)}" + lines = ["[bold]Languages and formats[/]"] + lines += [f" [cyan]{markup(label)}[/]: {markup(signals)}" for label, signals in ecosystems(analysis)] + lines += ["", "[bold]Units[/]"] + lines += [ + f" [cyan]{markup(directory)}[/] ({markup(role)}): built with {markup(systems)}; {markup(names)}" + for directory, role, systems, names in units(analysis) + ] + lines += ["", "[bold]Code by role[/]"] + lines += [f" {markup(role_line(found))}\n [dim]{markup(role_judgement(found))}[/]" for found in analysis.roles] + lines += ["", f"[bold]CI[/]: {markup(ci_summary(analysis))}"] + for job in analysis.structure.ci_jobs: + what = ", ".join(sorted(job.compilers | {str(t) for t in job.toolchains})) or "-" + lines.append(f" {markup(job.name)} [dim]{markup(job.os or '-')} / {markup(what)}[/]") + lines += ["", "[bold]How it was read[/]"] + lines += [ + f" {markup(STAGE_NAMES.get(stage.name, stage.name))}: {stage.found:,} facts, {stage.seconds:.2f} s" + for stage in analysis.stages + ] + return "\n".join(lines) + + +def report_page(report: Report) -> str: + status = report.result.status + lines = [f"{status_markup(status)} [bold]{markup(report.check.name)}[/] {markup(report.result.message)}", ""] + if reason := why(report.check.name): + lines += [f"[italic]{markup(reason.why)}[/]", ""] + lines += [f"[dim]Looks for: {markup(report.check.description)}[/]", ""] + places = judged_places(report) + if not places: + lines += [f" [dim]{markup(detail)}[/]" for detail in dedupe(report.result.details)] + for place in places: + tools = f" [dim]tools: {markup(', '.join(place.tools))}[/]" if place.tools else "" + label = f"[cyan]{markup(place_label(place))}[/]" + lines.append(f"{status_markup(place.result.status)} {label}: {markup(place.result.message)}{tools}") + lines += [f" [dim]{markup(detail)}[/]" for detail in dedupe(place.result.details)] + return "\n".join(lines) + + +def next_steps(analysis: Analysis) -> str: + if analysis.score is None or not analysis.score.next_steps: + return "Every quality gate that applies is in place." + lines = ["[bold]Next steps[/] [dim](the points each is worth)[/]", ""] + for step in analysis.score.next_steps: + lines.append(f"[bold green]+{step.points:5.1f}[/] {markup(step.describe())}") + return "\n".join(lines) + + +def facts_page(analysis: Analysis, kind: str | None, search: str = "") -> str: + found = [fact for fact in analysis.facts.all if kind is None or type(fact).__name__ == kind] + needle = search.lower() + lines = [] + shown = 0 + for fact in found: + data = as_dict(fact) + text = str(data) + if needle and needle not in text.lower(): + continue + shown += 1 + if shown > FACTS_SHOWN: + continue + name, origin = data.pop("kind"), data.pop("origin", "") + fields = ", ".join(f"{key}={value!r}" for key, value in data.items() if value not in (None, "", [], (), False)) + lines.append(f"[bold]{markup(name)}[/] [cyan]{markup(origin)}[/]\n [dim]{markup(fields)}[/]") + head = f"[bold]{markup(kind or 'All facts')}[/]: {shown:,} of {len(found):,}" + ( + f" matching [italic]{markup(search)}[/]" if search else "" + ) + more = [f"[dim]… and {shown - FACTS_SHOWN:,} more; search to narrow them[/]"] if shown > FACTS_SHOWN else [] + return "\n".join([head, "", *lines, *more]) + + +def build_app(context: Context, checks: Sequence[Check], every_check: Sequence[str]) -> App[int]: + """The TUI's app: it analyses the project in a worker, then shows the analysis. Its return code is the CLI's.""" + from project_validator.views.tui_app import Validator + + return Validator(context, checks, every_check) + + +def run(context: Context, checks: Sequence[Check], every_check: Sequence[str]) -> int: + """Run the TUI; its exit code is 0, or 2 when textual is missing.""" + if not available(): + import sys + + print("project_validator: error: --tui needs textual: pip install project_validator[tui]", file=sys.stderr) + return 2 + return build_app(context, checks, every_check).run() or 0 + + +__all__ = [ + "available", + "build_app", + "detected", + "facts_page", + "markup", + "next_steps", + "overview", + "report_page", + "run", + "status_markup", +] diff --git a/project_validator/views/tui_app.py b/project_validator/views/tui_app.py new file mode 100644 index 00000000..ba744305 --- /dev/null +++ b/project_validator/views/tui_app.py @@ -0,0 +1,147 @@ +"""The TUI's app (see `project_validator.views.tui`), which needs textual: imported only when it is installed.""" + +from __future__ import annotations + +from collections.abc import Sequence +from typing import Any, ClassVar + +from textual.app import App, ComposeResult +from textual.binding import Binding, BindingType +from textual.containers import Horizontal, VerticalScroll +from textual.widgets import Footer, Header, Input, RichLog, Static, Tree + +from project_validator.analysis import Analysis, analyse +from project_validator.core import Check, Context, Progress, Status +from project_validator.views.common import fact_kinds, grouped, is_skipped +from project_validator.views.progress import STAGE_NAMES +from project_validator.views.tui import ( + detected, + facts_page, + markup, + next_steps, + overview, + report_page, + status_markup, +) + + +class Validator(App[int]): + """Analyses the project in a worker, telling each stage as it finishes, then shows the analysis.""" + + CSS = """ + #loading { height: 1fr; border: round $accent; padding: 1 2; } + #main { height: 1fr; } + #nav { width: 38; border-right: solid $panel; } + #pane { padding: 1 2; } + #search { display: none; } + #search.shown { display: block; } + """ + BINDINGS: ClassVar[list[BindingType]] = [ + Binding("q", "quit", "Quit"), + Binding("slash", "search", "Search the facts"), + Binding("escape", "close_search", "Close the search", show=False), + ] + TITLE = "project_validator" + + def __init__(self, context: Context, checks: Sequence[Check], every_check: Sequence[str]) -> None: + super().__init__() + self.context, self.checks, self.every_check = context, checks, every_check + self.analysis: Analysis | None = None + self.kind: str | None = None + + def compose(self) -> ComposeResult: + yield Header() + yield RichLog(id="loading", markup=True, wrap=True) + with Horizontal(id="main"): + yield Tree("project", id="nav") + with VerticalScroll(): + yield Input(placeholder="Search the facts…", id="search") + yield Static("", id="pane") + yield Footer() + + def on_mount(self) -> None: + self.query_one("#main").display = False + log = self.query_one("#loading", RichLog) + log.write(f"[bold]Reading[/] {markup(self.context.project.root)}") + self.run_worker(self._analyse, thread=True) + + def _analyse(self) -> None: + def progress(event: Progress) -> None: + self.call_from_thread(self._progress, event) + + found = analyse(self.context, self.checks, every_check=self.every_check, progress=progress) + self.call_from_thread(self._show, found) + + def _progress(self, event: Progress) -> None: + log = self.query_one("#loading", RichLog) + if event.kind == "stage" and event.done: + name = STAGE_NAMES.get(event.name, event.name) + log.write(f"[green]✔[/] {markup(name)} [dim]{event.found:,} facts, {event.seconds:.2f} s[/]") + elif event.kind == "check" and event.done and event.index == event.total: + log.write(f"[green]✔[/] Ran {event.total} checks") + + def _show(self, analysis: Analysis) -> None: + self.analysis = analysis + self.sub_title = analysis.score.summary() if analysis.score else analysis.name + self.query_one("#loading").display = False + self.query_one("#main").display = True + tree = self.query_one("#nav", Tree) + tree.root.set_label(analysis.name) + tree.root.data = ("overview", None) + tree.root.add_leaf("Overview", data=("overview", None)) + tree.root.add_leaf("What was detected", data=("detected", None)) + results = tree.root.add("Results", data=("overview", None), expand=True) + for group in grouped(analysis.reports): + branch = results.add(f"{group.category} [dim]{len(group.reports)}[/]", data=("overview", None)) + for report in group.reports: + branch.add_leaf( + f"{status_markup(report.result.status)} {markup(report.check.name)}", data=("report", report) + ) + skipped = [report for report in analysis.reports if is_skipped(report)] + if skipped: + branch = results.add(f"Not applicable [dim]{len(skipped)}[/]", data=("overview", None)) + for report in skipped: + branch.add_leaf(f"{status_markup(Status.SKIP)} {markup(report.check.name)}", data=("report", report)) + tree.root.add_leaf("Next steps", data=("next", None)) + facts = tree.root.add(f"Facts [dim]{len(analysis.facts.all):,}[/]", data=("facts", None)) + for kind, count in fact_kinds(analysis): + facts.add_leaf(f"{markup(kind)} [dim]{count:,}[/]", data=("facts", kind)) + tree.root.expand() + tree.focus() + self._page("overview", None) + + def _page(self, page: str, value: Any) -> None: + if self.analysis is None: + return + pane = self.query_one("#pane", Static) + search = self.query_one("#search", Input) + if page == "facts": + self.kind = value + pane.update(facts_page(self.analysis, value, search.value)) + return + text = { + "overview": overview, + "detected": detected, + "next": next_steps, + }.get(page) + pane.update(text(self.analysis) if text is not None else report_page(value)) + + def on_tree_node_selected(self, event: Tree.NodeSelected[Any]) -> None: + if event.node.data is not None: + self._page(*event.node.data) + + def on_input_changed(self, event: Input.Changed) -> None: + if self.analysis is not None: + self.query_one("#pane", Static).update(facts_page(self.analysis, self.kind, event.value)) + + def action_search(self) -> None: + search = self.query_one("#search", Input) + search.add_class("shown") + search.focus() + if self.analysis is not None: + self.query_one("#pane", Static).update(facts_page(self.analysis, self.kind, search.value)) + + def action_close_search(self) -> None: + search = self.query_one("#search", Input) + search.remove_class("shown") + self.query_one("#nav", Tree).focus() diff --git a/pyproject.toml b/pyproject.toml index 3d3a921c..a9079874 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,12 @@ requires-python = ">=3.12" dependencies = ["PyYAML>=6.0"] [project.optional-dependencies] +# The console report: colour, tables and progress while the project is read. pretty = ["rich>=13.0"] +# The TUI (--tui): browse the results and the facts in the terminal. +tui = ["rich>=13.0", "textual>=1.0"] +# Every optional view. +all = ["rich>=13.0", "textual>=1.0"] coverage = ["coverage>=7.10"] [project.scripts] @@ -20,6 +25,10 @@ project-validator = "project_validator.cli:main" [tool.setuptools.packages.find] include = ["project_validator*"] +[tool.setuptools.package-data] +# The HTML report's stylesheet and scripts. +"project_validator.views" = ["assets/*"] + [tool.ruff] line-length = 120 target-version = "py312" @@ -56,6 +65,15 @@ relative_files = true fail_under = 99 show_missing = true +[tool.pytest.ini_options] +# CI runs the unittest suite under pytest-xdist (`pytest -n auto`); `python -m unittest` runs the same tests. +# Collect only the unittest classes (pytest always collects those): not the helper functions named test/tested +# the test modules import, nor product classes named Test* (TestFiles), and not the fixture projects' own tests. +testpaths = ["tests"] +python_classes = ["__never__"] +python_functions = ["__never__"] +norecursedirs = [".*", "*.egg", "build", "dist", "venv", "fixtures"] + [tool.mutmut] source_paths = ["project_validator/"] pytest_add_cli_args_test_selection = ["tests/"] diff --git a/tests/build_site.py b/tests/build_site.py index 8db31c15..d03bd6a4 100644 --- a/tests/build_site.py +++ b/tests/build_site.py @@ -28,6 +28,7 @@ from leaderboard.site import build as build_leaderboard from project_validator.plugins import discover from project_validator.support_matrix import render, support_matrix +from project_validator.views.theme import STYLESHEET, THEME_SCRIPT, asset ROOT = Path(__file__).resolve().parent.parent EXTENSIONS = ("tables", "fenced_code", "toc") # toc gives headings the ids GitHub gives them, for `#anchor` links @@ -41,19 +42,8 @@ ) _LINK = re.compile(r"\]\((?P[^)\s]+)(?P\s+\"[^\"]*\")?\)") _HEADING = re.compile(r"^# (?P<title>.+)$", re.MULTILINE) -STYLE = """\ -body { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem 3rem; font: 16px/1.5 system-ui, sans-serif; color: #222; } -header { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; padding: 1rem 0; } -header { border-bottom: 1px solid #ddd; } -header nav a { margin-right: 1rem; } -header .built { margin-left: auto; font-size: 0.875rem; color: #555; } -table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.9375rem; } -th, td { border: 1px solid #ccc; padding: 0.25rem 0.5rem; text-align: left; vertical-align: top; } -th { background: #f3f3f3; } -pre { background: #f6f8fa; padding: 0.75rem 1rem; overflow-x: auto; } -code { font-size: 0.9375em; } -a { color: #0550ae; } -""" +# The design the HTML report has, with the site's own additions. +STYLE = STYLESHEET + "\n" + asset("site.css") TEMPLATE = """\ <!DOCTYPE html> <html lang="en"> @@ -62,18 +52,23 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <title>{title} - project_validator + -
    - -Built from {ref} at {short} on {date} -
    -
    +
    +project_validator + + +
    +
    {body} -
    +
    +
    Built from {ref} at {short} on {date}.
    """ +# The pages laid out at the full width: the tables are wide. +WIDE = ("docs/support-matrix.html", "leaderboard/") @dataclass(frozen=True, slots=True, kw_only=True) @@ -154,21 +149,45 @@ def render_page(source: str, page: str, site: Site, date: str) -> str: directory = posixpath.dirname(page) to_root = "../" * directory.count("/") + ("../" if directory else "") navigation = "".join( - f'{label}' if target != page else f"{label}" - for target, label in NAVIGATION + f'{label}' for target, label in NAVIGATION ) + body = markdown.markdown(source, extensions=list(EXTENSIONS)) + support = page == "docs/support-matrix.html" return TEMPLATE.format( title=html.escape(title_of(source)), to_root=to_root, + theme=THEME_SCRIPT, navigation=navigation, + wide=" wide" if page.startswith(WIDE) else "", + kind=" support" if support else "", ref=html.escape(site.ref), commit_url=site.commit_url, short=site.revision[:7], date=date, - body=markdown.markdown(source, extensions=list(EXTENSIONS)), + body=_mark_support_cells(body) if support else body, ) +def _active(target: str, page: str) -> str: + """The navigation link of `page`, or of the section it is in (`leaderboard/` for a project's page), marked.""" + section = target.removesuffix("index.html") if "/" in target and target.endswith("/index.html") else target + return ' class="active"' if target == page or page.startswith(section) else "" + + +_CELL = re.compile(r"(?P[^<]*)") + + +def _mark_support_cells(body: str) -> str: + """The support matrix's cells, marked as applying (tools, a tick or an arrow) or not (a dash).""" + + def mark(found: re.Match[str]) -> str: + text = found.group("text").strip() + kind = "none" if text in ("—", "") else "applies" + return f'{found.group("text")}' + + return _CELL.sub(mark, body) + + def build(root: Path, output: Path, site: Site, leaderboard: Path | None = None) -> list[str]: """Write the site to `output`, the leaderboard from the results in `leaderboard`; the paths written, `style.css` included.""" diff --git a/tests/checks/test_action_pinning.py b/tests/checks/test_action_pinning.py index da552c79..0c05cc40 100644 --- a/tests/checks/test_action_pinning.py +++ b/tests/checks/test_action_pinning.py @@ -61,7 +61,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(action_pinning.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = action_pinning.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = action_pinning.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("all 7 actions are pinned to a commit")) def test_is_skipped_without_a_ci_provider_that_has_reusable_steps(self) -> None: diff --git a/tests/checks/test_ci_lint.py b/tests/checks/test_ci_lint.py index a8943b8a..1732dbf3 100644 --- a/tests/checks/test_ci_lint.py +++ b/tests/checks/test_ci_lint.py @@ -20,7 +20,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(ci_lint.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = ci_lint.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = ci_lint.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("CI lints its configuration (GitHub Actions: actionlint, zizmor)")) def test_is_skipped_without_ci(self) -> None: diff --git a/tests/checks/test_code_formatting.py b/tests/checks/test_code_formatting.py index ae9bbc5d..874cfb5d 100644 --- a/tests/checks/test_code_formatting.py +++ b/tests/checks/test_code_formatting.py @@ -8,7 +8,7 @@ from project_validator.checks.code_formatting import code_formatting from project_validator.core import Options, Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from project_validator.facts import Facts @@ -308,11 +308,11 @@ def test_a_style_file_applies_to_the_units_below_it(self) -> None: class MixedLanguageCodeFormattingTests(unittest.TestCase): def test_every_language_needs_a_formatter_and_findings_are_labelled(self) -> None: - result = run_as(self, code_formatting, dict(WELL_CONFIGURED), C_AND_CXX, PYTHON) + result = run_as(self, code_formatting, dict(WELL_CONFIGURED), CXX, PYTHON) self.assertEqual( result, Result.failed( - "C/C++: .clang-format is defined and CI runs clang-format; " + "C++: .clang-format is defined and CI runs clang-format; " "Python: CI never runs ruff format or black; its formatting is not enforced", "Python: consider a CI job that runs ruff format --check (or black --check)", ), @@ -320,7 +320,7 @@ def test_every_language_needs_a_formatter_and_findings_are_labelled(self) -> Non def test_passes_when_every_language_is_formatted(self) -> None: workflow = WELL_CONFIGURED[GITHUB_WORKFLOW] + " - run: ruff format --check\n" - result = run_as(self, code_formatting, {**WELL_CONFIGURED, GITHUB_WORKFLOW: workflow}, C_AND_CXX, PYTHON) + result = run_as(self, code_formatting, {**WELL_CONFIGURED, GITHUB_WORKFLOW: workflow}, CXX, PYTHON) self.assertEqual(result.status, Status.PASS) @@ -343,7 +343,7 @@ def test_a_language_only_auxiliary_code_uses_is_judged_as_advisory(self) -> None result = code_formatting.run(context) self.assertEqual(result.status, Status.WARN) self.assertIn( - "C/C++: .clang-format is defined and CI runs clang-format; Python (auxiliary: docs): CI never runs ", + "C++: .clang-format is defined and CI runs clang-format; Python (auxiliary: docs): CI never runs ", result.message, ) self.assertIn( diff --git a/tests/checks/test_committed_artifacts.py b/tests/checks/test_committed_artifacts.py index d2879db0..85efd4f4 100644 --- a/tests/checks/test_committed_artifacts.py +++ b/tests/checks/test_committed_artifacts.py @@ -5,10 +5,10 @@ from collections.abc import Mapping from pathlib import PurePosixPath +from project_validator.c_family.build import BUILD_DIRECTORY from project_validator.checks.committed_artifacts import committed_artifacts from project_validator.core import Context, Options, Project, Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import BUILD_DIRECTORY from project_validator.ecosystems.go import BUILD_OUTPUTS from project_validator.ecosystems.python import BYTECODE from project_validator.ecosystems.rust import TARGET_DIRECTORY @@ -57,7 +57,7 @@ def test_declares_the_languages_it_judges(self) -> None: def test_passes_with_the_well_configured_fixtures(self) -> None: for fixture in ( - "well_configured_c_cpp", + "well_configured_cpp", "well_configured_python", "well_configured_rust", "well_configured_go", @@ -66,7 +66,7 @@ def test_passes_with_the_well_configured_fixtures(self) -> None: self.assertEqual(committed_artifacts.run(make_context(FIXTURES / fixture)), PASSED) def test_fails_with_the_bare_fixtures(self) -> None: - for fixture in ("bare_c_cpp", "bare_python", "bare_rust", "bare_go"): + for fixture in ("bare_cpp", "bare_python", "bare_rust", "bare_go"): with self.subTest(fixture=fixture): self.assertEqual(committed_artifacts.run(make_context(FIXTURES / fixture)).status, Status.FAIL) diff --git a/tests/checks/test_cxx_extensions.py b/tests/checks/test_compiler_extensions.py similarity index 86% rename from tests/checks/test_cxx_extensions.py rename to tests/checks/test_compiler_extensions.py index 2ab0cea0..9197c4b6 100644 --- a/tests/checks/test_cxx_extensions.py +++ b/tests/checks/test_compiler_extensions.py @@ -2,7 +2,7 @@ import unittest -from project_validator.checks.cxx_extensions import cxx_extensions +from project_validator.checks.compiler_extensions import compiler_extensions from project_validator.core import Result, Status from project_validator.ecosystems import C_FAMILY from tests.support import ( @@ -27,21 +27,21 @@ def _cxx(files: dict[str, str], test: unittest.TestCase) -> Result: """The result in a CMake C++ project.""" - return run_in_layout(test, "CMake C++", cxx_extensions, files) + return run_in_layout(test, "CMake C++", compiler_extensions, files) class CxxExtensionsTests(unittest.TestCase): # C, C++ and Fortran have compiler extensions (Fortran's dialects). def test_declares_the_languages_it_judges(self) -> None: - self.assertEqual(cxx_extensions.languages, C_FAMILY | {"Fortran"}) + self.assertEqual(compiler_extensions.languages, C_FAMILY | {"Fortran"}) def test_fails_when_extensions_are_never_disabled(self) -> None: self.assertEqual(_cxx(BARE_PROJECT, self), CXX_FAILED) def test_passes_when_disabled_globally(self) -> None: - for layout in c_family_layouts_built_with(cxx_extensions, "CMake"): + for layout in c_family_layouts_built_with(compiler_extensions, "CMake"): with layout_project(self, layout, WELL_CONFIGURED) as root: - self.assertEqual(cxx_extensions.run(make_context(root)).status, Status.PASS) + self.assertEqual(compiler_extensions.run(make_context(root)).status, Status.PASS) expected = Result.passed("C++ compiler extensions are disabled with set(CMAKE_CXX_EXTENSIONS OFF)") self.assertEqual(_cxx(WELL_CONFIGURED, self), expected) @@ -83,9 +83,13 @@ def test_disabling_only_c_extensions_does_not_cover_cxx(self) -> None: self.assertEqual(_cxx({"CMakeLists.txt": build}, self), CXX_FAILED) def test_c_is_judged_by_its_own_setting(self) -> None: - passed = run_in_layout(self, "CMake C", cxx_extensions, {"CMakeLists.txt": "set(CMAKE_C_EXTENSIONS OFF)\n"}) + passed = run_in_layout( + self, "CMake C", compiler_extensions, {"CMakeLists.txt": "set(CMAKE_C_EXTENSIONS OFF)\n"} + ) self.assertEqual(passed, Result.passed("C compiler extensions are disabled with set(CMAKE_C_EXTENSIONS OFF)")) - self.assertEqual(run_in_layout(self, "CMake C", cxx_extensions, {"CMakeLists.txt": "project(p C)\n"}), C_FAILED) + self.assertEqual( + run_in_layout(self, "CMake C", compiler_extensions, {"CMakeLists.txt": "project(p C)\n"}), C_FAILED + ) CXX_PREFERENCE = "consider set(CMAKE_CXX_EXTENSIONS OFF) so that every target has extensions disabled" @@ -94,12 +98,12 @@ def test_c_is_judged_by_its_own_setting(self) -> None: class MesonCxxExtensionsTests(unittest.TestCase): def _run(self, meson: str, files: dict[str, str] | None = None, source: str = "src/main.cpp") -> Result: with temp_project({"meson.build": meson, source: "", **(files or {})}) as root: - return cxx_extensions.run(make_context(root)) + return compiler_extensions.run(make_context(root)) def test_fails_when_the_standard_is_never_set(self) -> None: - for layout in c_family_layouts_built_with(cxx_extensions, "Meson"): + for layout in c_family_layouts_built_with(compiler_extensions, "Meson"): with layout_project(self, layout) as root: - result = cxx_extensions.run(make_context(root)) + result = compiler_extensions.run(make_context(root)) self.assertEqual(result.status, Status.FAIL) self.assertIn("never disabled", result.message) diff --git a/tests/checks/test_compiler_warnings.py b/tests/checks/test_compiler_warnings.py index 4e50314a..8418a8f7 100644 --- a/tests/checks/test_compiler_warnings.py +++ b/tests/checks/test_compiler_warnings.py @@ -6,7 +6,7 @@ from project_validator.checks.compiler_warnings import compiler_warnings from project_validator.core import Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from tests.support import ( @@ -180,7 +180,7 @@ def test_meson_passes_wall_unless_told_otherwise(self) -> None: def test_meson_warning_levels_pass_their_flags(self) -> None: build = ( "project('app', 'cpp', default_options: ['warning_level=3'])\n" - "add_project_arguments('-Wshadow', '-Wconversion', language: 'cpp')\n" + "add_project_arguments('-Wshadow', '-Wconversion', language: ['c', 'cpp'])\n" ) layouts = c_family_layouts_built_with(compiler_warnings, "Meson") result = run_in_every_layout(self, compiler_warnings, {"meson.build": build}, layouts) @@ -258,7 +258,7 @@ def test_fails_without_lint_settings(self) -> None: class MixedLanguageCompilerWarningsTests(unittest.TestCase): def test_every_language_needs_strict_warnings_and_findings_are_labelled(self) -> None: - result = run_as(self, compiler_warnings, dict(WELL_CONFIGURED), C_AND_CXX, PYTHON) + result = run_as(self, compiler_warnings, dict(WELL_CONFIGURED), CXX, PYTHON) self.assertEqual(result.status, Status.FAIL) - self.assertTrue(result.message.startswith("C/C++: strict compiler warning flags are enabled: -Wall")) + self.assertTrue(result.message.startswith("C++: strict compiler warning flags are enabled: -Wall")) self.assertTrue(result.message.endswith("; Python: no Python warning settings found; enable at least -W error")) diff --git a/tests/checks/test_copy_paste_detection.py b/tests/checks/test_copy_paste_detection.py index 07b84614..3c46e37c 100644 --- a/tests/checks/test_copy_paste_detection.py +++ b/tests/checks/test_copy_paste_detection.py @@ -16,7 +16,7 @@ def _run(self, files: dict[str, str]) -> Result: return copy_paste_detection.run(make_context(root)) def test_warns_without_ci(self) -> None: - result = copy_paste_detection.run(make_context(FIXTURES / "bare_c_cpp")) + result = copy_paste_detection.run(make_context(FIXTURES / "bare_cpp")) self.assertEqual(result.status, Status.WARN) def test_warns_when_ci_runs_no_copy_paste_detection(self) -> None: @@ -25,7 +25,7 @@ def test_warns_when_ci_runs_no_copy_paste_detection(self) -> None: self.assertIn("no copy-paste detection", result.message) def test_passes_with_pmd_cpd(self) -> None: - result = copy_paste_detection.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = copy_paste_detection.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result.status, Status.PASS) self.assertEqual(result.message, "CI runs copy-paste detection with PMD CPD") diff --git a/tests/checks/test_coverage.py b/tests/checks/test_coverage.py index 42216d0a..e48598a4 100644 --- a/tests/checks/test_coverage.py +++ b/tests/checks/test_coverage.py @@ -5,7 +5,7 @@ from project_validator.checks.coverage import coverage from project_validator.core import Options, Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from tests.support import ( @@ -342,15 +342,15 @@ def test_line_coverage_fails(self) -> None: class MixedLanguageCoverageTests(unittest.TestCase): def test_every_language_needs_branch_coverage_and_findings_are_labelled(self) -> None: - result = run_as(self, coverage, dict(WELL_CONFIGURED), C_AND_CXX, PYTHON) + result = run_as(self, coverage, dict(WELL_CONFIGURED), CXX, PYTHON) self.assertEqual(result.status, Status.FAIL) self.assertEqual( result.message, - "C/C++: branch coverage is gated with gcovr; path coverage bonus: measured with gcc -fcondition-coverage " + "C++: branch coverage is gated with gcovr; path coverage bonus: measured with gcc -fcondition-coverage " "(not reported); Python: no branch coverage measurement found in what CI runs", ) def test_passes_when_every_language_reports_branch_coverage(self) -> None: python = {".github/workflows/python.yml": github_job("x", "coverage run --branch -m x")[GITHUB_WORKFLOW]} files = {**WELL_CONFIGURED, **python} - self.assertEqual(run_as(self, coverage, files, C_AND_CXX, PYTHON).status, Status.PASS) + self.assertEqual(run_as(self, coverage, files, CXX, PYTHON).status, Status.PASS) diff --git a/tests/checks/test_data_wellformed.py b/tests/checks/test_data_wellformed.py index 6c09727c..211161ec 100644 --- a/tests/checks/test_data_wellformed.py +++ b/tests/checks/test_data_wellformed.py @@ -38,7 +38,7 @@ def test_applies_to_the_formats_with_a_parser(self) -> None: self.assertEqual(data_wellformed.languages, frozenset({"Dockerfile", "JSON", "Jupyter", "TOML", "XML", "YAML"})) def test_passes_with_the_well_configured_fixture(self) -> None: - result = data_wellformed.run(make_context(FIXTURES / "well_configured_c_cpp", Options())) + result = data_wellformed.run(make_context(FIXTURES / "well_configured_cpp", Options())) self.assertEqual(result.status, Status.PASS) self.assertRegex(result.message, r"\d+ YAML files parse") diff --git a/tests/checks/test_dependency_management.py b/tests/checks/test_dependency_management.py index d7372080..7964c721 100644 --- a/tests/checks/test_dependency_management.py +++ b/tests/checks/test_dependency_management.py @@ -54,7 +54,7 @@ def test_applies_to_the_languages_of_its_package_managers(self) -> None: def test_the_fixtures(self) -> None: cases = { - "well_configured_c_cpp": _declared("cmake/Dependencies.cmake", "FetchContent"), + "well_configured_cpp": _declared("cmake/Dependencies.cmake", "FetchContent"), "well_configured_python": _declared("pyproject.toml", "Python packages", "uv.lock"), "well_configured_rust": _declared("fuzz/Cargo.toml", "Cargo", "fuzz/Cargo.lock"), "well_configured_go": NO_DEPENDENCIES, @@ -62,7 +62,7 @@ def test_the_fixtures(self) -> None: for fixture, expected in cases.items(): with self.subTest(fixture): self.assertEqual(dependency_management.run(make_context(FIXTURES / fixture)), expected) - for fixture in ("bare_c_cpp", "bare_python", "bare_rust", "bare_go"): + for fixture in ("bare_cpp", "bare_python", "bare_rust", "bare_go"): with self.subTest(fixture): self.assertEqual(dependency_management.run(make_context(FIXTURES / fixture)).status, Status.WARN) diff --git a/tests/checks/test_function_limits.py b/tests/checks/test_function_limits.py index e69a1338..a84f3d50 100644 --- a/tests/checks/test_function_limits.py +++ b/tests/checks/test_function_limits.py @@ -5,7 +5,7 @@ from project_validator.checks.function_limits import function_limits from project_validator.core import Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from project_validator.facts import Facts @@ -186,15 +186,15 @@ def test_well_configured_projects_pass(self) -> None: class MixedLanguageFunctionLimitsTests(unittest.TestCase): def test_every_language_needs_a_limit_and_findings_are_labelled(self) -> None: - result = run_as(self, function_limits, dict(WELL_CONFIGURED), C_AND_CXX, PYTHON) + result = run_as(self, function_limits, dict(WELL_CONFIGURED), CXX, PYTHON) self.assertEqual(result.status, Status.FAIL) self.assertEqual( result.message, - "C/C++: function length is limited with clang-tidy's readability-function-size (.clang-tidy); " + "C++: function length is limited with clang-tidy's readability-function-size (.clang-tidy); " "Python: function length is never limited", ) def test_one_lizard_length_limit_covers_every_language(self) -> None: - result = run_as(self, function_limits, github_job("x", "lizard -L 30"), C_AND_CXX, PYTHON) + result = run_as(self, function_limits, github_job("x", "lizard -L 30"), CXX, PYTHON) # The same result for every ecosystem is said once. self.assertEqual(result, LIMITED_BY_LIZARD) diff --git a/tests/checks/test_fuzz_testing.py b/tests/checks/test_fuzz_testing.py index faf15802..c33c91f2 100644 --- a/tests/checks/test_fuzz_testing.py +++ b/tests/checks/test_fuzz_testing.py @@ -4,10 +4,10 @@ from project_validator.checks.fuzz_testing import fuzz_testing from project_validator.core import Options, Result, Status -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.dotnet import DOTNET from project_validator.ecosystems.go import GO -from project_validator.ecosystems.javascript import JAVASCRIPT_AND_TYPESCRIPT +from project_validator.ecosystems.javascript import JAVASCRIPT_ECOSYSTEM from project_validator.ecosystems.jvm import JVM from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST @@ -46,8 +46,8 @@ def test_the_well_configured_python_project_passes(self) -> None: result = run_as(self, fuzz_testing, WELL_CONFIGURED_PYTHON, PYTHON) self.assertEqual(result, Result.passed("fuzz targets in 1 file(s), run by atheris")) - def test_the_well_configured_c_cpp_project_passes_through_ctest(self) -> None: - result = run_as(self, fuzz_testing, fixture_files("well_configured_c_cpp"), C_AND_CXX) + def test_the_well_configured_cxx_project_passes_through_ctest(self) -> None: + result = run_as(self, fuzz_testing, fixture_files("well_configured_cpp"), CXX) self.assertEqual( result, Result.passed("fuzz targets in 1 file(s), run by CTest (fuzz_test/CMakeLists.txt): fuzz_tester_run"), @@ -66,7 +66,7 @@ def test_the_well_configured_jvm_project_passes(self) -> None: self.assertEqual(result, Result.passed("fuzz targets in 1 file(s), run by Jazzer")) def test_the_well_configured_javascript_project_passes(self) -> None: - result = run_as(self, fuzz_testing, fixture_files("well_configured_javascript"), JAVASCRIPT_AND_TYPESCRIPT) + result = run_as(self, fuzz_testing, fixture_files("well_configured_javascript"), JAVASCRIPT_ECOSYSTEM) self.assertEqual(result, Result.passed("fuzz targets in 1 file(s), run by Jazzer.js")) def test_the_well_configured_dotnet_project_passes(self) -> None: @@ -79,11 +79,11 @@ def test_the_well_configured_swift_project_passes(self) -> None: def test_the_bare_projects_fail(self) -> None: bare = ( - ("bare_c_cpp", C_AND_CXX), + ("bare_cpp", CXX), ("bare_rust", RUST), ("bare_go", GO), ("bare_jvm", JVM), - ("bare_javascript", JAVASCRIPT_AND_TYPESCRIPT), + ("bare_javascript", JAVASCRIPT_ECOSYSTEM), ("bare_dotnet", DOTNET), ("bare_swift", SWIFT), ) diff --git a/tests/checks/test_hardening.py b/tests/checks/test_hardening.py index 4e8838df..493cc771 100644 --- a/tests/checks/test_hardening.py +++ b/tests/checks/test_hardening.py @@ -6,6 +6,8 @@ from project_validator.checks.hardening import hardening from project_validator.core import Result, Status from project_validator.ecosystems import C_FAMILY +from project_validator.ecosystems.c import C +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.rust import RUST from tests.support import ( BARE_PROJECT, @@ -17,6 +19,7 @@ WELL_CONFIGURED_RUST, ci_running, github_job, + layouts_checked_as, run_as, run_in_every_layout, ) @@ -57,8 +60,23 @@ def test_does_not_judge_ecosystems_that_build_no_binary(self) -> None: class CAndCxxHardeningTests(unittest.TestCase): + """C++'s hardening, in every C++ layout (C is asked for the same but the C++ standard library's assertions).""" + def _run(self, files: dict[str, str]) -> Result: - return run_in_every_layout(self, hardening, files) + return run_in_every_layout(self, hardening, files, layouts_checked_as(hardening, CXX)) + + def test_c_is_not_asked_for_the_cxx_standard_library_s_assertions(self) -> None: + c_options = "_FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection" + result = run_in_every_layout(self, hardening, BARE_PROJECT, layouts_checked_as(hardening, C)) + self.assertEqual(result.message, f"no hardening options found; enable {c_options}") + flags = "-D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection -fstack-clash-protection" + passed = run_in_every_layout( + self, + hardening, + LINUX | github_job("ubuntu-latest", f"gcc {flags} main.c"), + layouts_checked_as(hardening, C), + ) + self.assertEqual(passed.status, Status.PASS, passed.message) def test_fails_when_no_hardening_options_are_found(self) -> None: self.assertEqual( @@ -260,7 +278,7 @@ def test_c_and_cxx_options_do_not_count(self) -> None: class MixedLanguageHardeningTests(unittest.TestCase): def test_only_the_languages_that_build_binaries_are_judged(self) -> None: - [layout] = [layout for layout in PROJECT_LAYOUTS if layout.languages == C_FAMILY | {"Python"}] + [layout] = [layout for layout in PROJECT_LAYOUTS if layout.languages == {"C++", "Python"}] result = run_in_every_layout(self, hardening, dict(WELL_CONFIGURED), (layout,)) self.assertEqual(result.status, Status.PASS) self.assertTrue(result.message.startswith("hardening options are enabled: _FORTIFY_SOURCE")) diff --git a/tests/checks/test_large_files.py b/tests/checks/test_large_files.py index b75f3971..6f57b151 100644 --- a/tests/checks/test_large_files.py +++ b/tests/checks/test_large_files.py @@ -35,7 +35,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(large_files.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = large_files.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = large_files.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("no committed file is larger than 5 MiB")) self.assertEqual(DEFAULT_MAX_FILE_SIZE, 5 * 1024 * 1024) diff --git a/tests/checks/test_license.py b/tests/checks/test_license.py index db08c1b8..1851d8f6 100644 --- a/tests/checks/test_license.py +++ b/tests/checks/test_license.py @@ -10,7 +10,7 @@ from project_validator.questions.license import licenses as license_answers from tests.support import FIXTURES, fixture_files, make_context, temp_project -MIT = (FIXTURES / "well_configured_c_cpp" / "LICENSE").read_text(encoding="utf-8") +MIT = (FIXTURES / "well_configured_cpp" / "LICENSE").read_text(encoding="utf-8") APACHE = " Apache License\n Version 2.0, January 2004\n" # SPDX identifier -> the opening of the license's text, as it appears in a license file. diff --git a/tests/checks/test_mutation_testing.py b/tests/checks/test_mutation_testing.py index 2f736c89..33cbb65d 100644 --- a/tests/checks/test_mutation_testing.py +++ b/tests/checks/test_mutation_testing.py @@ -4,10 +4,10 @@ from project_validator.checks.mutation_testing import mutation_testing from project_validator.core import Options, Result, Status -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.dotnet import DOTNET from project_validator.ecosystems.go import GO -from project_validator.ecosystems.javascript import JAVASCRIPT_AND_TYPESCRIPT +from project_validator.ecosystems.javascript import JAVASCRIPT_ECOSYSTEM from project_validator.ecosystems.jvm import JVM from project_validator.ecosystems.php import PHP from project_validator.ecosystems.python import PYTHON @@ -55,7 +55,7 @@ def test_the_well_configured_python_project_passes(self) -> None: def test_the_well_configured_compiled_and_scripted_projects_pass(self) -> None: cases = ( - (C_AND_CXX, WELL_CONFIGURED, "Mull runs"), + (CXX, WELL_CONFIGURED, "Mull runs"), ( RUST, WELL_CONFIGURED_RUST, @@ -63,7 +63,7 @@ def test_the_well_configured_compiled_and_scripted_projects_pass(self) -> None: ), (GO, WELL_CONFIGURED_GO, "gremlins runs; on the pull request's changes only (bonus)"), ( - JAVASCRIPT_AND_TYPESCRIPT, + JAVASCRIPT_ECOSYSTEM, WELL_CONFIGURED_JAVASCRIPT, "StrykerJS (stryker.config.json) runs; on the pull request's changes only (bonus)", ), @@ -104,10 +104,10 @@ def test_a_tool_that_no_step_runs_warns_in_every_profile(self) -> None: workflow = ".github/workflows/ci.yml" cases = ( (PYTHON, WELL_CONFIGURED_PYTHON, "mutmut run", "mutmut"), - (C_AND_CXX, WELL_CONFIGURED, "mull-runner", None), + (CXX, WELL_CONFIGURED, "mull-runner", None), (RUST, WELL_CONFIGURED_RUST, "cargo mutants", "cargo-mutants"), (GO, WELL_CONFIGURED_GO, "gremlins", None), - (JAVASCRIPT_AND_TYPESCRIPT, WELL_CONFIGURED_JAVASCRIPT, "stryker run", "StrykerJS"), + (JAVASCRIPT_ECOSYSTEM, WELL_CONFIGURED_JAVASCRIPT, "stryker run", "StrykerJS"), (DOTNET, WELL_CONFIGURED_DOTNET, "dotnet stryker", "Stryker.NET"), (PHP, WELL_CONFIGURED_PHP, "infection", "Infection"), (RUBY, WELL_CONFIGURED_RUBY, "mutant run", "mutant"), diff --git a/tests/checks/test_platform_matrix.py b/tests/checks/test_platform_matrix.py index e5685a0c..df7ead21 100644 --- a/tests/checks/test_platform_matrix.py +++ b/tests/checks/test_platform_matrix.py @@ -118,7 +118,7 @@ def test_fails_with_the_runner_default_toolchain_only(self) -> None: class JobAttributionTests(unittest.TestCase): - """A job naming no compiler counts as a C/C++ build on its runner's default compiler, unless it only runs + """A job naming no compiler counts as a C or C++ build on its runner's default compiler, unless it only runs another ecosystem's tools.""" def _jobs(self, *jobs: tuple[str, str]) -> dict[str, str]: @@ -160,7 +160,7 @@ def test_the_project_map_lists_each_jobs_ecosystems(self) -> None: {**MIXED_PROJECT, **self._jobs(("ubuntu-latest", "pip install gcovr && cmake -B b"))} ) as root: [job] = make_context(root).structure.as_dict()["ci"]["jobs"] # type: ignore[index] - self.assertEqual(job["ecosystems"], ["C/C++", "Python"]) + self.assertEqual(job["ecosystems"], ["C++", "Python"]) class PlatformQuestionTests(unittest.TestCase): diff --git a/tests/checks/test_sanitizers.py b/tests/checks/test_sanitizers.py index 4a12c929..7372a1cf 100644 --- a/tests/checks/test_sanitizers.py +++ b/tests/checks/test_sanitizers.py @@ -1,5 +1,5 @@ -"""The sanitizers check: C/C++ builds with AddressSanitizer and UndefinedBehaviorSanitizer in some configuration (one -warns, neither fails); Rust runs Miri or builds with -Zsanitizer; Go runs the race detector.""" +"""The sanitizers check: C and C++ builds with AddressSanitizer and UndefinedBehaviorSanitizer in some configuration +(one warns, neither fails); Rust runs Miri or builds with -Zsanitizer; Go runs the race detector.""" from __future__ import annotations diff --git a/tests/checks/test_secret_scanning.py b/tests/checks/test_secret_scanning.py index 79e1426a..49816635 100644 --- a/tests/checks/test_secret_scanning.py +++ b/tests/checks/test_secret_scanning.py @@ -19,7 +19,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(secret_scanning.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = secret_scanning.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = secret_scanning.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("secrets are scanned for with gitleaks")) def test_warns_without_a_secret_scanner(self) -> None: diff --git a/tests/checks/test_security_policy.py b/tests/checks/test_security_policy.py index 3021bc6a..267773b0 100644 --- a/tests/checks/test_security_policy.py +++ b/tests/checks/test_security_policy.py @@ -20,7 +20,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(security_policy.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = security_policy.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = security_policy.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("SECURITY.md says how to report a vulnerability")) def test_warns_without_a_security_policy(self) -> None: diff --git a/tests/checks/test_security_scanning.py b/tests/checks/test_security_scanning.py index 8f89218e..14ba2be0 100644 --- a/tests/checks/test_security_scanning.py +++ b/tests/checks/test_security_scanning.py @@ -208,11 +208,11 @@ def test_go_security_lints(self) -> None: self.assertEqual(self._run(without, "Go").status, Status.WARN) def test_each_language_is_judged_and_findings_are_labelled(self) -> None: - result = self._run(github_job("x", "bandit -r python"), "C", "C++", "Python") + result = self._run(github_job("x", "bandit -r python"), "C++", "Python") self.assertEqual(result.status, Status.WARN) self.assertEqual( result.message, - "C/C++: no code security scanning found in CI configuration; Python: CI scans the code for security " + "C++: no code security scanning found in CI configuration; Python: CI scans the code for security " "problems with bandit", ) diff --git a/tests/checks/test_static_analysis.py b/tests/checks/test_static_analysis.py index d01627f9..30404ef0 100644 --- a/tests/checks/test_static_analysis.py +++ b/tests/checks/test_static_analysis.py @@ -5,7 +5,7 @@ from project_validator.checks.static_analysis import static_analysis from project_validator.core import Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.go import GO from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST @@ -44,7 +44,7 @@ def test_declares_the_languages_it_judges(self) -> None: def test_well_configured_projects_pass(self) -> None: cases = ( - (WELL_CONFIGURED, (C_AND_CXX,), "clang-tidy (.clang-tidy) and cppcheck run"), + (WELL_CONFIGURED, (CXX,), "clang-tidy (.clang-tidy) and cppcheck run"), (WELL_CONFIGURED_PYTHON, (PYTHON,), "ruff check runs"), (WELL_CONFIGURED_RUST, (RUST,), "clippy (Cargo.toml) runs"), (WELL_CONFIGURED_GO, (GO,), "golangci-lint (.golangci.yml) runs"), diff --git a/tests/checks/test_status_badges.py b/tests/checks/test_status_badges.py index 20a7562e..c0663540 100644 --- a/tests/checks/test_status_badges.py +++ b/tests/checks/test_status_badges.py @@ -21,7 +21,7 @@ def test_applies_to_every_language(self) -> None: self.assertEqual(status_badges.languages, frozenset()) def test_passes_with_the_well_configured_fixture(self) -> None: - result = status_badges.run(make_context(FIXTURES / "well_configured_c_cpp")) + result = status_badges.run(make_context(FIXTURES / "well_configured_cpp")) self.assertEqual(result, Result.passed("README.md shows CI (GitHub Actions) and quality (Codecov) badges")) def test_fails_without_a_readme_or_badges(self) -> None: diff --git a/tests/checks/test_tests_run.py b/tests/checks/test_tests_run.py index 3ce23ef8..acb37622 100644 --- a/tests/checks/test_tests_run.py +++ b/tests/checks/test_tests_run.py @@ -9,7 +9,7 @@ from project_validator.checks.tests_run import tests_run from project_validator.core import Options, Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from project_validator.facts import Facts @@ -232,11 +232,11 @@ def test_a_language_no_known_runner_runs_is_skipped(self) -> None: class MixedLanguageTestsRunTests(unittest.TestCase): def test_every_language_needs_tests_and_findings_are_labelled(self) -> None: - result = run_as(self, tests_run, dict(WELL_CONFIGURED), C_AND_CXX, PYTHON) + result = run_as(self, tests_run, dict(WELL_CONFIGURED), CXX, PYTHON) self.assertEqual( result, Result.failed( - f"C/C++: {CTEST_TESTS}: 2 file(s), run by ctest; " + f"C++: {CTEST_TESTS}: 2 file(s), run by ctest; " "Python: no tests found (test_*.py, *_test.py or tests/*_tests.py files)" ), ) diff --git a/tests/checks/test_type_checking.py b/tests/checks/test_type_checking.py index c37b9e86..73474f9b 100644 --- a/tests/checks/test_type_checking.py +++ b/tests/checks/test_type_checking.py @@ -4,7 +4,7 @@ from project_validator.checks.type_checking import type_checking from project_validator.core import Result, Status -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.go import GO from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST @@ -27,7 +27,7 @@ def _run(self, files: dict[str, str]) -> Result: def test_applies_to_python_only_of_the_built_in_ecosystems(self) -> None: self.assertIn("Python", type_checking.languages) - for ecosystem in (C_AND_CXX, RUST, GO): + for ecosystem in (CXX, RUST, GO): with self.subTest(ecosystem.label): self.assertFalse(ecosystem.languages & type_checking.languages) @@ -36,7 +36,7 @@ def test_the_well_configured_project_passes_with_the_bonus(self) -> None: self.assertEqual(self._run(WELL_CONFIGURED_PYTHON), expected) def test_compiled_ecosystems_are_skipped(self) -> None: - self.assertEqual(type_checking.run(make_context(FIXTURES / "well_configured_c_cpp")).status, Status.SKIP) + self.assertEqual(type_checking.run(make_context(FIXTURES / "well_configured_cpp")).status, Status.SKIP) def test_fails_when_no_type_checker_runs(self) -> None: self.assertEqual(self._run(_ci("pytest")), Result.failed("no type checker runs", HINT)) diff --git a/tests/checks/test_vcs_ignore.py b/tests/checks/test_vcs_ignore.py index cb506b69..a949e043 100644 --- a/tests/checks/test_vcs_ignore.py +++ b/tests/checks/test_vcs_ignore.py @@ -6,7 +6,7 @@ from project_validator.checks.vcs_ignore import vcs_ignore from project_validator.core import Context, Options, Project, Result, Status from project_validator.ecosystems import C_FAMILY -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.ecosystems.rust import RUST from project_validator.facts import Facts @@ -69,7 +69,9 @@ def test_well_configured_project_passes(self) -> None: self.assertEqual(run_in_every_layout(self, vcs_ignore, WELL_CONFIGURED).status, Status.PASS) def test_this_project_ignores_its_own_build_outputs(self) -> None: - project = Project(ROOT, frozenset({PurePosixPath("tests/fixtures")})) + # As CI validates this project: the HTML report's script has no JavaScript toolchain of its own yet. + excluded = frozenset({PurePosixPath("tests/fixtures"), PurePosixPath("project_validator/views/assets")}) + project = Project(ROOT, excluded) result = vcs_ignore.run(Context(project, discover().providers, Options())) self.assertEqual(result.status, Status.PASS, result) @@ -232,15 +234,15 @@ def test_well_configured_rust_project_passes(self) -> None: class MixedLanguageVcsIgnoreTests(unittest.TestCase): def test_every_language_needs_its_outputs_ignored_and_findings_are_labelled(self) -> None: - result = run_as(self, vcs_ignore, {".gitignore": "build/\n"}, C_AND_CXX, PYTHON) + result = run_as(self, vcs_ignore, {".gitignore": "build/\n"}, CXX, PYTHON) expected = Result.warned( - "C/C++: .gitignore ignores build/; Python: .gitignore does not ignore Python bytecode", + "C++: .gitignore ignores build/; Python: .gitignore does not ignore Python bytecode", "Python: consider ignoring __pycache__/ and *.py[cod]", ) self.assertEqual(result, expected) def test_passes_when_every_language_is_ignored(self) -> None: - result = run_as(self, vcs_ignore, {".gitignore": "build/\n__pycache__/\n"}, C_AND_CXX, PYTHON) + result = run_as(self, vcs_ignore, {".gitignore": "build/\n__pycache__/\n"}, CXX, PYTHON) self.assertEqual(result.status, Status.PASS) diff --git a/tests/checks/test_warnings_as_errors.py b/tests/checks/test_warnings_as_errors.py index 2e370c7a..e4dcfff7 100644 --- a/tests/checks/test_warnings_as_errors.py +++ b/tests/checks/test_warnings_as_errors.py @@ -37,9 +37,9 @@ def _run(self, files: dict[str, str]) -> Result: self, warnings_as_errors, files, c_family_layouts_built_with(warnings_as_errors, "CMake") ) - # -Werror and /WX are C/C++ compiler flags, and the JVM and .NET compilers have their own; eslint --max-warnings 0 - # fails JavaScript linting on a warning, and PHPUnit's failOn* settings fail PHP tests on one. Other languages' - # equivalents are judged by compiler-warnings. + # -Werror and /WX are C and C++ compiler flags, and the JVM and .NET compilers have their own; eslint + # --max-warnings 0 fails JavaScript linting on a warning, and PHPUnit's failOn* settings fail PHP tests on one. + # Other languages' equivalents are judged by compiler-warnings. def test_declares_the_languages_it_judges(self) -> None: self.assertLessEqual(C_FAMILY | {"JavaScript", "Java"}, warnings_as_errors.languages) self.assertNotIn("Python", warnings_as_errors.languages) @@ -147,7 +147,7 @@ def test_passes_with_the_werror_option(self) -> None: self.assertEqual(result, Result.passed("warnings are treated as errors with -Werror")) def test_passes_with_werror_or_wx_as_project_arguments(self) -> None: - result = self._run({"meson.build": "add_project_arguments('-Werror', language: 'cpp')\n"}) + result = self._run({"meson.build": "add_project_arguments('-Werror', language: ['c', 'cpp'])\n"}) self.assertEqual(result.message, "warnings are treated as errors with -Werror") def test_disabled_or_commented_out_werror_and_cmake_settings_do_not_count(self) -> None: diff --git a/tests/fixtures/bare_c/CMakeLists.txt b/tests/fixtures/bare_c/CMakeLists.txt new file mode 100644 index 00000000..f6c8bdac --- /dev/null +++ b/tests/fixtures/bare_c/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.21) +project(bare_project LANGUAGES C) +add_executable(bare main.c) diff --git a/tests/fixtures/bare_c_cpp/main.o b/tests/fixtures/bare_c/main.o similarity index 100% rename from tests/fixtures/bare_c_cpp/main.o rename to tests/fixtures/bare_c/main.o diff --git a/tests/fixtures/bare_c/third_party/cjson/cJSON.c b/tests/fixtures/bare_c/third_party/cjson/cJSON.c new file mode 100644 index 00000000..09f1a73c --- /dev/null +++ b/tests/fixtures/bare_c/third_party/cjson/cJSON.c @@ -0,0 +1,2 @@ +#include "cJSON.h" +int cJSON_Parse(const char *value) { return value != 0; } diff --git a/tests/fixtures/bare_c/third_party/cjson/cJSON.h b/tests/fixtures/bare_c/third_party/cjson/cJSON.h new file mode 100644 index 00000000..91bdf149 --- /dev/null +++ b/tests/fixtures/bare_c/third_party/cjson/cJSON.h @@ -0,0 +1,2 @@ +/* cJSON, vendored */ +int cJSON_Parse(const char *value); diff --git a/tests/fixtures/bare_c_cpp/CMakeLists.txt b/tests/fixtures/bare_cpp/CMakeLists.txt similarity index 100% rename from tests/fixtures/bare_c_cpp/CMakeLists.txt rename to tests/fixtures/bare_cpp/CMakeLists.txt diff --git a/tests/fixtures/bare_cpp/main.o b/tests/fixtures/bare_cpp/main.o new file mode 100644 index 00000000..e69de29b diff --git a/tests/fixtures/bare_c_cpp/third_party/json/json.hpp b/tests/fixtures/bare_cpp/third_party/json/json.hpp similarity index 100% rename from tests/fixtures/bare_c_cpp/third_party/json/json.hpp rename to tests/fixtures/bare_cpp/third_party/json/json.hpp diff --git a/tests/fixtures/bare_typescript/coverage/lcov.info b/tests/fixtures/bare_typescript/coverage/lcov.info new file mode 100644 index 00000000..fde885d3 --- /dev/null +++ b/tests/fixtures/bare_typescript/coverage/lcov.info @@ -0,0 +1,2 @@ +TN: +end_of_record diff --git a/tests/fixtures/bare_typescript/package.json b/tests/fixtures/bare_typescript/package.json new file mode 100644 index 00000000..54b74253 --- /dev/null +++ b/tests/fixtures/bare_typescript/package.json @@ -0,0 +1,8 @@ +{ + "name": "app", + "version": "0.1.0", + "main": "dist/index.js", + "dependencies": { + "left-pad": "^1.3.0" + } +} diff --git a/tests/fixtures/bare_typescript/src/index.ts b/tests/fixtures/bare_typescript/src/index.ts new file mode 100644 index 00000000..7d658310 --- /dev/null +++ b/tests/fixtures/bare_typescript/src/index.ts @@ -0,0 +1,3 @@ +export function add(a, b) { + return a + b; +} diff --git a/tests/fixtures/well_configured_c_cpp/.clang-format b/tests/fixtures/well_configured_c/.clang-format similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.clang-format rename to tests/fixtures/well_configured_c/.clang-format diff --git a/tests/fixtures/well_configured_c_cpp/.clang-tidy b/tests/fixtures/well_configured_c/.clang-tidy similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.clang-tidy rename to tests/fixtures/well_configured_c/.clang-tidy diff --git a/tests/fixtures/well_configured_c_cpp/.github/dependabot.yml b/tests/fixtures/well_configured_c/.github/dependabot.yml similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.github/dependabot.yml rename to tests/fixtures/well_configured_c/.github/dependabot.yml diff --git a/tests/fixtures/well_configured_c_cpp/.github/workflows/ci-lint.yml b/tests/fixtures/well_configured_c/.github/workflows/ci-lint.yml similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.github/workflows/ci-lint.yml rename to tests/fixtures/well_configured_c/.github/workflows/ci-lint.yml diff --git a/tests/fixtures/well_configured_c/.github/workflows/ci.yml b/tests/fixtures/well_configured_c/.github/workflows/ci.yml new file mode 100644 index 00000000..bac33a13 --- /dev/null +++ b/tests/fixtures/well_configured_c/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: ci +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + compiler: [gcc, clang] + build_type: [Release, Debug] + sanitizers: ["ON", "OFF"] + include: + - os: windows-latest + compiler: msvc + build_type: Release + sanitizers: "ON" + - os: windows-latest + compiler: msvc + build_type: Release + sanitizers: "OFF" + - os: windows-latest + compiler: msvc + build_type: Debug + sanitizers: "ON" + - os: windows-latest + compiler: msvc + build_type: Debug + sanitizers: "OFF" + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: cmake -S . -B build -DCMAKE_C_COMPILER=${{ matrix.compiler }} -DENABLE_COVERAGE=ON + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_SANITIZERS=${{ matrix.sanitizers }} + - run: cmake --build build + - run: mull-runner build/tests + - run: ctest --test-dir build --output-on-failure + - run: gcovr --fail-under-branch 80 + - run: run-clang-tidy -p build + - run: cppcheck --project=build/compile_commands.json --error-exitcode=1 + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: find . -name '*.c' | xargs clang-format --dry-run -Werror diff --git a/tests/fixtures/well_configured_c_cpp/.github/workflows/codeql-analysis.yml b/tests/fixtures/well_configured_c/.github/workflows/codeql-analysis.yml similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.github/workflows/codeql-analysis.yml rename to tests/fixtures/well_configured_c/.github/workflows/codeql-analysis.yml diff --git a/tests/fixtures/well_configured_c/.github/workflows/copy-paste-detection.yml b/tests/fixtures/well_configured_c/.github/workflows/copy-paste-detection.yml new file mode 100644 index 00000000..390642d4 --- /dev/null +++ b/tests/fixtures/well_configured_c/.github/workflows/copy-paste-detection.yml @@ -0,0 +1,9 @@ +name: copy-paste-detection +on: [push, pull_request] + +jobs: + cpd: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: pmd cpd --language c --minimum-tokens 100 --dir src --dir include diff --git a/tests/fixtures/well_configured_c_cpp/.gitignore b/tests/fixtures/well_configured_c/.gitignore similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.gitignore rename to tests/fixtures/well_configured_c/.gitignore diff --git a/tests/fixtures/well_configured_c/CMakeLists.txt b/tests/fixtures/well_configured_c/CMakeLists.txt new file mode 100644 index 00000000..75a280b1 --- /dev/null +++ b/tests/fixtures/well_configured_c/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.21) +project(well_configured LANGUAGES C) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR "In-source builds are not allowed; use cmake -S . -B build") +endif() + +set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(MSVC) + add_compile_options(/W4 /permissive- /sdl /guard:cf) + add_link_options(/DYNAMICBASE /CETCOMPAT) +else() + add_compile_options(-Wall -Wextra -Wpedantic -Wshadow -Wconversion) + add_compile_options(-fstack-protector-strong -fcf-protection -fstack-clash-protection) + add_compile_definitions(_FORTIFY_SOURCE=3) +endif() + +option(ENABLE_COVERAGE "Instrument for coverage" OFF) +if(ENABLE_COVERAGE) + add_compile_options(--coverage -fcondition-coverage) + add_link_options(--coverage) +endif() + +option(ENABLE_SANITIZERS "Build with AddressSanitizer and UndefinedBehaviorSanitizer" OFF) +if(ENABLE_SANITIZERS) + if(MSVC) + add_compile_options(/fsanitize=address) + else() + add_compile_options(-fsanitize=address,undefined) + add_link_options(-fsanitize=address,undefined) + endif() +endif() + +option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON) +if(WARNINGS_AS_ERRORS) + add_compile_options(-Werror) +endif() + +if(PROJECT_IS_TOP_LEVEL) + include(CTest) + add_subdirectory(test) + if(NOT MSVC) + add_subdirectory(fuzz_test) + endif() +endif() diff --git a/tests/fixtures/well_configured_c_cpp/LICENSE b/tests/fixtures/well_configured_c/LICENSE similarity index 100% rename from tests/fixtures/well_configured_c_cpp/LICENSE rename to tests/fixtures/well_configured_c/LICENSE diff --git a/tests/fixtures/well_configured_c_cpp/README.md b/tests/fixtures/well_configured_c/README.md similarity index 100% rename from tests/fixtures/well_configured_c_cpp/README.md rename to tests/fixtures/well_configured_c/README.md diff --git a/tests/fixtures/well_configured_c_cpp/SECURITY.md b/tests/fixtures/well_configured_c/SECURITY.md similarity index 100% rename from tests/fixtures/well_configured_c_cpp/SECURITY.md rename to tests/fixtures/well_configured_c/SECURITY.md diff --git a/tests/fixtures/well_configured_c_cpp/cmake/Dependencies.cmake b/tests/fixtures/well_configured_c/cmake/Dependencies.cmake similarity index 100% rename from tests/fixtures/well_configured_c_cpp/cmake/Dependencies.cmake rename to tests/fixtures/well_configured_c/cmake/Dependencies.cmake diff --git a/tests/fixtures/well_configured_c/fuzz_test/CMakeLists.txt b/tests/fixtures/well_configured_c/fuzz_test/CMakeLists.txt new file mode 100644 index 00000000..a9d919b1 --- /dev/null +++ b/tests/fixtures/well_configured_c/fuzz_test/CMakeLists.txt @@ -0,0 +1,6 @@ +add_executable(fuzz_tester fuzz_tester.c) +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + target_compile_options(fuzz_tester PRIVATE -fsanitize=fuzzer,undefined,address) + target_link_options(fuzz_tester PRIVATE -fsanitize=fuzzer,undefined,address) +endif() +add_test(NAME fuzz_tester_run COMMAND fuzz_tester -max_total_time=10) diff --git a/tests/fixtures/well_configured_c/fuzz_test/fuzz_tester.c b/tests/fixtures/well_configured_c/fuzz_test/fuzz_tester.c new file mode 100644 index 00000000..47f8200a --- /dev/null +++ b/tests/fixtures/well_configured_c/fuzz_test/fuzz_tester.c @@ -0,0 +1,8 @@ +#include +#include + +/* A libFuzzer target: the fuzzer calls it with generated inputs. */ +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +{ + return (data != NULL && size > 0) ? 0 : 0; +} diff --git a/tests/fixtures/well_configured_c/test/CMakeLists.txt b/tests/fixtures/well_configured_c/test/CMakeLists.txt new file mode 100644 index 00000000..fde9f731 --- /dev/null +++ b/tests/fixtures/well_configured_c/test/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(tests tests.c) +add_test(NAME tests COMMAND tests) diff --git a/tests/fixtures/well_configured_cpp/.clang-format b/tests/fixtures/well_configured_cpp/.clang-format new file mode 100644 index 00000000..9b3aa8b7 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: LLVM diff --git a/tests/fixtures/well_configured_cpp/.clang-tidy b/tests/fixtures/well_configured_cpp/.clang-tidy new file mode 100644 index 00000000..cef9bb59 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.clang-tidy @@ -0,0 +1,4 @@ +Checks: '-*,readability-function-size' +CheckOptions: + - key: readability-function-size.LineThreshold + value: 80 diff --git a/tests/fixtures/well_configured_cpp/.github/dependabot.yml b/tests/fixtures/well_configured_cpp/.github/dependabot.yml new file mode 100644 index 00000000..5ace4600 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/tests/fixtures/well_configured_cpp/.github/workflows/ci-lint.yml b/tests/fixtures/well_configured_cpp/.github/workflows/ci-lint.yml new file mode 100644 index 00000000..ac9333ba --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.github/workflows/ci-lint.yml @@ -0,0 +1,9 @@ +on: [push, pull_request] +jobs: + ci-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: pipx run zizmor .github + - uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 + - run: gitleaks git --redact . diff --git a/tests/fixtures/well_configured_c_cpp/.github/workflows/ci.yml b/tests/fixtures/well_configured_cpp/.github/workflows/ci.yml similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.github/workflows/ci.yml rename to tests/fixtures/well_configured_cpp/.github/workflows/ci.yml diff --git a/tests/fixtures/well_configured_cpp/.github/workflows/codeql-analysis.yml b/tests/fixtures/well_configured_cpp/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..7f93d6d4 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.github/workflows/codeql-analysis.yml @@ -0,0 +1,15 @@ +name: codeql +on: [push, pull_request] + +jobs: + analyze: + runs-on: ubuntu-latest + permissions: + security-events: write + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9 # v3 + with: + languages: cpp + - run: cmake -S . -B build && cmake --build build + - uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9 # v3 diff --git a/tests/fixtures/well_configured_c_cpp/.github/workflows/copy-paste-detection.yml b/tests/fixtures/well_configured_cpp/.github/workflows/copy-paste-detection.yml similarity index 100% rename from tests/fixtures/well_configured_c_cpp/.github/workflows/copy-paste-detection.yml rename to tests/fixtures/well_configured_cpp/.github/workflows/copy-paste-detection.yml diff --git a/tests/fixtures/well_configured_cpp/.gitignore b/tests/fixtures/well_configured_cpp/.gitignore new file mode 100644 index 00000000..a07d5ed8 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/.gitignore @@ -0,0 +1,2 @@ +/build/ +/out/ diff --git a/tests/fixtures/well_configured_c_cpp/CMakeLists.txt b/tests/fixtures/well_configured_cpp/CMakeLists.txt similarity index 100% rename from tests/fixtures/well_configured_c_cpp/CMakeLists.txt rename to tests/fixtures/well_configured_cpp/CMakeLists.txt diff --git a/tests/fixtures/well_configured_cpp/LICENSE b/tests/fixtures/well_configured_cpp/LICENSE new file mode 100644 index 00000000..1b3edae7 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Example Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tests/fixtures/well_configured_cpp/README.md b/tests/fixtures/well_configured_cpp/README.md new file mode 100644 index 00000000..ec54841b --- /dev/null +++ b/tests/fixtures/well_configured_cpp/README.md @@ -0,0 +1,4 @@ +# app + +[![ci](https://github.com/example/app/actions/workflows/ci.yml/badge.svg)](https://github.com/example/app/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/example/app/graph/badge.svg)](https://codecov.io/gh/example/app) diff --git a/tests/fixtures/well_configured_cpp/SECURITY.md b/tests/fixtures/well_configured_cpp/SECURITY.md new file mode 100644 index 00000000..0b161bda --- /dev/null +++ b/tests/fixtures/well_configured_cpp/SECURITY.md @@ -0,0 +1,3 @@ +# Security policy + +Report vulnerabilities to security@example.com. diff --git a/tests/fixtures/well_configured_cpp/cmake/Dependencies.cmake b/tests/fixtures/well_configured_cpp/cmake/Dependencies.cmake new file mode 100644 index 00000000..96e58d70 --- /dev/null +++ b/tests/fixtures/well_configured_cpp/cmake/Dependencies.cmake @@ -0,0 +1,7 @@ +include(FetchContent) +FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG 2b60af89e23d28eefc081bc930831ee9d45ea58b # v3.8.1 +) +FetchContent_MakeAvailable(Catch2) diff --git a/tests/fixtures/well_configured_c_cpp/fuzz_test/CMakeLists.txt b/tests/fixtures/well_configured_cpp/fuzz_test/CMakeLists.txt similarity index 100% rename from tests/fixtures/well_configured_c_cpp/fuzz_test/CMakeLists.txt rename to tests/fixtures/well_configured_cpp/fuzz_test/CMakeLists.txt diff --git a/tests/fixtures/well_configured_c_cpp/fuzz_test/fuzz_tester.cpp b/tests/fixtures/well_configured_cpp/fuzz_test/fuzz_tester.cpp similarity index 100% rename from tests/fixtures/well_configured_c_cpp/fuzz_test/fuzz_tester.cpp rename to tests/fixtures/well_configured_cpp/fuzz_test/fuzz_tester.cpp diff --git a/tests/fixtures/well_configured_c_cpp/test/CMakeLists.txt b/tests/fixtures/well_configured_cpp/test/CMakeLists.txt similarity index 100% rename from tests/fixtures/well_configured_c_cpp/test/CMakeLists.txt rename to tests/fixtures/well_configured_cpp/test/CMakeLists.txt diff --git a/tests/fixtures/well_configured_javascript/.github/workflows/ci.yml b/tests/fixtures/well_configured_javascript/.github/workflows/ci.yml index e368a936..b83dd4ea 100644 --- a/tests/fixtures/well_configured_javascript/.github/workflows/ci.yml +++ b/tests/fixtures/well_configured_javascript/.github/workflows/ci.yml @@ -13,7 +13,6 @@ jobs: - run: npm ci - run: npm run format:check - run: npm run lint - - run: npm run typecheck - run: npm test - run: npm audit --audit-level=moderate - run: npx stryker run --incremental diff --git a/tests/fixtures/well_configured_javascript/fuzz/add.fuzz.js b/tests/fixtures/well_configured_javascript/fuzz/add.fuzz.js index 6790373b..76df242a 100644 --- a/tests/fixtures/well_configured_javascript/fuzz/add.fuzz.js +++ b/tests/fixtures/well_configured_javascript/fuzz/add.fuzz.js @@ -1,4 +1,4 @@ -import { add } from "../dist/add.js"; +import { add } from "../src/add.js"; /** Jazzer.js entry point: adding any input length must not throw. */ export function fuzz(data) { diff --git a/tests/fixtures/well_configured_javascript/package.json b/tests/fixtures/well_configured_javascript/package.json index ca94253a..0350815c 100644 --- a/tests/fixtures/well_configured_javascript/package.json +++ b/tests/fixtures/well_configured_javascript/package.json @@ -3,12 +3,10 @@ "version": "0.1.0", "license": "MIT", "type": "module", - "main": "dist/add.js", + "main": "src/add.js", "scripts": { - "build": "tsc", "format:check": "prettier --check .", "lint": "eslint --max-warnings 0 .", - "typecheck": "tsc --noEmit", "test": "vitest run --coverage" }, "devDependencies": { @@ -16,7 +14,6 @@ "eslint": "^9.30.0", "eslint-plugin-security": "^3.0.1", "prettier": "^3.6.0", - "typescript": "^5.9.0", "vitest": "^3.2.0" } } diff --git a/tests/fixtures/well_configured_javascript/src/add.js b/tests/fixtures/well_configured_javascript/src/add.js new file mode 100644 index 00000000..b9be8ae2 --- /dev/null +++ b/tests/fixtures/well_configured_javascript/src/add.js @@ -0,0 +1,4 @@ +/** The sum of a and b. */ +export function add(a, b) { + return a + b; +} diff --git a/tests/fixtures/well_configured_javascript/src/add.test.ts b/tests/fixtures/well_configured_javascript/src/add.test.js similarity index 100% rename from tests/fixtures/well_configured_javascript/src/add.test.ts rename to tests/fixtures/well_configured_javascript/src/add.test.js diff --git a/tests/fixtures/well_configured_typescript/.github/dependabot.yml b/tests/fixtures/well_configured_typescript/.github/dependabot.yml new file mode 100644 index 00000000..ca79ca5b --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/tests/fixtures/well_configured_typescript/.github/workflows/ci-lint.yml b/tests/fixtures/well_configured_typescript/.github/workflows/ci-lint.yml new file mode 100644 index 00000000..ac9333ba --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.github/workflows/ci-lint.yml @@ -0,0 +1,9 @@ +on: [push, pull_request] +jobs: + ci-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: pipx run zizmor .github + - uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 + - run: gitleaks git --redact . diff --git a/tests/fixtures/well_configured_typescript/.github/workflows/ci.yml b/tests/fixtures/well_configured_typescript/.github/workflows/ci.yml new file mode 100644 index 00000000..46691352 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + node: ["22", "24"] + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: ${{ matrix.node }} + - run: npm ci + - run: npm run format:check + - run: npm run lint + - run: npm run typecheck + - run: npm test + - run: npm audit --audit-level=moderate + - run: npx stryker run --incremental + - run: npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30 diff --git a/tests/fixtures/well_configured_typescript/.github/workflows/copy-paste-detection.yml b/tests/fixtures/well_configured_typescript/.github/workflows/copy-paste-detection.yml new file mode 100644 index 00000000..f7f288ab --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.github/workflows/copy-paste-detection.yml @@ -0,0 +1,6 @@ +jobs: + copy-paste-detection: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: npx --yes jscpd@4 --threshold 0 . diff --git a/tests/fixtures/well_configured_typescript/.github/workflows/function-limits.yml b/tests/fixtures/well_configured_typescript/.github/workflows/function-limits.yml new file mode 100644 index 00000000..0b6c0119 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.github/workflows/function-limits.yml @@ -0,0 +1,7 @@ +jobs: + function-limits: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - run: python -m pip install lizard + - run: lizard --length 30 --warnings_only . diff --git a/tests/fixtures/well_configured_typescript/.gitignore b/tests/fixtures/well_configured_typescript/.gitignore new file mode 100644 index 00000000..06c3eac6 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +coverage/ +dist/ diff --git a/tests/fixtures/well_configured_typescript/LICENSE b/tests/fixtures/well_configured_typescript/LICENSE new file mode 100644 index 00000000..1b3edae7 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Example Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tests/fixtures/well_configured_typescript/README.md b/tests/fixtures/well_configured_typescript/README.md new file mode 100644 index 00000000..ec54841b --- /dev/null +++ b/tests/fixtures/well_configured_typescript/README.md @@ -0,0 +1,4 @@ +# app + +[![ci](https://github.com/example/app/actions/workflows/ci.yml/badge.svg)](https://github.com/example/app/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/example/app/graph/badge.svg)](https://codecov.io/gh/example/app) diff --git a/tests/fixtures/well_configured_typescript/SECURITY.md b/tests/fixtures/well_configured_typescript/SECURITY.md new file mode 100644 index 00000000..0b161bda --- /dev/null +++ b/tests/fixtures/well_configured_typescript/SECURITY.md @@ -0,0 +1,3 @@ +# Security policy + +Report vulnerabilities to security@example.com. diff --git a/tests/fixtures/well_configured_typescript/eslint.config.js b/tests/fixtures/well_configured_typescript/eslint.config.js new file mode 100644 index 00000000..23c0bd08 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/eslint.config.js @@ -0,0 +1,3 @@ +import security from "eslint-plugin-security"; + +export default [security.configs.recommended]; diff --git a/tests/fixtures/well_configured_typescript/fuzz/add.fuzz.ts b/tests/fixtures/well_configured_typescript/fuzz/add.fuzz.ts new file mode 100644 index 00000000..bb942054 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/fuzz/add.fuzz.ts @@ -0,0 +1,6 @@ +import { add } from "../src/add.js"; + +/** Jazzer.js entry point: adding any input length must not throw. */ +export function fuzz(data: Buffer): void { + add(data.length, data.length); +} diff --git a/tests/fixtures/well_configured_typescript/package-lock.json b/tests/fixtures/well_configured_typescript/package-lock.json new file mode 100644 index 00000000..afc63a17 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "app", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "app", + "version": "0.1.0", + "license": "MIT" + } + } +} diff --git a/tests/fixtures/well_configured_typescript/package.json b/tests/fixtures/well_configured_typescript/package.json new file mode 100644 index 00000000..ca94253a --- /dev/null +++ b/tests/fixtures/well_configured_typescript/package.json @@ -0,0 +1,22 @@ +{ + "name": "app", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "main": "dist/add.js", + "scripts": { + "build": "tsc", + "format:check": "prettier --check .", + "lint": "eslint --max-warnings 0 .", + "typecheck": "tsc --noEmit", + "test": "vitest run --coverage" + }, + "devDependencies": { + "@vitest/coverage-v8": "^3.2.0", + "eslint": "^9.30.0", + "eslint-plugin-security": "^3.0.1", + "prettier": "^3.6.0", + "typescript": "^5.9.0", + "vitest": "^3.2.0" + } +} diff --git a/tests/fixtures/well_configured_typescript/src/add.test.ts b/tests/fixtures/well_configured_typescript/src/add.test.ts new file mode 100644 index 00000000..3a44af48 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/src/add.test.ts @@ -0,0 +1,7 @@ +import { expect, test } from "vitest"; + +import { add } from "./add.js"; + +test("adds", () => { + expect(add(1, 2)).toBe(3); +}); diff --git a/tests/fixtures/well_configured_javascript/src/add.ts b/tests/fixtures/well_configured_typescript/src/add.ts similarity index 100% rename from tests/fixtures/well_configured_javascript/src/add.ts rename to tests/fixtures/well_configured_typescript/src/add.ts diff --git a/tests/fixtures/well_configured_typescript/stryker.config.json b/tests/fixtures/well_configured_typescript/stryker.config.json new file mode 100644 index 00000000..72d0f841 --- /dev/null +++ b/tests/fixtures/well_configured_typescript/stryker.config.json @@ -0,0 +1 @@ +{"testRunner": "jest"} diff --git a/tests/fixtures/well_configured_javascript/tsconfig.json b/tests/fixtures/well_configured_typescript/tsconfig.json similarity index 100% rename from tests/fixtures/well_configured_javascript/tsconfig.json rename to tests/fixtures/well_configured_typescript/tsconfig.json diff --git a/tests/layouts/c.py b/tests/layouts/c.py new file mode 100644 index 00000000..0cb97399 --- /dev/null +++ b/tests/layouts/c.py @@ -0,0 +1,23 @@ +"""Kinds of C project, for tests that run a check in every layout.""" + +from __future__ import annotations + +from tests.layouts.model import ProjectLayout + +C = frozenset({"C"}) + +# CMake files are deliberately free of project() and settings so that the files a test adds decide what is checked. +LAYOUTS = ( + ProjectLayout( + name="CMake C", + files={"CMakeLists.txt": "", "src/main.c": "", "include/app.h": ""}, + languages=C, + build_systems=frozenset({"CMake"}), + ), + ProjectLayout( + name="Meson C", + files={"meson.build": "project('app', 'c')\n", "src/main.c": ""}, + languages=C, + build_systems=frozenset({"Meson"}), + ), +) diff --git a/tests/layouts/c_cpp.py b/tests/layouts/cpp.py similarity index 63% rename from tests/layouts/c_cpp.py rename to tests/layouts/cpp.py index 30eca581..9bb0a3dc 100644 --- a/tests/layouts/c_cpp.py +++ b/tests/layouts/cpp.py @@ -1,46 +1,35 @@ -"""Kinds of C/C++ project, for tests that run a check in every layout.""" +"""Kinds of C++ project, for tests that run a check in every layout.""" from __future__ import annotations -from project_validator.ecosystems import C_FAMILY from tests.layouts.model import ProjectLayout +CXX = frozenset({"C++"}) + # CMake files are deliberately free of project() and settings so that the files a test adds decide what is checked. LAYOUTS = ( ProjectLayout( name="CMake C++", files={"CMakeLists.txt": "", "src/main.cpp": "", "include/app/app.hpp": ""}, - languages=C_FAMILY, - build_systems=frozenset({"CMake"}), - ), - ProjectLayout( - name="CMake C", - files={"CMakeLists.txt": "", "src/main.c": "", "include/app.h": ""}, - languages=C_FAMILY, + languages=CXX, build_systems=frozenset({"CMake"}), ), ProjectLayout( name="CMake C++ with Python bindings", files={"CMakeLists.txt": "", "pyproject.toml": "", "src/module.cpp": "", "python/app/__init__.py": ""}, - languages=C_FAMILY | {"Python"}, + languages=CXX | {"Python"}, build_systems=frozenset({"CMake", "Python packaging"}), ), ProjectLayout( name="Meson C++", files={"meson.build": "project('app', 'cpp')\n", "src/main.cpp": ""}, - languages=frozenset({"C++"}), - build_systems=frozenset({"Meson"}), - ), - ProjectLayout( - name="Meson C", - files={"meson.build": "project('app', 'c')\n", "src/main.c": ""}, - languages=frozenset({"C"}), + languages=CXX, build_systems=frozenset({"Meson"}), ), ProjectLayout( name="Header-only C++", files={"include/app/app.hpp": ""}, - languages=frozenset({"C++"}), + languages=CXX, build_systems=frozenset(), # Without a build file there is no build to lay out: nothing to export, guard or keep out of the source tree. skipped=frozenset({"out-of-source-build", "compile-commands", "top-level-guard"}), diff --git a/tests/layouts/javascript.py b/tests/layouts/javascript.py index 9856ea9a..21e1995e 100644 --- a/tests/layouts/javascript.py +++ b/tests/layouts/javascript.py @@ -1,4 +1,4 @@ -"""Kinds of JavaScript/TypeScript project, for tests that run a check in every layout.""" +"""Kinds of JavaScript project, for tests that run a check in every layout.""" from __future__ import annotations @@ -11,10 +11,4 @@ languages=frozenset({"JavaScript"}), build_systems=frozenset({"npm"}), ), - ProjectLayout( - name="Deno TypeScript", - files={"deno.json": "{}\n", "main.ts": ""}, - languages=frozenset({"TypeScript"}), - build_systems=frozenset({"Deno"}), - ), ) diff --git a/tests/layouts/model.py b/tests/layouts/model.py index f83d9cdc..bb3e7b9d 100644 --- a/tests/layouts/model.py +++ b/tests/layouts/model.py @@ -30,5 +30,5 @@ def uses_cmake(self) -> bool: @property def gets_c_family_checks(self) -> bool: - """C/C++ checks run for C and C++ projects only.""" + """The C-family checks run for C and C++ projects only.""" return bool(self.languages & C_FAMILY) diff --git a/tests/layouts/typescript.py b/tests/layouts/typescript.py new file mode 100644 index 00000000..e5461df5 --- /dev/null +++ b/tests/layouts/typescript.py @@ -0,0 +1,20 @@ +"""Kinds of TypeScript project, for tests that run a check in every layout.""" + +from __future__ import annotations + +from tests.layouts.model import ProjectLayout + +LAYOUTS = ( + ProjectLayout( + name="npm TypeScript", + files={"package.json": '{"main": "dist/index.js"}\n', "tsconfig.json": "{}\n", "src/index.ts": ""}, + languages=frozenset({"TypeScript"}), + build_systems=frozenset({"npm"}), + ), + ProjectLayout( + name="Deno TypeScript", + files={"deno.json": "{}\n", "main.ts": ""}, + languages=frozenset({"TypeScript"}), + build_systems=frozenset({"Deno"}), + ), +) diff --git a/tests/regressions/test_cmake.py b/tests/regressions/test_cmake.py index e6488859..2f1b2103 100644 --- a/tests/regressions/test_cmake.py +++ b/tests/regressions/test_cmake.py @@ -7,8 +7,8 @@ from collections.abc import Mapping from project_validator.build_systems.meson import syntax +from project_validator.checks.compiler_extensions import compiler_extensions from project_validator.checks.compiler_warnings import compiler_warnings -from project_validator.checks.cxx_extensions import cxx_extensions from project_validator.checks.out_of_source_build import out_of_source_build from project_validator.checks.sanitizers import sanitizers from project_validator.checks.static_analysis import static_analysis @@ -143,7 +143,7 @@ def test_c_extensions_off_counts_after_a_property_set_from_a_branched_variable(s "if(UNIX AND BUILD_SHARED_LIBS)\n set(GLFW_LIB_NAME glfw)\nelse()\n set(GLFW_LIB_NAME glfw3)\nendif()\n" "set_target_properties(glfw PROPERTIES OUTPUT_NAME ${GLFW_LIB_NAME} C_STANDARD 99 C_EXTENSIONS OFF)\n" ) - result = _run(cxx_extensions, {"CMakeLists.txt": C_PROJECT + build, "a.c": ""}) + result = _run(compiler_extensions, {"CMakeLists.txt": C_PROJECT + build, "a.c": ""}) self.assertEqual(result.status, Status.PASS, result) def test_a_wrapper_around_add_custom_command_runs_its_linter(self) -> None: diff --git a/tests/regressions/test_detection.py b/tests/regressions/test_detection.py index e9337264..5c463be9 100644 --- a/tests/regressions/test_detection.py +++ b/tests/regressions/test_detection.py @@ -127,10 +127,10 @@ def test_malformed_test_data_below_a_source_root_is_reported_not_judged(self) -> class FlutterScaffoldingTests(unittest.TestCase): - @unittest.expectedFailure # upstream #185: Flutter's generated runners make C/C++, Swift and JVM units + @unittest.expectedFailure # upstream #185: Flutter's generated runners make C, C++, Swift and JVM units def test_flutter_platform_directories_are_the_flutter_builds_own(self) -> None: """The android/, ios/ and linux/ runners beside a pubspec with a `flutter:` section make the project neither - C/C++, Swift nor JVM, and add no CMake or Xcode build (dart-lang/http, bloc, drift).""" + C, C++, Swift nor JVM, and add no CMake or Xcode build (dart-lang/http, bloc, drift).""" structure = _structure(FLUTTER) self.assertEqual(structure.languages, frozenset({"Dart"})) self.assertEqual(structure.build_systems, frozenset({"pub"})) @@ -197,8 +197,8 @@ def test_a_unit_reports_only_the_test_files_it_owns(self) -> None: class JobAttributionTests(unittest.TestCase): def test_a_job_is_c_cxx_only_when_it_compiles_c_or_cxx(self) -> None: - """A job that runs `make lint` in a Python project, or the devenv CLI, is not a C/C++ job; a job that compiles - nothing has no compiler (compose-spec, country-codes, devenv, dbt-utils, every JVM project).""" + """A job that runs `make lint` in a Python project, or the devenv CLI, is not a C or C++ job; a job that + compiles nothing has no compiler (compose-spec, country-codes, devenv, dbt-utils, every JVM project).""" cases = ( {**PYTHON, **github_job("ubuntu-latest", "make lint")}, {**RUST, "flake.nix": DEV_SHELL_FLAKE, **github_job("ubuntu-latest", "devenv shell -- cargo test")}, @@ -208,7 +208,7 @@ def test_a_job_is_c_cxx_only_when_it_compiles_c_or_cxx(self) -> None: for files in cases: job = _job(files) with self.subTest(workflow=files[GITHUB_WORKFLOW]): - self.assertNotIn("C/C++", job.ecosystems) + self.assertFalse({"C", "C++"} & job.ecosystems) self.assertEqual(job.compilers, frozenset()) def test_a_clang_job_installing_gcc_multilib_is_clang_only(self) -> None: diff --git a/tests/regressions/test_messages.py b/tests/regressions/test_messages.py index 66095182..952386f5 100644 --- a/tests/regressions/test_messages.py +++ b/tests/regressions/test_messages.py @@ -11,8 +11,8 @@ from project_validator.checks.action_pinning import action_pinning from project_validator.checks.code_formatting import code_formatting +from project_validator.checks.compiler_extensions import compiler_extensions from project_validator.checks.compiler_warnings import compiler_warnings -from project_validator.checks.cxx_extensions import cxx_extensions from project_validator.checks.data_wellformed import data_wellformed from project_validator.checks.function_limits import function_limits from project_validator.checks.security_scanning import security_scanning @@ -46,19 +46,6 @@ "lib/Shop.pm": "package Shop;\n1;\n", ".gitignore": "blib/\nMYMETA.*\n", } -# zod's layout: workspace packages, one with JavaScript and TypeScript sources, each with a biome.jsonc CI never runs -# (with one package alone the identical results fold into one clause; with two, each language has its own). -JS_TS_WORKSPACE = { - "package.json": '{"name": "zod", "private": true, "workspaces": ["packages/*"]}', - "packages/mini/package.json": '{"name": "mini"}', - "packages/mini/src/a.js": "", - "packages/mini/src/b.ts": "", - "packages/mini/biome.jsonc": "{}", - "packages/core/package.json": '{"name": "core"}', - "packages/core/src/a.ts": "", - "packages/core/biome.jsonc": "{}", - **RUNS("ubuntu-latest", "npx jest"), -} LANGUAGE_PREFIX = re.compile(r"^[\w+#/ ]+?(?P in \S+)?: ") CMAKE_TESTS = { @@ -218,12 +205,10 @@ def _repeated(check: Check, files: Mapping[str, str]) -> list[str]: class RepeatedDetailTests(unittest.TestCase): def test_each_unread_subject_and_each_clause_is_said_once(self) -> None: """An unread local action is one detail line, not one per matrix OS (actions/checkout, build-push-action); a - distribution's unignored cover_db is one clause (mojo, perl-code-tidyall); a unit's clause is said once for - the JavaScript/TypeScript ecosystem, not per language (zod, axios).""" + distribution's unignored cover_db is one clause (mojo, perl-code-tidyall).""" cases = ( ("matrix OS", static_analysis, MATRIX_LOCAL_ACTION), ("Perl distribution", vcs_ignore, PERL_DISTRIBUTION), - ("JavaScript and TypeScript", code_formatting, JS_TS_WORKSPACE), ) for name, check, files in cases: with self.subTest(name): @@ -279,7 +264,7 @@ def test_the_fact_found_the_hint_and_the_kind_of_reference_are_right(self) -> No (terraform-null-label).""" with self.subTest("c_std"): meson = {"meson.build": "project('x', 'c', default_options: ['c_std=c11'])\n", "a.c": ""} - self.assertIn("c_std=c11", _run(cxx_extensions, meson).message) + self.assertIn("c_std=c11", _run(compiler_extensions, meson).message) with self.subTest("raco fmt"): hints = [detail for detail in _run(code_formatting, RACKET).details if detail.startswith("consider")] self.assertTrue(hints and "raco fmt" in hints[0], hints) diff --git a/tests/regressions/test_repository.py b/tests/regressions/test_repository.py index 7bd506f4..0a1dc4db 100644 --- a/tests/regressions/test_repository.py +++ b/tests/regressions/test_repository.py @@ -21,7 +21,7 @@ from tests.support import CMAKE_PROJECT, FIXTURES, github_job, make_context, temp_project from tests.test_project import git -MIT = (FIXTURES / "well_configured_c_cpp" / "LICENSE").read_text(encoding="utf-8") +MIT = (FIXTURES / "well_configured_cpp" / "LICENSE").read_text(encoding="utf-8") GPL_2 = "GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n" CC0 = "Creative Commons Legal Code\n\nCC0 1.0 Universal\n\nStatement of Purpose\n" GO_MODULE = {"go.mod": "module example.com/x\n", "main.go": "package main\n", "go.sum": ""} diff --git a/tests/snapshots/bare_ansible.json b/tests/snapshots/bare_ansible.json index a0e0d247..bd07045a 100644 --- a/tests/snapshots/bare_ansible.json +++ b/tests/snapshots/bare_ansible.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -218,6 +218,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -235,11 +240,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_beam.json b/tests/snapshots/bare_beam.json index cc942346..b6401d01 100644 --- a/tests/snapshots/bare_beam.json +++ b/tests/snapshots/bare_beam.json @@ -96,6 +96,18 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Elixir", + "units": [] + }, + { + "auxiliary": {}, + "language": "Erlang", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -254,18 +266,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Elixir", - "units": [] - }, - { - "auxiliary": {}, - "language": "Erlang", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1228,6 +1228,11 @@ "message": "not applicable to Elixir, Erlang", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Elixir, Erlang", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "Elixir: no Elixir linters found; enable at least mix credo --strict; Erlang: no Erlang warnings found; enable at least warn_* erl_opts, elvis", @@ -1248,11 +1253,6 @@ "message": "Elixir: no line coverage measurement found in what CI runs; Erlang: no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Elixir, Erlang", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Elixir, Erlang", diff --git a/tests/snapshots/bare_c.facts.json b/tests/snapshots/bare_c.facts.json new file mode 100644 index 00000000..5be72fac --- /dev/null +++ b/tests/snapshots/bare_c.facts.json @@ -0,0 +1,99 @@ +{ + "facts": [ + { + "kind": "AuxiliaryCode", + "named": [], + "origin": "." + }, + { + "build_system": "CMake", + "kind": "BuildFile", + "languages": [ + "C" + ], + "origin": "CMakeLists.txt" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "C", + "origin": "third_party/cjson/cJSON.c", + "role": "vendored" + }, + { + "ambiguous": true, + "kind": "SourceFile", + "language": "C", + "origin": "third_party/cjson/cJSON.h", + "role": "vendored" + }, + { + "build_systems": [ + "CMake" + ], + "formats": [], + "kind": "Unit", + "languages": [ + "C" + ], + "origin": ".", + "role": "product" + }, + { + "kind": "CommittedOutput", + "languages": [ + "C", + "C++" + ], + "origin": "main.o", + "output": "the build directory" + }, + { + "kind": "ConfigurationFile", + "origin": "CMakeLists.txt", + "reader": "CMake" + }, + { + "kind": "ConfigurationFile", + "origin": "CMakeLists.txt", + "reader": "Fortran programs" + } + ], + "map": { + "build_systems": [ + "CMake" + ], + "ci": { + "files": [], + "jobs": [], + "providers": [] + }, + "ecosystems": { + "C": [ + "build file CMakeLists.txt" + ] + }, + "formats": [], + "languages": [ + "C" + ], + "units": [ + { + "build_systems": [ + "CMake" + ], + "directory": ".", + "formats": [], + "languages": [ + "C" + ], + "role": "product" + } + ], + "unrecognised_suffixes": [], + "vendored": [ + "third_party/cjson/cJSON.c", + "third_party/cjson/cJSON.h" + ] + } +} diff --git a/tests/snapshots/bare_c.json b/tests/snapshots/bare_c.json new file mode 100644 index 00000000..bee8bf15 --- /dev/null +++ b/tests/snapshots/bare_c.json @@ -0,0 +1,1044 @@ +{ + "answers": { + "action-pinning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "language": "C", + "references": [], + "unit": "." + } + ] + } + ], + "ci-lint": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "language": "C", + "providers": {}, + "unit": "." + } + ] + } + ], + "committed-artifacts": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "committed": [ + "main.o" + ], + "language": "C", + "unit": "." + } + ] + } + ], + "compile-commands": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "CMAKE_EXPORT_COMPILE_COMMANDS ON in a preset", + "Meson, which writes it" + ] + } + ], + "language": "C", + "practice": "compile-commands", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "set(CMAKE_C_EXTENSIONS OFF)", + "-DCMAKE_C_EXTENSIONS=OFF", + "CMAKE_C_EXTENSIONS OFF in a preset", + "C_EXTENSIONS OFF", + "c_std=c17" + ] + } + ], + "language": "C", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "compiler-warnings": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": "gcc", + "found": {}, + "missing": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wconversion" + ] + } + ], + "language": "C", + "practice": "compiler-warnings", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "coverage": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "branch": { + "answer": "no", + "gated": [], + "known": [ + "gcovr --xml", + "lcov --rc branch_coverage=1", + "gcov --branch-counts", + "llvm-cov report" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "language": "C", + "line": { + "answer": "no", + "gated": [], + "known": [ + "gcovr", + "lcov", + "gcov", + "llvm-cov report" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "path": { + "answer": "no", + "gated": [], + "known": [ + "lcov --mcdc-coverage", + "gcov --conditions", + "llvm-cov show -show-mcdc", + "gcc -fcondition-coverage", + "gcc -fpath-coverage", + "clang -fcoverage-mcdc" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "region": { + "answer": "no", + "gated": [], + "known": [ + "llvm-cov report" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "statement": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "unit": ".", + "unknowns": [] + } + ] + } + ], + "dependency-audit": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "dependency-management": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "declared": [], + "language": "C", + "lock_required": false, + "locked": [], + "unit": ".", + "unknowns": [] + } + ] + } + ], + "formatting": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "clang-format": { + "can": { + "apply": "clang-format -i", + "check": "clang-format --dry-run -Werror" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "check", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "function-limits": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "clang-tidy's readability-function-size": { + "can": { + "limits": "clang-tidy with readability-function-size and a LineThreshold in .clang-tidy" + }, + "needs_definition": true, + "required": false + }, + "lizard": { + "can": { + "limits": "lizard --length 30" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "limits", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "fuzz-testing": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "language": "C", + "other_runs": [], + "property_files": [], + "tools": { + "answer": "no", + "defined": {}, + "known": { + "AFL++": { + "can": { + "runs": "afl-fuzz -i -o -- " + }, + "needs_definition": true, + "required": false + }, + "libFuzzer": { + "can": { + "runs": "a fuzz target binary with -max_total_time= (or ClusterFuzzLite or CIFuzz)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + }, + "unit": "." + } + ] + } + ], + "hardening": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": "gcc", + "found": {}, + "missing": [ + "_FORTIFY_SOURCE", + "-fstack-protector-strong", + "-fcf-protection", + "-fstack-clash-protection" + ] + } + ], + "language": "C", + "practice": "hardening", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "license": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "files": {}, + "language": "C", + "mismatches": [], + "unit": "." + } + ] + } + ], + "link-check": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "migration-safety": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "linted", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "mutation-testing": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "Mull": { + "can": { + "runs": "mull-runner" + }, + "needs_definition": false, + "required": false + }, + "dextool mutate": { + "can": { + "runs": "dextool mutate" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "out-of-source-build": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "a check that the source and binary directories differ", + "CMAKE_DISABLE_IN_SOURCE_BUILD", + "CMAKE_DISABLE_SOURCE_CHANGES", + "Meson, which builds out of source" + ] + } + ], + "language": "C", + "practice": "out-of-source-build", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "platforms": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "axis": "compiler", + "language": "C", + "notes": [], + "platforms": [], + "unit": "." + } + ] + } + ], + "sanitizers": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "AddressSanitizer", + "UndefinedBehaviorSanitizer" + ] + } + ], + "language": "C", + "practice": "sanitizers", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "schema-compatibility": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "breaking", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-declared": [], + "schema-examples": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-validation": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "validates", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "secret-scanning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "configured": [], + "language": "C", + "scanners": [], + "unit": "." + } + ] + } + ], + "security-scanning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "CodeQL": { + "can": { + "scans": "CodeQL (github/codeql-action)" + }, + "needs_definition": false, + "required": false + }, + "GitLab SAST": { + "can": { + "scans": "GitLab SAST (Security/SAST.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "semgrep": { + "can": { + "scans": "semgrep ci" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "scans", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "static-analysis": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "clang-tidy": { + "can": { + "checks": "clang-tidy (CMAKE_CXX_CLANG_TIDY, checks chosen in a .clang-tidy)" + }, + "needs_definition": true, + "required": false + }, + "cppcheck": { + "can": { + "checks": "cppcheck (CMAKE_CXX_CPPCHECK)" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "checks", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "tests": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "ctest": { + "can": { + "runs": "ctest" + }, + "needs_definition": true, + "required": false + }, + "meson test": { + "can": { + "runs": "meson test" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "top-level-guard": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "PROJECT_IS_TOP_LEVEL", + "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR", + "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME", + "meson.is_subproject()" + ] + } + ], + "language": "C", + "practice": "top-level-guard", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "type-checking": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checks", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "vcs-ignore": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "language": "C", + "outputs": { + "the build directory": {} + }, + "unit": "." + } + ] + } + ], + "warnings-as-errors": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": "gcc", + "found": {}, + "missing": [ + "-Werror" + ] + } + ], + "language": "C", + "practice": "warnings-as-errors", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "wellformed": [] + }, + "results": { + "action-pinning": { + "details": [], + "message": "no CI configuration with reusable steps", + "status": "SKIP" + }, + "ci-build-types": { + "details": [], + "message": "no CI configuration found", + "status": "FAIL" + }, + "ci-lint": { + "details": [], + "message": "no CI configuration", + "status": "SKIP" + }, + "ci-present": { + "details": [], + "message": "no CI configuration found (looked for GitHub Actions, GitLab CI, Azure Pipelines, AppVeyor, CircleCI, Travis CI, Jenkins, Buildkite, Drone, Cirrus CI, Bitbucket Pipelines, Woodpecker, pre-commit.ci)", + "status": "FAIL" + }, + "code-formatting": { + "details": [ + "consider a CI job that runs clang-format --dry-run -Werror" + ], + "message": "no clang-format configuration found; formatting is not defined", + "status": "FAIL" + }, + "committed-artifacts": { + "details": [ + "main.o", + "remove them from version control (git rm -r --cached ) and ignore them" + ], + "message": "1 build output is committed", + "status": "FAIL" + }, + "compile-commands": { + "details": [ + "set(CMAKE_EXPORT_COMPILE_COMMANDS ON), so clang-tidy, clangd and IDEs can read the build" + ], + "message": "compile_commands.json is not exported", + "status": "WARN" + }, + "compiler-extensions": { + "details": [ + "set(CMAKE_C_EXTENSIONS OFF) (Meson: default_options: ['c_std=c17'])" + ], + "message": "C compiler extensions are never disabled", + "status": "FAIL" + }, + "compiler-warnings": { + "details": [], + "message": "no compiler warning flags found; enable at least -Wall -Wextra -Wpedantic -Wshadow -Wconversion", + "status": "FAIL" + }, + "copy-paste-detection": { + "details": [ + "consider adding jscpd (npx jscpd .), which reads most languages, or PMD CPD, Duplo or Simian" + ], + "message": "no copy-paste detection found in CI configuration", + "status": "WARN" + }, + "coverage": { + "details": [ + "known to measure branch coverage: gcovr --xml, lcov --rc branch_coverage=1, gcov --branch-counts, llvm-cov report" + ], + "message": "no branch coverage measurement found in what CI runs", + "status": "FAIL" + }, + "data-wellformed": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "dependency-audit": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "dependency-management": { + "details": [ + "if the project has dependencies, consider a dependency manager: CPM, FetchContent, Meson wraps, vcpkg or Conan", + "fetch third-party code with the ecosystem's package manager instead of committing a copy of it" + ], + "message": "third-party code is committed (third_party/); no dependencies are declared", + "status": "WARN" + }, + "dependency-updates": { + "details": [ + "consider adding .github/dependabot.yml or a Renovate configuration (renovate.json)" + ], + "message": "no automated dependency updates configured", + "status": "WARN" + }, + "function-limits": { + "details": [ + "consider running in CI: clang-tidy with readability-function-size and a LineThreshold in .clang-tidy or lizard --length 30" + ], + "message": "function length is never limited", + "status": "FAIL" + }, + "fuzz-testing": { + "details": [ + "consider adding a fuzz target binary with -max_total_time= (or ClusterFuzzLite or CIFuzz) or afl-fuzz -i -o -- " + ], + "message": "no fuzz targets found (libFuzzer or AFL++ fuzz targets (LLVMFuzzerTestOneInput, __AFL_LOOP))", + "status": "FAIL" + }, + "hardening": { + "details": [ + "enable -fhardened (GCC 14+) or _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection; for MSVC /sdl, /guard:cf, /DYNAMICBASE, /CETCOMPAT" + ], + "message": "no hardening options found; enable _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection", + "status": "FAIL" + }, + "large-files": { + "details": [], + "message": "no committed file is larger than 5 MiB", + "status": "PASS" + }, + "license": { + "details": [ + "add a LICENSE file with the text of a license (see https://choosealicense.com)" + ], + "message": "no license file", + "status": "FAIL" + }, + "link-check": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "migration-safety": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "mutation-testing": { + "details": [ + "consider running mull-runner or dextool mutate in CI" + ], + "message": "no mutation testing runs", + "status": "WARN" + }, + "out-of-source-build": { + "details": [ + "compare CMAKE_SOURCE_DIR with CMAKE_BINARY_DIR and message(FATAL_ERROR) when they are equal (cmake_template's PreventInSourceBuilds.cmake)" + ], + "message": "in-source builds are not prevented", + "status": "WARN" + }, + "platform-matrix": { + "details": [], + "message": "no CI configuration found", + "status": "FAIL" + }, + "sanitizers": { + "details": [ + "build with -fsanitize=address,undefined (MSVC: /fsanitize=address) in at least one configuration, behind an option CI turns on (Meson: -Db_sanitize=address,undefined)" + ], + "message": "no sanitizers found; enable AddressSanitizer, UndefinedBehaviorSanitizer", + "status": "FAIL" + }, + "schema-compatibility": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-declared": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-examples": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-validation": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "secret-scanning": { + "details": [ + "consider running gitleaks, TruffleHog (trufflesecurity/trufflehog) or detect-secrets in CI or as a pre-commit hook; GitHub's secret scanning and push protection are repository settings, which cannot be seen from here" + ], + "message": "no secret scanning found in CI configuration", + "status": "WARN" + }, + "security-policy": { + "details": [ + "add a SECURITY.md that says how to report a vulnerability privately: an email address, or GitHub's private vulnerability reporting (Settings > Code security, then link to /security/advisories/new)" + ], + "message": "no security policy", + "status": "WARN" + }, + "security-scanning": { + "details": [ + "consider running in CI: CodeQL (github/codeql-action), GitLab SAST (Security/SAST.gitlab-ci.yml) or semgrep ci" + ], + "message": "no code security scanning found in CI configuration", + "status": "WARN" + }, + "static-analysis": { + "details": [ + "consider running clang-tidy (CMAKE_CXX_CLANG_TIDY, checks chosen in a .clang-tidy) or cppcheck (CMAKE_CXX_CPPCHECK) in CI" + ], + "message": "no static analyzer runs", + "status": "FAIL" + }, + "status-badges": { + "details": [ + "add a CI status badge, e.g. ![ci](https://github.com///actions/workflows/ci.yml/badge.svg)", + "add a quality badge: coverage (Codecov, Coveralls) or analysis (SonarCloud, Codacy, OpenSSF Scorecard)" + ], + "message": "no README", + "status": "FAIL" + }, + "tests-run": { + "details": [], + "message": "no tests found (tests registered with CTest (enable_testing(), then add_test or a *_discover_tests call) or tests registered with Meson's test() in meson.build)", + "status": "FAIL" + }, + "top-level-guard": { + "details": [ + "condition the tests and developer-only options on PROJECT_IS_TOP_LEVEL (Meson: meson.is_subproject()), so that the project works as a subproject through FetchContent, CPM or add_subdirectory" + ], + "message": "nothing is guarded for use as a subproject", + "status": "WARN" + }, + "type-checking": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "vcs-ignore": { + "details": [ + "consider adding a .gitignore (or your version control system's equivalent) that ignores build outputs" + ], + "message": "no version control ignore file found (.gitignore, .hgignore, .bzrignore, .fossil-settings/ignore-glob); build outputs can be committed by accident", + "status": "FAIL" + }, + "warnings-as-errors": { + "details": [ + "add -Werror (GCC/Clang), /WX (MSVC) or set CMAKE_COMPILE_WARNING_AS_ERROR (Meson: werror=true), at least as an option" + ], + "message": "warnings are not treated as errors in CI configuration or the build files (CMake files, presets, meson.build)", + "status": "FAIL" + } + } +} diff --git a/tests/snapshots/bare_clojure.json b/tests/snapshots/bare_clojure.json index 05133976..ef2e6070 100644 --- a/tests/snapshots/bare_clojure.json +++ b/tests/snapshots/bare_clojure.json @@ -52,6 +52,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Clojure", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -132,13 +139,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Clojure", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -653,6 +653,11 @@ "message": "not applicable to Clojure", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Clojure", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Clojure lints found; enable at least clj-kondo, *warn-on-reflection*", @@ -672,11 +677,6 @@ "message": "no statement coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Clojure", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Clojure", diff --git a/tests/snapshots/bare_common_lisp.json b/tests/snapshots/bare_common_lisp.json index 7c1c296b..94c403fe 100644 --- a/tests/snapshots/bare_common_lisp.json +++ b/tests/snapshots/bare_common_lisp.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Common Lisp", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -130,13 +137,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Common Lisp", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -600,6 +600,11 @@ "message": "not applicable to Common Lisp", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Common Lisp", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Lisp compiler lints found; enable at least sblint", @@ -619,11 +624,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Common Lisp", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Common Lisp", diff --git a/tests/snapshots/bare_c_cpp.facts.json b/tests/snapshots/bare_cpp.facts.json similarity index 98% rename from tests/snapshots/bare_c_cpp.facts.json rename to tests/snapshots/bare_cpp.facts.json index db196273..5cf12ab0 100644 --- a/tests/snapshots/bare_c_cpp.facts.json +++ b/tests/snapshots/bare_cpp.facts.json @@ -62,7 +62,7 @@ "providers": [] }, "ecosystems": { - "C/C++": [ + "C++": [ "build file CMakeLists.txt" ] }, diff --git a/tests/snapshots/bare_c_cpp.json b/tests/snapshots/bare_cpp.json similarity index 99% rename from tests/snapshots/bare_c_cpp.json rename to tests/snapshots/bare_cpp.json index cf36ef24..5fed2422 100644 --- a/tests/snapshots/bare_c_cpp.json +++ b/tests/snapshots/bare_cpp.json @@ -71,6 +71,34 @@ ] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C++", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "set(CMAKE_CXX_EXTENSIONS OFF)", + "-DCMAKE_CXX_EXTENSIONS=OFF", + "CMAKE_CXX_EXTENSIONS OFF in a preset", + "CXX_EXTENSIONS OFF", + "cpp_std=c++20" + ] + } + ], + "language": "C++", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -171,34 +199,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "C++", - "units": [ - { - "answer": "no", - "compilers": [ - { - "compiler": null, - "found": {}, - "missing": [ - "set(CMAKE_CXX_EXTENSIONS OFF)", - "-DCMAKE_CXX_EXTENSIONS=OFF", - "CMAKE_CXX_EXTENSIONS OFF in a preset", - "CXX_EXTENSIONS OFF", - "cpp_std=c++20" - ] - } - ], - "language": "C++", - "practice": "cxx-extensions", - "unit": ".", - "unknowns": [] - } - ] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -834,6 +834,13 @@ "message": "compile_commands.json is not exported", "status": "WARN" }, + "compiler-extensions": { + "details": [ + "set(CMAKE_CXX_EXTENSIONS OFF) (Meson: default_options: ['cpp_std=c++20'])" + ], + "message": "C++ compiler extensions are never disabled", + "status": "FAIL" + }, "compiler-warnings": { "details": [], "message": "no compiler warning flags found; enable at least -Wall -Wextra -Wpedantic -Wshadow -Wconversion", @@ -853,13 +860,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [ - "set(CMAKE_CXX_EXTENSIONS OFF) (Meson: default_options: ['cpp_std=c++20'])" - ], - "message": "C++ compiler extensions are never disabled", - "status": "FAIL" - }, "data-wellformed": { "details": [], "message": "not applicable to C++", diff --git a/tests/snapshots/bare_dart.json b/tests/snapshots/bare_dart.json index 334c3132..7784b09f 100644 --- a/tests/snapshots/bare_dart.json +++ b/tests/snapshots/bare_dart.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Dart", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -133,13 +140,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Dart", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -682,6 +682,11 @@ "message": "not applicable to Dart", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Dart", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Dart analyzer settings found; enable at least a lint set in analysis_options.yaml, dart analyze", @@ -701,11 +706,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Dart", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_data.json b/tests/snapshots/bare_data.json index b0cddc1e..67bb652d 100644 --- a/tests/snapshots/bare_data.json +++ b/tests/snapshots/bare_data.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -125,6 +125,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -142,11 +147,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [ "YAML: config.yaml:2:1: expected ',' or ']', but got ''" diff --git a/tests/snapshots/bare_docker.json b/tests/snapshots/bare_docker.json index 783c1208..c6c9519e 100644 --- a/tests/snapshots/bare_docker.json +++ b/tests/snapshots/bare_docker.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [ { "auxiliary": {}, @@ -223,6 +223,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -240,11 +245,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [ "Dockerfile:1:1: the first instruction is RUN, not FROM" diff --git a/tests/snapshots/bare_documentation.json b/tests/snapshots/bare_documentation.json index 27cc22a0..319008c9 100644 --- a/tests/snapshots/bare_documentation.json +++ b/tests/snapshots/bare_documentation.json @@ -19,9 +19,9 @@ } ], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -299,6 +299,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -316,11 +321,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_dotnet.json b/tests/snapshots/bare_dotnet.json index 039c0037..20217db3 100644 --- a/tests/snapshots/bare_dotnet.json +++ b/tests/snapshots/bare_dotnet.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C#", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -136,13 +143,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "C#", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -747,6 +747,11 @@ "message": "not applicable to C#", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to C#", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no .NET analyzer settings found; enable at least AnalysisMode Recommended or All, EnforceCodeStyleInBuild, Nullable enable", @@ -766,11 +771,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to C#", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to C#", diff --git a/tests/snapshots/bare_emacs_lisp.json b/tests/snapshots/bare_emacs_lisp.json index 2176778a..e14e2b83 100644 --- a/tests/snapshots/bare_emacs_lisp.json +++ b/tests/snapshots/bare_emacs_lisp.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Emacs Lisp", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -131,13 +138,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Emacs Lisp", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -610,6 +610,11 @@ "message": "not applicable to Emacs Lisp", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Emacs Lisp", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Emacs Lisp lints found; enable at least package-lint, checkdoc", @@ -629,11 +634,6 @@ "message": "no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Emacs Lisp", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Emacs Lisp", diff --git a/tests/snapshots/bare_fortran.json b/tests/snapshots/bare_fortran.json index 1f6b9b8c..c9073b3e 100644 --- a/tests/snapshots/bare_fortran.json +++ b/tests/snapshots/bare_fortran.json @@ -51,6 +51,31 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Fortran", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": "gcc", + "found": {}, + "missing": [ + "-std=f2018", + "fortran_std=f2018" + ] + } + ], + "language": "Fortran", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -142,31 +167,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Fortran", - "units": [ - { - "answer": "no", - "compilers": [ - { - "compiler": "gcc", - "found": {}, - "missing": [ - "-std=f2018", - "fortran_std=f2018" - ] - } - ], - "language": "Fortran", - "practice": "cxx-extensions", - "unit": ".", - "unknowns": [] - } - ] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -705,6 +705,13 @@ "message": "not applicable to Fortran", "status": "SKIP" }, + "compiler-extensions": { + "details": [ + "compile to a standard: -std=f2018 (ifx: -stand f18; Meson: default_options: ['fortran_std=f2018'])" + ], + "message": "Fortran is never compiled to a standard; the compilers' extensions are allowed", + "status": "FAIL" + }, "compiler-warnings": { "details": [], "message": "no Fortran compiler warning flags found; enable at least -Wall -Wextra -Wpedantic -Wimplicit-interface", @@ -724,13 +731,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [ - "compile to a standard: -std=f2018 (ifx: -stand f18; Meson: default_options: ['fortran_std=f2018'])" - ], - "message": "Fortran is never compiled to a standard; the compilers' extensions are allowed", - "status": "FAIL" - }, "data-wellformed": { "details": [], "message": "1 TOML file parses", diff --git a/tests/snapshots/bare_github_action.json b/tests/snapshots/bare_github_action.json index cd126ae2..22c4c40e 100644 --- a/tests/snapshots/bare_github_action.json +++ b/tests/snapshots/bare_github_action.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -183,6 +183,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -200,11 +205,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_go.json b/tests/snapshots/bare_go.json index b2589419..b43a4ec1 100644 --- a/tests/snapshots/bare_go.json +++ b/tests/snapshots/bare_go.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Go", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -133,13 +140,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Go", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -748,6 +748,11 @@ "message": "not applicable to Go", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Go", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Go linters found; enable at least go vet, staticcheck", @@ -767,11 +772,6 @@ "message": "no statement coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Go", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Go", diff --git a/tests/snapshots/bare_graphql.json b/tests/snapshots/bare_graphql.json index fd581800..1dbdb8aa 100644 --- a/tests/snapshots/bare_graphql.json +++ b/tests/snapshots/bare_graphql.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -215,6 +215,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -232,11 +237,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to a project of no recognised language", diff --git a/tests/snapshots/bare_haskell.json b/tests/snapshots/bare_haskell.json index eb0eec28..cce7d3bc 100644 --- a/tests/snapshots/bare_haskell.json +++ b/tests/snapshots/bare_haskell.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Haskell", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -135,13 +142,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Haskell", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -661,6 +661,11 @@ "message": "not applicable to Haskell", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Haskell", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no GHC warning flags found; enable at least -Wall -Wcompat -Widentities -Wredundant-constraints", @@ -680,11 +685,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Haskell", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Haskell", diff --git a/tests/snapshots/bare_javascript.facts.json b/tests/snapshots/bare_javascript.facts.json index 7897c06c..be3306f6 100644 --- a/tests/snapshots/bare_javascript.facts.json +++ b/tests/snapshots/bare_javascript.facts.json @@ -115,7 +115,7 @@ "Data": [ ".json files" ], - "JavaScript/TypeScript": [ + "JavaScript": [ "build file package.json", ".js files" ] diff --git a/tests/snapshots/bare_javascript.json b/tests/snapshots/bare_javascript.json index 114328f3..584d49c9 100644 --- a/tests/snapshots/bare_javascript.json +++ b/tests/snapshots/bare_javascript.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "JavaScript", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -143,13 +150,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -717,26 +717,9 @@ "language": "JavaScript", "units": [ { - "answer": "no", + "answer": "impossible", "defined": {}, - "known": { - "deno check": { - "can": { - "checks": "deno check", - "strict": "deno check (strict by default)" - }, - "needs_definition": false, - "required": false - }, - "tsc": { - "can": { - "checks": "tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json)", - "strict": "\"strict\": true in the compilerOptions of tsconfig.json" - }, - "needs_definition": false, - "required": false - } - }, + "known": {}, "language": "JavaScript", "level": "checks", "runs": {}, @@ -851,6 +834,11 @@ "message": "not applicable to JavaScript", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to JavaScript", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no JavaScript linters found; enable at least eslint", @@ -870,11 +858,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to JavaScript", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 JSON file parses", @@ -1031,11 +1014,9 @@ "status": "SKIP" }, "type-checking": { - "details": [ - "consider running a type checker in CI: tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json) or deno check" - ], - "message": "no type checker runs", - "status": "FAIL" + "details": [], + "message": "not applicable to JavaScript", + "status": "SKIP" }, "vcs-ignore": { "details": [ diff --git a/tests/snapshots/bare_json_schema.json b/tests/snapshots/bare_json_schema.json index 9e2e008d..b5f5d124 100644 --- a/tests/snapshots/bare_json_schema.json +++ b/tests/snapshots/bare_json_schema.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -283,6 +283,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -300,11 +305,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 JSON file parses", diff --git a/tests/snapshots/bare_julia.json b/tests/snapshots/bare_julia.json index 759d101d..203b40ed 100644 --- a/tests/snapshots/bare_julia.json +++ b/tests/snapshots/bare_julia.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Julia", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -130,13 +137,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Julia", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -651,6 +651,11 @@ "message": "not applicable to Julia", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Julia", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Aqua.jl checks found; enable at least Aqua.test_all", @@ -670,11 +675,6 @@ "message": "no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Julia", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 TOML file parses", diff --git a/tests/snapshots/bare_jupyter.json b/tests/snapshots/bare_jupyter.json index 727e113f..bb69a4e2 100644 --- a/tests/snapshots/bare_jupyter.json +++ b/tests/snapshots/bare_jupyter.json @@ -19,9 +19,9 @@ } ], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -215,6 +215,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -232,11 +237,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [ "notebooks/prices.ipynb: not a notebook: no cells" diff --git a/tests/snapshots/bare_jvm.json b/tests/snapshots/bare_jvm.json index b1165a54..d6b51411 100644 --- a/tests/snapshots/bare_jvm.json +++ b/tests/snapshots/bare_jvm.json @@ -52,6 +52,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Java", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -135,13 +142,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Java", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -783,6 +783,11 @@ "message": "not applicable to Java", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Java", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no JVM compiler warnings found; enable at least -Xlint:all", @@ -802,11 +807,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Java", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 XML file parses", diff --git a/tests/snapshots/bare_kubernetes.json b/tests/snapshots/bare_kubernetes.json index 39ba07e7..93480274 100644 --- a/tests/snapshots/bare_kubernetes.json +++ b/tests/snapshots/bare_kubernetes.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -328,6 +328,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -345,11 +350,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_latex.json b/tests/snapshots/bare_latex.json index 9e9f172a..3f6733f1 100644 --- a/tests/snapshots/bare_latex.json +++ b/tests/snapshots/bare_latex.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "LaTeX", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -128,13 +135,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "LaTeX", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -595,6 +595,11 @@ "message": "not applicable to LaTeX", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to LaTeX", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no LaTeX lints found; enable at least chktex", @@ -612,11 +617,6 @@ "message": "not applicable to LaTeX", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to LaTeX", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to LaTeX", diff --git a/tests/snapshots/bare_lua.json b/tests/snapshots/bare_lua.json index 7baffad8..c9c89807 100644 --- a/tests/snapshots/bare_lua.json +++ b/tests/snapshots/bare_lua.json @@ -52,6 +52,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Lua", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -132,13 +139,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Lua", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -635,6 +635,11 @@ "message": "not applicable to Lua", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Lua", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Lua linters found; enable at least luacheck, selene", @@ -654,11 +659,6 @@ "message": "no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Lua", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Lua", diff --git a/tests/snapshots/bare_nix.json b/tests/snapshots/bare_nix.json index 3c5fc005..810711fb 100644 --- a/tests/snapshots/bare_nix.json +++ b/tests/snapshots/bare_nix.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Nix", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -129,13 +136,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Nix", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -633,6 +633,11 @@ "message": "not applicable to Nix", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Nix", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Nix lints found; enable at least statix, deadnix", @@ -650,11 +655,6 @@ "message": "not applicable to Nix", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Nix", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Nix", diff --git a/tests/snapshots/bare_ocaml.json b/tests/snapshots/bare_ocaml.json index 12bb6eab..f65ec2a7 100644 --- a/tests/snapshots/bare_ocaml.json +++ b/tests/snapshots/bare_ocaml.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "OCaml", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -130,13 +137,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "OCaml", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -611,6 +611,11 @@ "message": "not applicable to OCaml", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to OCaml", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no OCaml warning settings found; enable at least dune's dev profile warning set (or -w +a)", @@ -630,11 +635,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to OCaml", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to OCaml", diff --git a/tests/snapshots/bare_openapi.json b/tests/snapshots/bare_openapi.json index ffc4d68d..622987d2 100644 --- a/tests/snapshots/bare_openapi.json +++ b/tests/snapshots/bare_openapi.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -321,6 +321,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -338,11 +343,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 YAML file parses", diff --git a/tests/snapshots/bare_perl.json b/tests/snapshots/bare_perl.json index 4d289a50..0c932aa9 100644 --- a/tests/snapshots/bare_perl.json +++ b/tests/snapshots/bare_perl.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Perl", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -135,13 +142,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Perl", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -653,6 +653,11 @@ "message": "not applicable to Perl", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Perl", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Perl pragmas and lints found; enable at least use strict and use warnings in every module, perlcritic", @@ -672,11 +677,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Perl", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 JSON file parses", diff --git a/tests/snapshots/bare_php.json b/tests/snapshots/bare_php.json index 083cc97c..6bb43506 100644 --- a/tests/snapshots/bare_php.json +++ b/tests/snapshots/bare_php.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "PHP", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -134,13 +141,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "PHP", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -789,6 +789,11 @@ "message": "not applicable to PHP", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to PHP", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no PHP error reporting settings found; enable at least error_reporting = E_ALL", @@ -808,11 +813,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to PHP", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 JSON file parses", diff --git a/tests/snapshots/bare_protobuf.json b/tests/snapshots/bare_protobuf.json index a8902e06..cd998b76 100644 --- a/tests/snapshots/bare_protobuf.json +++ b/tests/snapshots/bare_protobuf.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -220,6 +220,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -237,11 +242,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to a project of no recognised language", diff --git a/tests/snapshots/bare_python.json b/tests/snapshots/bare_python.json index 0271c820..909333c9 100644 --- a/tests/snapshots/bare_python.json +++ b/tests/snapshots/bare_python.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Python", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -134,13 +141,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Python", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -806,6 +806,11 @@ "message": "not applicable to Python", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Python", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Python warning settings found; enable at least -W error", @@ -825,11 +830,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Python", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 TOML file parses", diff --git a/tests/snapshots/bare_r.json b/tests/snapshots/bare_r.json index 9ea2f8f1..a49841be 100644 --- a/tests/snapshots/bare_r.json +++ b/tests/snapshots/bare_r.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "R", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -131,13 +138,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "R", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -634,6 +634,11 @@ "message": "not applicable to R", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to R", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no R lints found; enable at least lintr, failing on lints (LINTR_ERROR_ON_LINT)", @@ -653,11 +658,6 @@ "message": "no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to R", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to R", diff --git a/tests/snapshots/bare_racket.json b/tests/snapshots/bare_racket.json index b10644fc..717da1a0 100644 --- a/tests/snapshots/bare_racket.json +++ b/tests/snapshots/bare_racket.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Racket", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -113,13 +120,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Racket", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -567,6 +567,11 @@ "message": "not applicable to Racket", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Racket", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Racket", @@ -586,11 +591,6 @@ "message": "no statement coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Racket", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Racket", diff --git a/tests/snapshots/bare_ruby.json b/tests/snapshots/bare_ruby.json index 7ee7d2fd..90b164a0 100644 --- a/tests/snapshots/bare_ruby.json +++ b/tests/snapshots/bare_ruby.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Ruby", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -133,13 +140,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Ruby", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -744,6 +744,11 @@ "message": "not applicable to Ruby", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Ruby", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Ruby warning settings found; enable at least Ruby warnings, RuboCop or Standard", @@ -763,11 +768,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Ruby", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Ruby", diff --git a/tests/snapshots/bare_rust.json b/tests/snapshots/bare_rust.json index 74869178..7fc6eaa3 100644 --- a/tests/snapshots/bare_rust.json +++ b/tests/snapshots/bare_rust.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Rust", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -143,13 +150,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Rust", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -779,6 +779,11 @@ "message": "not applicable to Rust", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Rust", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Rust lint settings found; enable at least cargo clippy -D warnings clippy::pedantic", @@ -798,11 +803,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Rust", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 TOML file parses", diff --git a/tests/snapshots/bare_scala.json b/tests/snapshots/bare_scala.json index 0a6f7e5d..564169c7 100644 --- a/tests/snapshots/bare_scala.json +++ b/tests/snapshots/bare_scala.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Scala", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -137,13 +144,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Scala", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -677,6 +677,11 @@ "message": "not applicable to Scala", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Scala", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no scalac warning options found; enable at least -deprecation, -feature, -Xlint or -Wunused", @@ -696,11 +701,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Scala", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Scala", diff --git a/tests/snapshots/bare_shell.json b/tests/snapshots/bare_shell.json index 61252150..095f0ea4 100644 --- a/tests/snapshots/bare_shell.json +++ b/tests/snapshots/bare_shell.json @@ -90,6 +90,18 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "PowerShell", + "units": [] + }, + { + "auxiliary": {}, + "language": "Shell", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -244,18 +256,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "PowerShell", - "units": [] - }, - { - "auxiliary": {}, - "language": "Shell", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1097,6 +1097,11 @@ "message": "not applicable to PowerShell, Shell", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to PowerShell, Shell", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "PowerShell: no PowerShell lints found; enable at least PSScriptAnalyzer; Shell: no shell lints found; enable at least shellcheck", @@ -1117,11 +1122,6 @@ "message": "PowerShell: no statement coverage measurement found in what CI runs; Shell: no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to PowerShell, Shell", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to PowerShell, Shell", diff --git a/tests/snapshots/bare_sql.json b/tests/snapshots/bare_sql.json index b051716f..74465776 100644 --- a/tests/snapshots/bare_sql.json +++ b/tests/snapshots/bare_sql.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "SQL", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -111,13 +118,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "SQL", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -701,6 +701,11 @@ "message": "not applicable to SQL", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to SQL", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to SQL", @@ -718,11 +723,6 @@ "message": "not applicable to SQL", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to SQL", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 1 JSON file parses; YAML: 2 YAML files parse", diff --git a/tests/snapshots/bare_swift.json b/tests/snapshots/bare_swift.json index ee4da54e..258ef060 100644 --- a/tests/snapshots/bare_swift.json +++ b/tests/snapshots/bare_swift.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Swift", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -135,13 +142,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Swift", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -752,6 +752,11 @@ "message": "not applicable to Swift", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Swift", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "no Swift warning settings found; enable at least SwiftLint, complete concurrency checking", @@ -771,11 +776,6 @@ "message": "no region coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Swift", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Swift", diff --git a/tests/snapshots/bare_tabular_data.json b/tests/snapshots/bare_tabular_data.json index cac1760d..a22f25d6 100644 --- a/tests/snapshots/bare_tabular_data.json +++ b/tests/snapshots/bare_tabular_data.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -165,6 +165,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -182,11 +187,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "1 JSON file parses", diff --git a/tests/snapshots/bare_terraform.json b/tests/snapshots/bare_terraform.json index d7c528ad..13d008ca 100644 --- a/tests/snapshots/bare_terraform.json +++ b/tests/snapshots/bare_terraform.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Terraform", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -111,13 +118,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Terraform", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -658,6 +658,11 @@ "message": "not applicable to Terraform", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Terraform", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Terraform", @@ -675,11 +680,6 @@ "message": "not applicable to Terraform", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Terraform", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Terraform", diff --git a/tests/snapshots/bare_typescript.facts.json b/tests/snapshots/bare_typescript.facts.json new file mode 100644 index 00000000..9ac6952a --- /dev/null +++ b/tests/snapshots/bare_typescript.facts.json @@ -0,0 +1,150 @@ +{ + "facts": [ + { + "kind": "AuxiliaryCode", + "named": [], + "origin": "." + }, + { + "build_system": "npm", + "kind": "BuildFile", + "languages": [ + "JavaScript" + ], + "origin": "package.json" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "JSON", + "origin": "package.json", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "TypeScript", + "origin": "src/index.ts", + "role": "product" + }, + { + "files": 1, + "kind": "UnrecognisedSuffix", + "origin": ".", + "suffix": ".info" + }, + { + "build_systems": [ + "npm" + ], + "formats": [ + "JSON" + ], + "kind": "Unit", + "languages": [ + "TypeScript" + ], + "origin": ".", + "role": "product" + }, + { + "column": null, + "format": "JSON", + "kind": "DataFile", + "line": null, + "origin": "package.json", + "problem": null, + "role": "product", + "unread": null + }, + { + "kind": "CommittedOutput", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "coverage/", + "output": "node_modules" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "graphql-eslint" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json prettier" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "Jest" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json dependencies" + }, + { + "kind": "Declared", + "manager": "npm packages", + "origin": "package.json" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json license" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "eslint rules" + } + ], + "map": { + "build_systems": [ + "npm" + ], + "ci": { + "files": [], + "jobs": [], + "providers": [] + }, + "ecosystems": { + "Data": [ + ".json files" + ], + "TypeScript": [ + ".ts files" + ] + }, + "formats": [ + "JSON" + ], + "languages": [ + "TypeScript" + ], + "units": [ + { + "build_systems": [ + "npm" + ], + "directory": ".", + "formats": [ + "JSON" + ], + "languages": [ + "TypeScript" + ], + "role": "product" + } + ], + "unrecognised_suffixes": [ + { + "files": 1, + "suffix": ".info" + } + ] + } +} diff --git a/tests/snapshots/bare_typescript.json b/tests/snapshots/bare_typescript.json new file mode 100644 index 00000000..075034cb --- /dev/null +++ b/tests/snapshots/bare_typescript.json @@ -0,0 +1,1055 @@ +{ + "answers": { + "action-pinning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "language": "TypeScript", + "references": [], + "unit": "." + } + ] + } + ], + "ci-lint": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "language": "TypeScript", + "providers": {}, + "unit": "." + } + ] + } + ], + "committed-artifacts": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "committed": [ + "coverage/" + ], + "language": "TypeScript", + "unit": "." + } + ] + } + ], + "compile-commands": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "compiler-warnings": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "eslint" + ] + } + ], + "language": "TypeScript", + "practice": "compiler-warnings", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "coverage": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "branch": { + "answer": "no", + "gated": [], + "known": [ + "c8", + "nyc", + "jest --coverage", + "vitest --coverage", + "deno test --coverage", + "node --test --experimental-test-coverage" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "language": "TypeScript", + "line": { + "answer": "no", + "gated": [], + "known": [ + "c8", + "nyc", + "jest --coverage", + "vitest --coverage", + "deno test --coverage", + "node --test --experimental-test-coverage", + "bun test --coverage" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "path": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "region": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "statement": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "unit": ".", + "unknowns": [] + } + ] + } + ], + "dependency-audit": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "GitLab Dependency Scanning": { + "can": { + "runs": "GitLab Dependency Scanning (Security/Dependency-Scanning.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "bun audit": { + "can": { + "runs": "bun audit" + }, + "needs_definition": false, + "required": false + }, + "npm audit": { + "can": { + "runs": "npm audit" + }, + "needs_definition": false, + "required": false + }, + "osv-scanner": { + "can": { + "runs": "osv-scanner" + }, + "needs_definition": false, + "required": false + }, + "pnpm audit": { + "can": { + "runs": "pnpm audit" + }, + "needs_definition": false, + "required": false + }, + "snyk": { + "can": { + "runs": "snyk test" + }, + "needs_definition": false, + "required": false + }, + "trivy": { + "can": { + "runs": "trivy fs" + }, + "needs_definition": false, + "required": false + }, + "yarn audit": { + "can": { + "runs": "yarn audit" + }, + "needs_definition": false, + "required": false + }, + "yarn npm audit": { + "can": { + "runs": "yarn npm audit" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "dependency-management": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "declared": [ + { + "manager": "npm packages", + "manifest": "package.json" + } + ], + "language": "TypeScript", + "lock_required": true, + "locked": [], + "unit": ".", + "unknowns": [] + } + ] + } + ], + "formatting": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "biome": { + "can": { + "apply": "biome format --write", + "check": "biome ci" + }, + "needs_definition": false, + "required": false + }, + "deno fmt": { + "can": { + "apply": "deno fmt", + "check": "deno fmt --check" + }, + "needs_definition": false, + "required": false + }, + "dprint": { + "can": { + "apply": "dprint fmt", + "check": "dprint check" + }, + "needs_definition": false, + "required": false + }, + "oxfmt": { + "can": { + "apply": "oxfmt", + "check": "oxfmt --check" + }, + "needs_definition": false, + "required": false + }, + "prettier": { + "can": { + "apply": "prettier --write .", + "check": "prettier --check ." + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "check", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "function-limits": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "eslint's max-lines-per-function": { + "can": { + "limits": "eslint with max-lines-per-function on" + }, + "needs_definition": true, + "required": false + }, + "lizard": { + "can": { + "limits": "lizard --length 30" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "limits", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "fuzz-testing": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "language": "TypeScript", + "other_runs": [], + "property_files": [], + "tools": { + "answer": "no", + "defined": {}, + "known": { + "Jazzer.js": { + "can": { + "runs": "npx jazzer -- -max_total_time=30 (or jest with JAZZER_FUZZ=1)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + }, + "unit": "." + } + ] + } + ], + "hardening": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "license": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "files": {}, + "language": "TypeScript", + "mismatches": [], + "unit": "." + } + ] + } + ], + "link-check": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "migration-safety": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "linted", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "mutation-testing": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "StrykerJS": { + "can": { + "incremental": "stryker run --incremental", + "runs": "stryker run" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "out-of-source-build": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "platforms": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "axis": "runtime version", + "language": "TypeScript", + "notes": [], + "platforms": [], + "unit": "." + } + ] + } + ], + "sanitizers": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "schema-compatibility": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "breaking", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-declared": [], + "schema-examples": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-validation": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "validates", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "secret-scanning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "configured": [], + "language": "TypeScript", + "scanners": [], + "unit": "." + } + ] + } + ], + "security-scanning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "CodeQL": { + "can": { + "scans": "CodeQL (github/codeql-action)" + }, + "needs_definition": false, + "required": false + }, + "GitLab SAST": { + "can": { + "scans": "GitLab SAST (Security/SAST.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "eslint-plugin-security": { + "can": { + "scans": "eslint with eslint-plugin-security" + }, + "needs_definition": false, + "required": false + }, + "semgrep": { + "can": { + "scans": "semgrep ci" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "scans", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "static-analysis": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "biome": { + "can": { + "checks": "biome lint" + }, + "needs_definition": false, + "required": false + }, + "deno lint": { + "can": { + "checks": "deno lint" + }, + "needs_definition": false, + "required": false + }, + "eslint": { + "can": { + "checks": "eslint" + }, + "needs_definition": false, + "required": false + }, + "oxlint": { + "can": { + "checks": "oxlint" + }, + "needs_definition": false, + "required": false + }, + "xo": { + "can": { + "checks": "xo" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "checks", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "tests": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "a JavaScript test runner": { + "can": { + "runs": "jest, vitest, mocha, node --test, deno test, bun test or playwright (or npm test)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "top-level-guard": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "type-checking": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "defined": {}, + "known": { + "deno check": { + "can": { + "checks": "deno check", + "strict": "deno check (strict by default)" + }, + "needs_definition": false, + "required": false + }, + "tsc": { + "can": { + "checks": "tsc --noEmit", + "strict": "\"strict\": true in the compilerOptions of tsconfig.json" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "checks", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "vcs-ignore": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "language": "TypeScript", + "outputs": { + "node_modules": {} + }, + "unit": "." + } + ] + } + ], + "warnings-as-errors": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "eslint --max-warnings 0", + "biome ci", + "deno lint" + ] + } + ], + "language": "TypeScript", + "practice": "warnings-as-errors", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "wellformed": [ + { + "auxiliary": {}, + "language": "JSON", + "units": [ + { + "answer": "yes", + "language": "JSON", + "parsed": [ + "package.json" + ], + "problems": [], + "test_data": [], + "test_problems": [], + "unit": ".", + "unread": {} + } + ] + } + ] + }, + "results": { + "action-pinning": { + "details": [], + "message": "no CI configuration with reusable steps", + "status": "SKIP" + }, + "ci-build-types": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "ci-lint": { + "details": [], + "message": "no CI configuration", + "status": "SKIP" + }, + "ci-present": { + "details": [], + "message": "no CI configuration found (looked for GitHub Actions, GitLab CI, Azure Pipelines, AppVeyor, CircleCI, Travis CI, Jenkins, Buildkite, Drone, Cirrus CI, Bitbucket Pipelines, Woodpecker, pre-commit.ci)", + "status": "FAIL" + }, + "code-formatting": { + "details": [ + "consider a CI job that runs prettier --check . (or deno fmt --check, oxfmt --check, dprint check or biome ci)" + ], + "message": "CI never runs prettier, deno fmt, oxfmt, dprint or biome; its formatting is not enforced", + "status": "FAIL" + }, + "committed-artifacts": { + "details": [ + "coverage/", + "remove them from version control (git rm -r --cached ) and ignore them" + ], + "message": "1 build output is committed", + "status": "FAIL" + }, + "compile-commands": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "compiler-extensions": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "compiler-warnings": { + "details": [], + "message": "no JavaScript linters found; enable at least eslint", + "status": "FAIL" + }, + "copy-paste-detection": { + "details": [ + "consider adding jscpd (npx jscpd .), which reads most languages, or PMD CPD, Duplo or Simian" + ], + "message": "no copy-paste detection found in CI configuration", + "status": "WARN" + }, + "coverage": { + "details": [ + "known to measure branch coverage: c8, nyc, jest --coverage, vitest --coverage, deno test --coverage, node --test --experimental-test-coverage" + ], + "message": "no branch coverage measurement found in what CI runs", + "status": "FAIL" + }, + "data-wellformed": { + "details": [], + "message": "1 JSON file parses", + "status": "PASS" + }, + "dependency-audit": { + "details": [ + "consider running in CI: npm audit, pnpm audit, yarn npm audit, bun audit, yarn audit, GitLab Dependency Scanning (Security/Dependency-Scanning.gitlab-ci.yml), osv-scanner, trivy fs or snyk test" + ], + "message": "no dependency vulnerability audit found in CI configuration", + "status": "WARN" + }, + "dependency-management": { + "details": [ + "commit the package manager's lockfile (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock or deno.lock) and install from it in CI (npm ci, pnpm install --frozen-lockfile, yarn install --immutable)" + ], + "message": "dependencies are declared in package.json (npm packages) but not locked", + "status": "WARN" + }, + "dependency-updates": { + "details": [ + "consider adding .github/dependabot.yml or a Renovate configuration (renovate.json)" + ], + "message": "no automated dependency updates configured", + "status": "WARN" + }, + "function-limits": { + "details": [ + "consider running in CI: eslint with max-lines-per-function on or lizard --length 30" + ], + "message": "function length is never limited", + "status": "FAIL" + }, + "fuzz-testing": { + "details": [ + "consider adding npx jazzer -- -max_total_time=30 (or jest with JAZZER_FUZZ=1)" + ], + "message": "no fuzz targets found (Jazzer.js fuzz targets (an exported fuzz function or .fuzz()))", + "status": "FAIL" + }, + "hardening": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "large-files": { + "details": [], + "message": "no committed file is larger than 5 MiB", + "status": "PASS" + }, + "license": { + "details": [ + "add a LICENSE file with the text of a license (see https://choosealicense.com)" + ], + "message": "no license file", + "status": "FAIL" + }, + "link-check": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "migration-safety": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "mutation-testing": { + "details": [ + "consider running stryker run in CI" + ], + "message": "no mutation testing runs", + "status": "WARN" + }, + "out-of-source-build": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "platform-matrix": { + "details": [], + "message": "no CI configuration found", + "status": "FAIL" + }, + "sanitizers": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-compatibility": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-declared": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-examples": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-validation": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "secret-scanning": { + "details": [ + "consider running gitleaks, TruffleHog (trufflesecurity/trufflehog) or detect-secrets in CI or as a pre-commit hook; GitHub's secret scanning and push protection are repository settings, which cannot be seen from here" + ], + "message": "no secret scanning found in CI configuration", + "status": "WARN" + }, + "security-policy": { + "details": [ + "add a SECURITY.md that says how to report a vulnerability privately: an email address, or GitHub's private vulnerability reporting (Settings > Code security, then link to /security/advisories/new)" + ], + "message": "no security policy", + "status": "WARN" + }, + "security-scanning": { + "details": [ + "consider running in CI: eslint with eslint-plugin-security, CodeQL (github/codeql-action), GitLab SAST (Security/SAST.gitlab-ci.yml) or semgrep ci" + ], + "message": "no code security scanning found in CI configuration", + "status": "WARN" + }, + "static-analysis": { + "details": [ + "consider running eslint, xo, oxlint, deno lint or biome lint in CI" + ], + "message": "no static analyzer runs", + "status": "FAIL" + }, + "status-badges": { + "details": [ + "add a CI status badge, e.g. ![ci](https://github.com///actions/workflows/ci.yml/badge.svg)", + "add a quality badge: coverage (Codecov, Coveralls) or analysis (SonarCloud, Codacy, OpenSSF Scorecard)" + ], + "message": "no README", + "status": "FAIL" + }, + "tests-run": { + "details": [], + "message": "no tests found (*.test.*, *.spec.*, __tests__/ or test/ files)", + "status": "FAIL" + }, + "top-level-guard": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "type-checking": { + "details": [ + "consider running a type checker in CI: tsc --noEmit or deno check" + ], + "message": "no type checker runs", + "status": "FAIL" + }, + "vcs-ignore": { + "details": [ + "consider adding a .gitignore (or your version control system's equivalent) that ignores build outputs" + ], + "message": "no version control ignore file found (.gitignore, .hgignore, .bzrignore, .fossil-settings/ignore-glob); build outputs can be committed by accident", + "status": "FAIL" + }, + "warnings-as-errors": { + "details": [ + "run eslint with --max-warnings 0 (or biome ci, or deno lint), so that a lint warning fails CI" + ], + "message": "warnings are not treated as errors in CI configuration or the package scripts it runs", + "status": "FAIL" + } + } +} diff --git a/tests/snapshots/bare_typst.json b/tests/snapshots/bare_typst.json index e0e94367..2f30820b 100644 --- a/tests/snapshots/bare_typst.json +++ b/tests/snapshots/bare_typst.json @@ -49,6 +49,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Typst", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -109,13 +116,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Typst", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -572,6 +572,11 @@ "message": "not applicable to Typst", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Typst", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Typst", @@ -589,11 +594,6 @@ "message": "not applicable to Typst", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Typst", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Typst", diff --git a/tests/snapshots/bare_xml_schemas.json b/tests/snapshots/bare_xml_schemas.json index fbcb5bf7..89fc08d2 100644 --- a/tests/snapshots/bare_xml_schemas.json +++ b/tests/snapshots/bare_xml_schemas.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -295,6 +295,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -312,11 +317,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "2 XML files parse", diff --git a/tests/snapshots/bare_zig.json b/tests/snapshots/bare_zig.json index d578f8b5..615c1711 100644 --- a/tests/snapshots/bare_zig.json +++ b/tests/snapshots/bare_zig.json @@ -51,6 +51,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Zig", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -113,13 +120,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Zig", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -602,6 +602,11 @@ "message": "not applicable to Zig", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Zig", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Zig", @@ -621,11 +626,6 @@ "message": "no line coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Zig", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "not applicable to Zig", diff --git a/tests/snapshots/buildable.facts.json b/tests/snapshots/buildable.facts.json index 6c309a01..1b75eacd 100644 --- a/tests/snapshots/buildable.facts.json +++ b/tests/snapshots/buildable.facts.json @@ -75,7 +75,7 @@ "providers": [] }, "ecosystems": { - "C/C++": [ + "C": [ "build file CMakeLists.txt" ] }, diff --git a/tests/snapshots/buildable.json b/tests/snapshots/buildable.json index c705de05..838a04f4 100644 --- a/tests/snapshots/buildable.json +++ b/tests/snapshots/buildable.json @@ -69,6 +69,34 @@ ] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "no", + "compilers": [ + { + "compiler": null, + "found": {}, + "missing": [ + "set(CMAKE_C_EXTENSIONS OFF)", + "-DCMAKE_C_EXTENSIONS=OFF", + "CMAKE_C_EXTENSIONS OFF in a preset", + "C_EXTENSIONS OFF", + "c_std=c17" + ] + } + ], + "language": "C", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -169,34 +197,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "C", - "units": [ - { - "answer": "no", - "compilers": [ - { - "compiler": null, - "found": {}, - "missing": [ - "set(CMAKE_C_EXTENSIONS OFF)", - "-DCMAKE_C_EXTENSIONS=OFF", - "CMAKE_C_EXTENSIONS OFF in a preset", - "C_EXTENSIONS OFF", - "c_std=c17" - ] - } - ], - "language": "C", - "practice": "cxx-extensions", - "unit": ".", - "unknowns": [] - } - ] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -351,8 +351,7 @@ "_FORTIFY_SOURCE", "-fstack-protector-strong", "-fcf-protection", - "-fstack-clash-protection", - "_GLIBCXX_ASSERTIONS or _LIBCPP_HARDENING_MODE" + "-fstack-clash-protection" ] } ], @@ -833,6 +832,13 @@ "message": "compile_commands.json is not exported", "status": "WARN" }, + "compiler-extensions": { + "details": [ + "set(CMAKE_C_EXTENSIONS OFF) (Meson: default_options: ['c_std=c17'])" + ], + "message": "C compiler extensions are never disabled", + "status": "FAIL" + }, "compiler-warnings": { "details": [], "message": "no compiler warning flags found; enable at least -Wall -Wextra -Wpedantic -Wshadow -Wconversion", @@ -852,13 +858,6 @@ "message": "no branch coverage measurement found in what CI runs", "status": "FAIL" }, - "cxx-extensions": { - "details": [ - "set(CMAKE_C_EXTENSIONS OFF) (Meson: default_options: ['c_std=c17'])" - ], - "message": "C compiler extensions are never disabled", - "status": "FAIL" - }, "data-wellformed": { "details": [], "message": "not applicable to C", @@ -899,9 +898,9 @@ }, "hardening": { "details": [ - "enable -fhardened (GCC 14+) or _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection, _GLIBCXX_ASSERTIONS or _LIBCPP_HARDENING_MODE; for MSVC /sdl, /guard:cf, /DYNAMICBASE, /CETCOMPAT" + "enable -fhardened (GCC 14+) or _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection; for MSVC /sdl, /guard:cf, /DYNAMICBASE, /CETCOMPAT" ], - "message": "no hardening options found; enable _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection, _GLIBCXX_ASSERTIONS or _LIBCPP_HARDENING_MODE", + "message": "no hardening options found; enable _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection", "status": "FAIL" }, "large-files": { diff --git a/tests/snapshots/registry.json b/tests/snapshots/registry.json index e6416ce4..6462c481 100644 --- a/tests/snapshots/registry.json +++ b/tests/snapshots/registry.json @@ -28,6 +28,12 @@ "aliases": [], "description": "compile_commands.json is exported (CMAKE_EXPORT_COMPILE_COMMANDS; Meson always writes it)" }, + "compiler-extensions": { + "aliases": [ + "cxx-extensions" + ], + "description": "Compiler extensions are disabled (-std=c++NN or -std=cNN rather than -std=gnu++NN or -std=gnuNN)" + }, "compiler-warnings": { "aliases": [], "description": "A strict compiler warning (or lint) set is enabled" @@ -40,10 +46,6 @@ "aliases": [], "description": "CI measures branch coverage (or the finest the language's tools measure), reports it where it can be seen and fails under a threshold; path coverage is a bonus" }, - "cxx-extensions": { - "aliases": [], - "description": "Compiler extensions are disabled (-std=c++NN rather than -std=gnu++NN)" - }, "data-wellformed": { "aliases": [], "description": "Every data file is well formed: it parses in its format (JSON, TOML, YAML and XML are built in)" @@ -102,7 +104,7 @@ }, "sanitizers": { "aliases": [], - "description": "Sanitizers are used in some configuration: AddressSanitizer and UndefinedBehaviorSanitizer for C/C++ (one of the two warns), cargo miri test or -Zsanitizer for Rust, go test -race for Go" + "description": "Sanitizers are used in some configuration: AddressSanitizer and UndefinedBehaviorSanitizer for C and C++ (one of the two warns), cargo miri test or -Zsanitizer for Rust, go test -race for Go" }, "schema-compatibility": { "aliases": [], @@ -144,7 +146,7 @@ "aliases": [ "ctest-runs" ], - "description": "Tests exist (registered with CTest or Meson for C/C++) and CI runs them" + "description": "Tests exist (registered with CTest or Meson for C and C++) and CI runs them" }, "top-level-guard": { "aliases": [], @@ -2882,7 +2884,6 @@ } }, "languages": [ - "JavaScript", "TypeScript" ], "name": "deno check", @@ -6685,12 +6686,11 @@ { "can": { "type-check": { - "checks": "tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json)", + "checks": "tsc --noEmit", "strict": "\"strict\": true in the compilerOptions of tsconfig.json" } }, "languages": [ - "JavaScript", "TypeScript" ], "name": "tsc", diff --git a/tests/snapshots/well_configured_ansible.json b/tests/snapshots/well_configured_ansible.json index 7a73b303..f00bd40d 100644 --- a/tests/snapshots/well_configured_ansible.json +++ b/tests/snapshots/well_configured_ansible.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -275,6 +275,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -290,11 +295,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "13 YAML files parse", diff --git a/tests/snapshots/well_configured_beam.json b/tests/snapshots/well_configured_beam.json index 78f91ffb..b294543d 100644 --- a/tests/snapshots/well_configured_beam.json +++ b/tests/snapshots/well_configured_beam.json @@ -158,6 +158,18 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Elixir", + "units": [] + }, + { + "auxiliary": {}, + "language": "Erlang", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -330,18 +342,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Elixir", - "units": [] - }, - { - "auxiliary": {}, - "language": "Erlang", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1494,6 +1494,11 @@ "message": "not applicable to Elixir, Erlang", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Elixir, Erlang", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "Elixir: strict Elixir linters are enabled: mix credo --strict; Erlang: strict Erlang warnings are enabled: warn_* erl_opts, elvis", @@ -1511,11 +1516,6 @@ "message": "line coverage is reported with mix test --cover", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Elixir, Erlang", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_c.facts.json b/tests/snapshots/well_configured_c.facts.json new file mode 100644 index 00000000..7dc3006f --- /dev/null +++ b/tests/snapshots/well_configured_c.facts.json @@ -0,0 +1,8021 @@ +{ + "facts": [ + { + "kind": "AuxiliaryCode", + "named": [], + "origin": "." + }, + { + "build_system": "CMake", + "kind": "BuildFile", + "languages": [ + "C" + ], + "origin": "CMakeLists.txt" + }, + { + "build_system": "CMake", + "kind": "BuildFile", + "languages": [], + "origin": "fuzz_test/CMakeLists.txt" + }, + { + "build_system": "CMake", + "kind": "BuildFile", + "languages": [], + "origin": "test/CMakeLists.txt" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/dependabot.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/ci-lint.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/ci.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/codeql-analysis.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/copy-paste-detection.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "C", + "origin": "fuzz_test/fuzz_tester.c", + "role": "test" + }, + { + "ambiguous": true, + "kind": "SourceFile", + "language": null, + "origin": "cmake/Dependencies.cmake", + "role": "product" + }, + { + "build_systems": [ + "CMake" + ], + "formats": [ + "YAML" + ], + "kind": "Unit", + "languages": [ + "C" + ], + "origin": ".", + "role": "product" + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/dependabot.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/ci-lint.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/ci.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/codeql-analysis.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/copy-paste-detection.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "kind": "libFuzzer or AFL++ fuzz targets (LLVMFuzzerTestOneInput, __AFL_LOOP)", + "language": "C", + "origin": "fuzz_test/fuzz_tester.c" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/ci-lint.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/ci.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/codeql-analysis.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/copy-paste-detection.yml", + "provider": "GitHub Actions" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci-lint.yml:ci-lint", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "ci-lint", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "ActionStep", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "pipx", + "run", + "zizmor", + ".github" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "pipx run zizmor .github", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run", + "via": [] + }, + { + "argv": [ + "zizmor", + ".github" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "pipx run zizmor .github", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run", + "via": [ + ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run" + ] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "ActionStep", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[2]", + "uses": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "argv": [ + "actionlint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[2]", + "via": [] + }, + { + "argv": [ + "gitleaks", + "git", + "--redact", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "gitleaks git --redact .", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[3].run", + "via": [] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci-lint.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci-lint.yml", + "reference": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[0]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "gcc", + "os": "ubuntu-latest", + "sanitizers": "ON" + }, + "name": "test (ubuntu-latest, gcc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[1]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "gcc", + "os": "ubuntu-latest", + "sanitizers": "OFF" + }, + "name": "test (ubuntu-latest, gcc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[2]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "gcc", + "os": "ubuntu-latest", + "sanitizers": "ON" + }, + "name": "test (ubuntu-latest, gcc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[3]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "gcc", + "os": "ubuntu-latest", + "sanitizers": "OFF" + }, + "name": "test (ubuntu-latest, gcc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[4]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "clang", + "os": "ubuntu-latest", + "sanitizers": "ON" + }, + "name": "test (ubuntu-latest, clang, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[5]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "clang", + "os": "ubuntu-latest", + "sanitizers": "OFF" + }, + "name": "test (ubuntu-latest, clang, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[6]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "clang", + "os": "ubuntu-latest", + "sanitizers": "ON" + }, + "name": "test (ubuntu-latest, clang, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[7]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "clang", + "os": "ubuntu-latest", + "sanitizers": "OFF" + }, + "name": "test (ubuntu-latest, clang, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[8]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "gcc", + "os": "macos-latest", + "sanitizers": "ON" + }, + "name": "test (macos-latest, gcc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[9]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "gcc", + "os": "macos-latest", + "sanitizers": "OFF" + }, + "name": "test (macos-latest, gcc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[10]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "gcc", + "os": "macos-latest", + "sanitizers": "ON" + }, + "name": "test (macos-latest, gcc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[11]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "gcc", + "os": "macos-latest", + "sanitizers": "OFF" + }, + "name": "test (macos-latest, gcc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=gcc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=gcc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[12]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "clang", + "os": "macos-latest", + "sanitizers": "ON" + }, + "name": "test (macos-latest, clang, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[13]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "clang", + "os": "macos-latest", + "sanitizers": "OFF" + }, + "name": "test (macos-latest, clang, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[14]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "clang", + "os": "macos-latest", + "sanitizers": "ON" + }, + "name": "test (macos-latest, clang, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[15]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "clang", + "os": "macos-latest", + "sanitizers": "OFF" + }, + "name": "test (macos-latest, clang, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=clang", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=clang -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[16]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "msvc", + "os": "windows-latest", + "sanitizers": "ON" + }, + "name": "test (windows-latest, msvc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=msvc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=msvc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[17]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Release", + "compiler": "msvc", + "os": "windows-latest", + "sanitizers": "OFF" + }, + "name": "test (windows-latest, msvc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=msvc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Release", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=msvc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[18]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "msvc", + "os": "windows-latest", + "sanitizers": "ON" + }, + "name": "test (windows-latest, msvc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=msvc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=ON" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=msvc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[19]", + "image": null, + "kind": "CiJob", + "matrix": { + "build_type": "Debug", + "compiler": "msvc", + "os": "windows-latest", + "sanitizers": "OFF" + }, + "name": "test (windows-latest, msvc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build", + "-DCMAKE_C_COMPILER=msvc", + "-DENABLE_COVERAGE=ON", + "-DCMAKE_BUILD_TYPE=Debug", + "-DENABLE_SANITIZERS=OFF" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "cmake -S . -B build -DCMAKE_C_COMPILER=msvc -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=OFF", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "cmake --build build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "mull-runner", + "build/tests" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "mull-runner build/tests", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "ctest", + "--test-dir", + "build", + "--output-on-failure" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "ctest --test-dir build --output-on-failure", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "gcovr", + "--fail-under-branch", + "80" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "gcovr --fail-under-branch 80", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "run-clang-tidy", + "-p", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "run-clang-tidy -p build", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "cppcheck", + "--project=build/compile_commands.json", + "--error-exitcode=1" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Command", + "line": "cppcheck --project=build/compile_commands.json --error-exitcode=1", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:format", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "format", + "origin": ".github/workflows/ci.yml:jobs.format", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:format", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.format.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "find", + ".", + "-name", + "*.c" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:format", + "kind": "Command", + "line": "find . -name '*.c' | xargs clang-format --dry-run -Werror", + "origin": ".github/workflows/ci.yml:jobs.format.steps[1].run", + "via": [] + }, + { + "argv": [ + "xargs", + "clang-format", + "--dry-run", + "-Werror" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:format", + "kind": "Command", + "line": "find . -name '*.c' | xargs clang-format --dry-run -Werror", + "origin": ".github/workflows/ci.yml:jobs.format.steps[1].run", + "via": [] + }, + { + "argv": [ + "clang-format", + "--dry-run", + "-Werror" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:format", + "kind": "Command", + "line": "find . -name '*.c' | xargs clang-format --dry-run -Werror", + "origin": ".github/workflows/ci.yml:jobs.format.steps[1].run", + "via": [ + ".github/workflows/ci.yml:jobs.format.steps[1].run" + ] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/codeql-analysis.yml:analyze", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "analyze", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "ActionStep", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "languages": "cpp" + }, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "ActionStep", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[1]", + "uses": "github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "argv": [ + "cmake", + "-S", + ".", + "-B", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "Command", + "line": "cmake -S . -B build && cmake --build build", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[2].run", + "via": [] + }, + { + "argv": [ + "cmake", + "--build", + "build" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "Command", + "line": "cmake -S . -B build && cmake --build build", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[2].run", + "via": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "ActionStep", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[3]", + "uses": "github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "argv": [ + "codeql", + "database", + "analyze" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "Command", + "line": "uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[3]", + "via": [] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/codeql-analysis.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "kind": "StepReference", + "origin": ".github/workflows/codeql-analysis.yml", + "reference": "github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "kind": "StepReference", + "origin": ".github/workflows/codeql-analysis.yml", + "reference": "github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/copy-paste-detection.yml:cpd", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "cpd", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.cpd", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/copy-paste-detection.yml:cpd", + "kind": "ActionStep", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.cpd.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "pmd", + "cpd", + "--language", + "c", + "--minimum-tokens", + "100", + "--dir", + "src", + "--dir", + "include" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/copy-paste-detection.yml:cpd", + "kind": "Command", + "line": "pmd cpd --language c --minimum-tokens 100 --dir src --dir include", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.cpd.steps[1].run", + "via": [] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/copy-paste-detection.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "default_compiler": true, + "ecosystems": [], + "heuristic": false, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Job", + "name": ".github/workflows/ci-lint.yml: ci-lint", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + { + "build_type": "release", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": true + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, ON)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + { + "build_type": "debug", + "sanitizers": false + } + ], + "default_compiler": false, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, OFF)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "default_compiler": true, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:format", + "kind": "Job", + "name": ".github/workflows/ci.yml: format", + "origin": ".github/workflows/ci.yml:jobs.format", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "default_compiler": true, + "ecosystems": [ + "C" + ], + "heuristic": false, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "Job", + "name": ".github/workflows/codeql-analysis.yml: analyze", + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "default_compiler": true, + "ecosystems": [], + "heuristic": false, + "job": ".github/workflows/copy-paste-detection.yml:cpd", + "kind": "Job", + "name": ".github/workflows/copy-paste-detection.yml: cpd", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.cpd", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "kind": "ConfigurationFile", + "origin": ".clang-format", + "reader": "clang-format" + }, + { + "kind": "ConfigurationFile", + "origin": ".clang-tidy", + "reader": "clang-tidy" + }, + { + "heuristic": false, + "key": "Checks", + "kind": "Setting", + "origin": ".clang-tidy:Checks", + "tool": "clang-tidy", + "value": "-*,readability-function-size" + }, + { + "heuristic": false, + "key": "CheckOptions", + "kind": "Setting", + "origin": ".clang-tidy:CheckOptions", + "tool": "clang-tidy", + "value": [ + { + "key": "readability-function-size.LineThreshold", + "value": 80 + } + ] + }, + { + "kind": "ConfigurationFile", + "origin": ".gitignore", + "reader": ".gitignore entries" + }, + { + "kind": "IgnoreEntry", + "origin": ".gitignore", + "pattern": "/build/", + "syntax": "glob", + "written": "/build/" + }, + { + "kind": "IgnoreEntry", + "origin": ".gitignore", + "pattern": "/out/", + "syntax": "glob", + "written": "/out/" + }, + { + "kind": "ConfigurationFile", + "origin": "CMakeLists.txt", + "reader": "CMake" + }, + { + "kind": "ConfigurationFile", + "origin": "CMakeLists.txt", + "reader": "Fortran programs" + }, + { + "kind": "ConfigurationFile", + "origin": "LICENSE", + "reader": "license files" + }, + { + "kind": "LicenseFile", + "licenses": [ + "MIT" + ], + "origin": "LICENSE" + }, + { + "kind": "ConfigurationFile", + "origin": "cmake/Dependencies.cmake", + "reader": "CMake" + }, + { + "kind": "ConfigurationFile", + "origin": "fuzz_test/CMakeLists.txt", + "reader": "CMake" + }, + { + "kind": "ConfigurationFile", + "origin": "fuzz_test/CMakeLists.txt", + "reader": "Fortran programs" + }, + { + "kind": "ConfigurationFile", + "origin": "test/CMakeLists.txt", + "reader": "CMake" + }, + { + "kind": "ConfigurationFile", + "origin": "test/CMakeLists.txt", + "reader": "Fortran programs" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "MSVC" + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "/W4", + "origin": "CMakeLists.txt:add_compile_options[12]", + "target": null + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "/permissive-", + "origin": "CMakeLists.txt:add_compile_options[12]", + "target": null + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "/sdl", + "origin": "CMakeLists.txt:add_compile_options[12]", + "target": null + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "/guard:cf", + "origin": "CMakeLists.txt:add_compile_options[12]", + "target": null + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": true, + "option": "/DYNAMICBASE", + "origin": "CMakeLists.txt:add_link_options[13]", + "target": null + }, + { + "applies": { + "compilers": [ + "msvc" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": true, + "option": "/CETCOMPAT", + "origin": "CMakeLists.txt:add_link_options[13]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Wall", + "origin": "CMakeLists.txt:add_compile_options[15]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Wextra", + "origin": "CMakeLists.txt:add_compile_options[15]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Wpedantic", + "origin": "CMakeLists.txt:add_compile_options[15]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Wshadow", + "origin": "CMakeLists.txt:add_compile_options[15]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Wconversion", + "origin": "CMakeLists.txt:add_compile_options[15]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fstack-protector-strong", + "origin": "CMakeLists.txt:add_compile_options[16]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fcf-protection", + "origin": "CMakeLists.txt:add_compile_options[16]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fstack-clash-protection", + "origin": "CMakeLists.txt:add_compile_options[16]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-D_FORTIFY_SOURCE=3", + "origin": "CMakeLists.txt:add_compile_definitions[17]", + "target": null + }, + { + "applies": {}, + "build_system": "CMake", + "default": true, + "kind": "BuildSetting", + "name": "ENABLE_COVERAGE", + "origin": "CMakeLists.txt:option[20]", + "target": null, + "value": "OFF" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "ENABLE_COVERAGE" + }, + { + "applies": { + "requires": [ + "ENABLE_COVERAGE" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "--coverage", + "origin": "CMakeLists.txt:add_compile_options[22]", + "target": null + }, + { + "applies": { + "requires": [ + "ENABLE_COVERAGE" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fcondition-coverage", + "origin": "CMakeLists.txt:add_compile_options[22]", + "target": null + }, + { + "applies": { + "requires": [ + "ENABLE_COVERAGE" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": true, + "option": "--coverage", + "origin": "CMakeLists.txt:add_link_options[23]", + "target": null + }, + { + "applies": {}, + "build_system": "CMake", + "default": true, + "kind": "BuildSetting", + "name": "ENABLE_SANITIZERS", + "origin": "CMakeLists.txt:option[26]", + "target": null, + "value": "OFF" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "ENABLE_SANITIZERS" + }, + { + "applies": { + "compilers": [ + "msvc" + ], + "requires": [ + "ENABLE_SANITIZERS" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "/fsanitize=address", + "origin": "CMakeLists.txt:add_compile_options[29]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc", + "requires": [ + "ENABLE_SANITIZERS" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fsanitize=address,undefined", + "origin": "CMakeLists.txt:add_compile_options[31]", + "target": null + }, + { + "applies": { + "compilers": "all but msvc", + "requires": [ + "ENABLE_SANITIZERS" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": true, + "option": "-fsanitize=address,undefined", + "origin": "CMakeLists.txt:add_link_options[32]", + "target": null + }, + { + "applies": {}, + "build_system": "CMake", + "default": true, + "kind": "BuildSetting", + "name": "WARNINGS_AS_ERRORS", + "origin": "CMakeLists.txt:option[36]", + "target": null, + "value": "ON" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "WARNINGS_AS_ERRORS" + }, + { + "applies": { + "requires": [ + "WARNINGS_AS_ERRORS" + ] + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-Werror", + "origin": "CMakeLists.txt:add_compile_options[38]", + "target": null + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "PROJECT_IS_TOP_LEVEL" + }, + { + "heuristic": false, + "key": "enables", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CTest", + "value": true + }, + { + "heuristic": false, + "key": "registers", + "kind": "Setting", + "origin": "test/CMakeLists.txt", + "tool": "CTest", + "value": "add_test" + }, + { + "heuristic": false, + "key": "test", + "kind": "Setting", + "origin": "test/CMakeLists.txt", + "tool": "CTest", + "value": [ + "tests", + "tests" + ] + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "CMakeLists.txt", + "tool": "CMake", + "value": "NOT MSVC" + }, + { + "heuristic": false, + "key": "guard", + "kind": "Setting", + "origin": "fuzz_test/CMakeLists.txt", + "tool": "CMake", + "value": "CMAKE_C_COMPILER_ID MATCHES Clang" + }, + { + "applies": { + "compilers": "all but flang, gcc, ghc, intel, msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": false, + "option": "-fsanitize=fuzzer,undefined,address", + "origin": "fuzz_test/CMakeLists.txt:target_compile_options[3]", + "target": "fuzz_tester" + }, + { + "applies": { + "compilers": "all but flang, gcc, ghc, intel, msvc" + }, + "build_system": "CMake", + "kind": "CompilerOption", + "linking": true, + "option": "-fsanitize=fuzzer,undefined,address", + "origin": "fuzz_test/CMakeLists.txt:target_link_options[4]", + "target": "fuzz_tester" + }, + { + "heuristic": false, + "key": "registers", + "kind": "Setting", + "origin": "fuzz_test/CMakeLists.txt", + "tool": "CTest", + "value": "add_test" + }, + { + "heuristic": false, + "key": "test", + "kind": "Setting", + "origin": "fuzz_test/CMakeLists.txt", + "tool": "CTest", + "value": [ + "fuzz_tester_run", + "fuzz_tester", + "-max_total_time=10" + ] + }, + { + "applies": {}, + "build_system": "CMake", + "default": false, + "kind": "BuildSetting", + "name": "CMAKE_C_EXTENSIONS", + "origin": "CMakeLists.txt:set[8]", + "target": null, + "value": "OFF" + }, + { + "applies": {}, + "build_system": "CMake", + "default": false, + "kind": "BuildSetting", + "name": "CMAKE_EXPORT_COMPILE_COMMANDS", + "origin": "CMakeLists.txt:set[9]", + "target": null, + "value": "ON" + }, + { + "kind": "Declared", + "manager": "FetchContent", + "origin": "cmake/Dependencies.cmake" + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[6]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[7]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[8]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[9]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[10]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[11]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[12]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[13]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[14]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[15]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[16]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[17]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[18]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[1].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "provides": { + "mutation": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Mull", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "Assembly", + "C", + "C++", + "CUDA", + "Fortran", + "Objective-C", + "Objective-C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "ctest", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++", + "Fortran" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "provides": { + "coverage": [ + "branch gated", + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "gcovr", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-tidy", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [ + ".clang-tidy" + ], + "scope": [ + "." + ], + "tool": "clang-tidy's readability-function-size", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[19]", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "cppcheck", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:format", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/ci.yml:jobs.format.steps[1].run", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "clang-format", + "via": [ + ".github/workflows/ci.yml:jobs.format.steps[1].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[2].run", + "provides": { + "coverage": [ + "path" + ] + }, + "read": [ + "CMakeLists.txt" + ], + "scope": [ + "." + ], + "tool": "gcc -fcondition-coverage", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/codeql-analysis.yml:analyze", + "kind": "ToolRun", + "languages": [ + "C", + "C++" + ], + "origin": ".github/workflows/codeql-analysis.yml:jobs.analyze.steps[3]", + "provides": { + "security": [ + "scans" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "CodeQL", + "via": [] + } + ], + "map": { + "build_systems": [ + "CMake" + ], + "ci": { + "files": [ + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/codeql-analysis.yml", + ".github/workflows/copy-paste-detection.yml" + ], + "jobs": [ + { + "compilers": [ + "gcc" + ], + "configurations": [], + "ecosystems": [], + "name": ".github/workflows/ci-lint.yml: ci-lint", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Release + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, ON)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Release" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, OFF)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Debug + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, ON)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Debug" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, OFF)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Release + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, ON)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Release" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, OFF)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Debug + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, ON)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Debug" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, OFF)", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Release + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, ON)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Release" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, OFF)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Debug + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, ON)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [ + "Debug" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, OFF)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Release + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, ON)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Release" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, OFF)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Debug + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, ON)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "clang" + ], + "configurations": [ + "Debug" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, OFF)", + "os": "macos", + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + "Release + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, ON)", + "os": "windows", + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + "Release" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, OFF)", + "os": "windows", + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + "Debug + sanitizers" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, ON)", + "os": "windows", + "toolchains": [] + }, + { + "compilers": [ + "msvc" + ], + "configurations": [ + "Debug" + ], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, OFF)", + "os": "windows", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/ci.yml: format", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "ecosystems": [ + "C" + ], + "name": ".github/workflows/codeql-analysis.yml: analyze", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [ + "gcc" + ], + "configurations": [], + "ecosystems": [], + "name": ".github/workflows/copy-paste-detection.yml: cpd", + "os": "linux", + "toolchains": [] + } + ], + "providers": [ + "GitHub Actions" + ] + }, + "ecosystems": { + "C": [ + "build file CMakeLists.txt", + ".c files" + ], + "Data": [ + ".yml files" + ] + }, + "formats": [ + "YAML" + ], + "languages": [ + "C" + ], + "units": [ + { + "build_systems": [ + "CMake" + ], + "directory": ".", + "formats": [ + "YAML" + ], + "languages": [ + "C" + ], + "role": "product" + } + ], + "unrecognised_suffixes": [] + } +} diff --git a/tests/snapshots/well_configured_c.json b/tests/snapshots/well_configured_c.json new file mode 100644 index 00000000..b62d8cce --- /dev/null +++ b/tests/snapshots/well_configured_c.json @@ -0,0 +1,1372 @@ +{ + "answers": { + "action-pinning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "language": "C", + "references": [ + { + "path": ".github/workflows/ci-lint.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/ci-lint.yml", + "pinning": null, + "reference": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "path": ".github/workflows/ci.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/codeql-analysis.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/codeql-analysis.yml", + "pinning": null, + "reference": "github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "path": ".github/workflows/codeql-analysis.yml", + "pinning": null, + "reference": "github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9" + }, + { + "path": ".github/workflows/copy-paste-detection.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + } + ], + "unit": "." + } + ] + } + ], + "ci-lint": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "language": "C", + "providers": { + "GitHub Actions": { + "lintable": true, + "linters": [ + "actionlint", + "zizmor" + ] + } + }, + "unit": "." + } + ] + } + ], + "committed-artifacts": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "committed": [], + "language": "C", + "unit": "." + } + ] + } + ], + "compile-commands": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)": [ + "CMakeLists.txt" + ] + }, + "missing": [ + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "CMAKE_EXPORT_COMPILE_COMMANDS ON in a preset", + "Meson, which writes it" + ] + } + ], + "language": "C", + "practice": "compile-commands", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "set(CMAKE_C_EXTENSIONS OFF)": [ + "CMakeLists.txt" + ] + }, + "missing": [ + "-DCMAKE_C_EXTENSIONS=OFF", + "CMAKE_C_EXTENSIONS OFF in a preset", + "C_EXTENSIONS OFF", + "c_std=c17" + ] + } + ], + "language": "C", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "compiler-warnings": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": "clang", + "found": { + "-Wall": [ + "CMakeLists.txt" + ], + "-Wconversion": [ + "CMakeLists.txt" + ], + "-Wextra": [ + "CMakeLists.txt" + ], + "-Wpedantic": [ + "CMakeLists.txt" + ], + "-Wshadow": [ + "CMakeLists.txt" + ] + }, + "missing": [] + }, + { + "compiler": "gcc", + "found": { + "-Wall": [ + "CMakeLists.txt" + ], + "-Wconversion": [ + "CMakeLists.txt" + ], + "-Wextra": [ + "CMakeLists.txt" + ], + "-Wpedantic": [ + "CMakeLists.txt" + ], + "-Wshadow": [ + "CMakeLists.txt" + ] + }, + "missing": [] + }, + { + "compiler": "msvc", + "found": { + "/W4": [ + "CMakeLists.txt" + ], + "/permissive-": [ + "CMakeLists.txt" + ] + }, + "missing": [] + } + ], + "language": "C", + "practice": "compiler-warnings", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "coverage": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "branch": { + "answer": "yes", + "gated": [ + "gcovr" + ], + "known": [ + "gcovr --xml", + "lcov --rc branch_coverage=1", + "gcov --branch-counts", + "llvm-cov report" + ], + "reported": [ + "gcovr" + ], + "rung": "gated", + "tools": [ + "gcovr" + ] + }, + "language": "C", + "line": { + "answer": "yes", + "gated": [], + "known": [ + "gcovr", + "lcov", + "gcov", + "llvm-cov report" + ], + "reported": [ + "gcovr" + ], + "rung": "reported", + "tools": [ + "gcovr" + ] + }, + "path": { + "answer": "yes", + "gated": [], + "known": [ + "lcov --mcdc-coverage", + "gcov --conditions", + "llvm-cov show -show-mcdc", + "gcc -fcondition-coverage", + "gcc -fpath-coverage", + "clang -fcoverage-mcdc" + ], + "reported": [], + "rung": "measured", + "tools": [ + "gcc -fcondition-coverage" + ] + }, + "region": { + "answer": "no", + "gated": [], + "known": [ + "llvm-cov report" + ], + "reported": [], + "rung": null, + "tools": [] + }, + "statement": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "unit": ".", + "unknowns": [] + } + ] + } + ], + "dependency-audit": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "dependency-management": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "declared": [ + { + "manager": "FetchContent", + "manifest": "cmake/Dependencies.cmake" + } + ], + "language": "C", + "lock_required": false, + "locked": [], + "unit": ".", + "unknowns": [] + } + ] + } + ], + "formatting": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": { + "clang-format": [ + ".clang-format" + ] + }, + "known": { + "clang-format": { + "can": { + "apply": "clang-format -i", + "check": "clang-format --dry-run -Werror" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "check", + "runs": { + "clang-format": { + "levels": [ + "check" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "function-limits": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": { + "clang-tidy's readability-function-size": [ + ".clang-tidy" + ] + }, + "known": { + "clang-tidy's readability-function-size": { + "can": { + "limits": "clang-tidy with readability-function-size and a LineThreshold in .clang-tidy" + }, + "needs_definition": true, + "required": false + }, + "lizard": { + "can": { + "limits": "lizard --length 30" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "limits", + "runs": { + "clang-tidy's readability-function-size": { + "levels": [ + "limits", + "measures" + ], + "read": [ + ".clang-tidy" + ] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "fuzz-testing": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "language": "C", + "other_runs": [ + "CTest (fuzz_test/CMakeLists.txt): fuzz_tester_run" + ], + "property_files": [], + "tools": { + "answer": "no", + "defined": { + "AFL++": [ + "fuzz_test/fuzz_tester.c" + ], + "libFuzzer": [ + "fuzz_test/fuzz_tester.c" + ] + }, + "known": { + "AFL++": { + "can": { + "runs": "afl-fuzz -i -o -- " + }, + "needs_definition": true, + "required": false + }, + "libFuzzer": { + "can": { + "runs": "a fuzz target binary with -max_total_time= (or ClusterFuzzLite or CIFuzz)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + }, + "unit": "." + } + ] + } + ], + "hardening": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": "clang", + "found": { + "-fcf-protection": [ + "CMakeLists.txt" + ], + "-fstack-clash-protection": [ + "CMakeLists.txt" + ], + "-fstack-protector-strong": [ + "CMakeLists.txt" + ], + "_FORTIFY_SOURCE": [ + "CMakeLists.txt" + ] + }, + "missing": [] + }, + { + "compiler": "gcc", + "found": { + "-fcf-protection": [ + "CMakeLists.txt" + ], + "-fstack-clash-protection": [ + "CMakeLists.txt" + ], + "-fstack-protector-strong": [ + "CMakeLists.txt" + ], + "_FORTIFY_SOURCE": [ + "CMakeLists.txt" + ] + }, + "missing": [] + }, + { + "compiler": "msvc", + "found": { + "/CETCOMPAT": [ + "CMakeLists.txt" + ], + "/DYNAMICBASE": [ + "CMakeLists.txt" + ], + "/guard:cf": [ + "CMakeLists.txt" + ], + "/sdl": [ + "CMakeLists.txt" + ] + }, + "missing": [] + } + ], + "language": "C", + "practice": "hardening", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "license": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "files": { + "LICENSE": [ + "MIT" + ] + }, + "language": "C", + "mismatches": [], + "unit": "." + } + ] + } + ], + "link-check": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "migration-safety": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "linted", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "mutation-testing": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "Mull": { + "can": { + "runs": "mull-runner" + }, + "needs_definition": false, + "required": false + }, + "dextool mutate": { + "can": { + "runs": "dextool mutate" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": { + "Mull": { + "levels": [ + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "out-of-source-build": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "a check that the source and binary directories differ": [ + "CMakeLists.txt" + ] + }, + "missing": [ + "CMAKE_DISABLE_IN_SOURCE_BUILD", + "CMAKE_DISABLE_SOURCE_CHANGES", + "Meson, which builds out of source" + ] + } + ], + "language": "C", + "practice": "out-of-source-build", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "platforms": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "axis": "compiler", + "language": "C", + "notes": [], + "platforms": [ + { + "compiler": "clang", + "configurations": [ + "Debug", + "Debug + sanitizers", + "Release", + "Release + sanitizers" + ], + "os": "linux" + }, + { + "compiler": "gcc", + "configurations": [ + "Debug", + "Debug + sanitizers", + "Release", + "Release + sanitizers" + ], + "os": "linux" + }, + { + "compiler": "clang", + "configurations": [ + "Debug", + "Debug + sanitizers", + "Release", + "Release + sanitizers" + ], + "os": "macos" + }, + { + "compiler": "gcc", + "configurations": [ + "Debug", + "Debug + sanitizers", + "Release", + "Release + sanitizers" + ], + "os": "macos" + }, + { + "compiler": "msvc", + "configurations": [ + "Debug", + "Debug + sanitizers", + "Release", + "Release + sanitizers" + ], + "os": "windows" + } + ], + "unit": "." + } + ] + } + ], + "sanitizers": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "AddressSanitizer": [ + "CMakeLists.txt (when ENABLE_SANITIZERS)", + "fuzz_test/CMakeLists.txt" + ], + "UndefinedBehaviorSanitizer": [ + "CMakeLists.txt (when ENABLE_SANITIZERS)", + "fuzz_test/CMakeLists.txt" + ] + }, + "missing": [] + } + ], + "language": "C", + "practice": "sanitizers", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "schema-compatibility": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "breaking", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-declared": [], + "schema-examples": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-validation": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "validates", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "secret-scanning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "configured": [], + "language": "C", + "scanners": [ + "gitleaks" + ], + "unit": "." + } + ] + } + ], + "security-scanning": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "CodeQL": { + "can": { + "scans": "CodeQL (github/codeql-action)" + }, + "needs_definition": false, + "required": false + }, + "GitLab SAST": { + "can": { + "scans": "GitLab SAST (Security/SAST.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "semgrep": { + "can": { + "scans": "semgrep ci" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "scans", + "runs": { + "CodeQL": { + "levels": [ + "scans" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "static-analysis": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": { + "clang-tidy": [ + ".clang-tidy" + ] + }, + "known": { + "clang-tidy": { + "can": { + "checks": "clang-tidy (CMAKE_CXX_CLANG_TIDY, checks chosen in a .clang-tidy)" + }, + "needs_definition": true, + "required": false + }, + "cppcheck": { + "can": { + "checks": "cppcheck (CMAKE_CXX_CPPCHECK)" + }, + "needs_definition": false, + "required": false + } + }, + "language": "C", + "level": "checks", + "runs": { + "clang-tidy": { + "levels": [ + "checks" + ], + "read": [] + }, + "cppcheck": { + "levels": [ + "checks" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "tests": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "defined": { + "ctest": [ + "test/CMakeLists.txt", + "fuzz_test/CMakeLists.txt" + ] + }, + "known": { + "ctest": { + "can": { + "runs": "ctest" + }, + "needs_definition": true, + "required": false + }, + "meson test": { + "can": { + "runs": "meson test" + }, + "needs_definition": true, + "required": false + } + }, + "language": "C", + "level": "runs", + "runs": { + "ctest": { + "levels": [ + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "top-level-guard": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "PROJECT_IS_TOP_LEVEL": [ + "CMakeLists.txt" + ] + }, + "missing": [ + "CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR", + "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME", + "meson.is_subproject()" + ] + } + ], + "language": "C", + "practice": "top-level-guard", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "type-checking": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "C", + "level": "checks", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "vcs-ignore": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "language": "C", + "outputs": { + "the build directory": { + ".gitignore": "/build/" + } + }, + "unit": "." + } + ] + } + ], + "warnings-as-errors": [ + { + "auxiliary": {}, + "language": "C", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": "clang", + "found": { + "-Werror": [ + "CI (.github/workflows/ci.yml)", + "CMakeLists.txt (when WARNINGS_AS_ERRORS)" + ] + }, + "missing": [] + }, + { + "compiler": "gcc", + "found": { + "-Werror": [ + "CI (.github/workflows/ci.yml)", + "CMakeLists.txt (when WARNINGS_AS_ERRORS)" + ] + }, + "missing": [] + }, + { + "compiler": "msvc", + "found": {}, + "missing": [ + "/WX" + ] + } + ], + "language": "C", + "practice": "warnings-as-errors", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "wellformed": [ + { + "auxiliary": {}, + "language": "YAML", + "units": [ + { + "answer": "yes", + "language": "YAML", + "parsed": [ + ".github/dependabot.yml", + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/codeql-analysis.yml", + ".github/workflows/copy-paste-detection.yml" + ], + "problems": [], + "test_data": [], + "test_problems": [], + "unit": ".", + "unread": {} + } + ] + } + ] + }, + "results": { + "action-pinning": { + "details": [], + "message": "all 7 actions are pinned to a commit", + "status": "PASS" + }, + "ci-build-types": { + "details": [], + "message": "all 5 OS/compiler combination(s) build Debug and Release, each with and without sanitizers", + "status": "PASS" + }, + "ci-lint": { + "details": [], + "message": "CI lints its configuration (GitHub Actions: actionlint, zizmor)", + "status": "PASS" + }, + "ci-present": { + "details": [ + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/codeql-analysis.yml", + ".github/workflows/copy-paste-detection.yml" + ], + "message": "CI configuration found for GitHub Actions", + "status": "PASS" + }, + "code-formatting": { + "details": [], + "message": ".clang-format is defined and CI runs clang-format", + "status": "PASS" + }, + "committed-artifacts": { + "details": [], + "message": "no build outputs are committed", + "status": "PASS" + }, + "compile-commands": { + "details": [], + "message": "compile_commands.json is exported with set(CMAKE_EXPORT_COMPILE_COMMANDS ON)", + "status": "PASS" + }, + "compiler-extensions": { + "details": [], + "message": "C compiler extensions are disabled with set(CMAKE_C_EXTENSIONS OFF)", + "status": "PASS" + }, + "compiler-warnings": { + "details": [], + "message": "strict compiler warning flags are enabled: -Wall -Wextra -Wpedantic -Wshadow -Wconversion for clang and gcc; /W4 /permissive- for msvc", + "status": "PASS" + }, + "copy-paste-detection": { + "details": [], + "message": "CI runs copy-paste detection with PMD CPD", + "status": "PASS" + }, + "coverage": { + "details": [], + "message": "branch coverage is gated with gcovr; path coverage bonus: measured with gcc -fcondition-coverage (not reported)", + "status": "PASS" + }, + "data-wellformed": { + "details": [], + "message": "5 YAML files parse", + "status": "PASS" + }, + "dependency-audit": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "dependency-management": { + "details": [], + "message": "dependencies are declared in cmake/Dependencies.cmake (FetchContent)", + "status": "PASS" + }, + "dependency-updates": { + "details": [ + ".github/dependabot.yml" + ], + "message": "automated dependency updates are configured with Dependabot", + "status": "PASS" + }, + "function-limits": { + "details": [], + "message": "function length is limited with clang-tidy's readability-function-size (.clang-tidy)", + "status": "PASS" + }, + "fuzz-testing": { + "details": [], + "message": "fuzz targets in 1 file(s), run by CTest (fuzz_test/CMakeLists.txt): fuzz_tester_run", + "status": "PASS" + }, + "hardening": { + "details": [], + "message": "hardening options are enabled: _FORTIFY_SOURCE, -fstack-protector-strong, -fcf-protection, -fstack-clash-protection for clang and gcc; /sdl, /guard:cf, /DYNAMICBASE, /CETCOMPAT for msvc", + "status": "PASS" + }, + "large-files": { + "details": [], + "message": "no committed file is larger than 5 MiB", + "status": "PASS" + }, + "license": { + "details": [ + "LICENSE" + ], + "message": "the project is licensed under MIT", + "status": "PASS" + }, + "link-check": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "migration-safety": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "mutation-testing": { + "details": [], + "message": "Mull runs", + "status": "PASS" + }, + "out-of-source-build": { + "details": [], + "message": "in-source builds are prevented by a check that the source and binary directories differ", + "status": "PASS" + }, + "platform-matrix": { + "details": [ + ".github/workflows/ci-lint.yml: ci-lint: linux / gcc (runner default)", + ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, ON): linux / gcc", + ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, OFF): linux / gcc", + ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, ON): linux / gcc", + ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, OFF): linux / gcc", + ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, ON): linux / clang", + ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, OFF): linux / clang", + ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, ON): linux / clang", + ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, OFF): linux / clang", + ".github/workflows/ci.yml: test (macos-latest, gcc, Release, ON): macos / gcc", + ".github/workflows/ci.yml: test (macos-latest, gcc, Release, OFF): macos / gcc", + ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, ON): macos / gcc", + ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, OFF): macos / gcc", + ".github/workflows/ci.yml: test (macos-latest, clang, Release, ON): macos / clang", + ".github/workflows/ci.yml: test (macos-latest, clang, Release, OFF): macos / clang", + ".github/workflows/ci.yml: test (macos-latest, clang, Debug, ON): macos / clang", + ".github/workflows/ci.yml: test (macos-latest, clang, Debug, OFF): macos / clang", + ".github/workflows/ci.yml: test (windows-latest, msvc, Release, ON): windows / msvc", + ".github/workflows/ci.yml: test (windows-latest, msvc, Release, OFF): windows / msvc", + ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, ON): windows / msvc", + ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, OFF): windows / msvc", + ".github/workflows/ci.yml: format: linux / gcc (runner default)", + ".github/workflows/codeql-analysis.yml: analyze: linux / gcc (runner default)", + ".github/workflows/copy-paste-detection.yml: cpd: linux / gcc (runner default)" + ], + "message": "CI covers 3 OS(es) (linux, macos, windows), 3 compiler(s) (clang, gcc, msvc), 5 combination(s)", + "status": "PASS" + }, + "sanitizers": { + "details": [], + "message": "sanitizers are enabled: AddressSanitizer, UndefinedBehaviorSanitizer", + "status": "PASS" + }, + "schema-compatibility": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-declared": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-examples": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "schema-validation": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "secret-scanning": { + "details": [], + "message": "secrets are scanned for with gitleaks", + "status": "PASS" + }, + "security-policy": { + "details": [], + "message": "SECURITY.md says how to report a vulnerability", + "status": "PASS" + }, + "security-scanning": { + "details": [], + "message": "CI scans the code for security problems with CodeQL", + "status": "PASS" + }, + "static-analysis": { + "details": [], + "message": "clang-tidy (.clang-tidy) and cppcheck run", + "status": "PASS" + }, + "status-badges": { + "details": [], + "message": "README.md shows CI (GitHub Actions) and quality (Codecov) badges", + "status": "PASS" + }, + "tests-run": { + "details": [], + "message": "tests registered with CTest (enable_testing(), then add_test or a *_discover_tests call): 2 file(s), run by ctest", + "status": "PASS" + }, + "top-level-guard": { + "details": [], + "message": "developer-only settings are guarded by PROJECT_IS_TOP_LEVEL", + "status": "PASS" + }, + "type-checking": { + "details": [], + "message": "not applicable to C", + "status": "SKIP" + }, + "vcs-ignore": { + "details": [], + "message": ".gitignore ignores /build/", + "status": "PASS" + }, + "warnings-as-errors": { + "details": [], + "message": "warnings are treated as errors with -Werror", + "status": "PASS" + } + } +} diff --git a/tests/snapshots/well_configured_clojure.json b/tests/snapshots/well_configured_clojure.json index f22cd981..98f8d5e1 100644 --- a/tests/snapshots/well_configured_clojure.json +++ b/tests/snapshots/well_configured_clojure.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Clojure", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -176,13 +183,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Clojure", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -810,6 +810,11 @@ "message": "not applicable to Clojure", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Clojure", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Clojure lints are enabled: clj-kondo, *warn-on-reflection*", @@ -827,11 +832,6 @@ "message": "statement coverage is reported with cloverage", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Clojure", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_common_lisp.json b/tests/snapshots/well_configured_common_lisp.json index 3c753487..7391bdcb 100644 --- a/tests/snapshots/well_configured_common_lisp.json +++ b/tests/snapshots/well_configured_common_lisp.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Common Lisp", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -173,13 +180,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Common Lisp", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -727,6 +727,11 @@ "message": "not applicable to Common Lisp", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Common Lisp", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Lisp compiler lints are enabled: sblint", @@ -744,11 +749,6 @@ "message": "branch coverage is reported with sb-cover", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Common Lisp", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_c_cpp.facts.json b/tests/snapshots/well_configured_cpp.facts.json similarity index 99% rename from tests/snapshots/well_configured_c_cpp.facts.json rename to tests/snapshots/well_configured_cpp.facts.json index eeb0ceec..f3dafef9 100644 --- a/tests/snapshots/well_configured_c_cpp.facts.json +++ b/tests/snapshots/well_configured_cpp.facts.json @@ -3279,7 +3279,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[0]", @@ -3302,7 +3302,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[1]", @@ -3325,7 +3325,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[2]", @@ -3348,7 +3348,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[3]", @@ -3371,7 +3371,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[4]", @@ -3394,7 +3394,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[5]", @@ -3417,7 +3417,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[6]", @@ -3440,7 +3440,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[7]", @@ -3463,7 +3463,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[8]", @@ -3486,7 +3486,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[9]", @@ -3509,7 +3509,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[10]", @@ -3532,7 +3532,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[11]", @@ -3555,7 +3555,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[12]", @@ -3578,7 +3578,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[13]", @@ -3601,7 +3601,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[14]", @@ -3624,7 +3624,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[15]", @@ -3647,7 +3647,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[16]", @@ -3670,7 +3670,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[17]", @@ -3693,7 +3693,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[18]", @@ -3716,7 +3716,7 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[19]", @@ -3734,7 +3734,7 @@ "configurations": [], "default_compiler": true, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/ci.yml:format", @@ -3752,7 +3752,7 @@ "configurations": [], "default_compiler": true, "ecosystems": [ - "C/C++" + "C++" ], "heuristic": false, "job": ".github/workflows/codeql-analysis.yml:analyze", @@ -7696,7 +7696,7 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, ON)", "os": "linux", @@ -7710,7 +7710,7 @@ "Release" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Release, OFF)", "os": "linux", @@ -7724,7 +7724,7 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, ON)", "os": "linux", @@ -7738,7 +7738,7 @@ "Debug" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, gcc, Debug, OFF)", "os": "linux", @@ -7752,7 +7752,7 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, ON)", "os": "linux", @@ -7766,7 +7766,7 @@ "Release" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Release, OFF)", "os": "linux", @@ -7780,7 +7780,7 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, ON)", "os": "linux", @@ -7794,7 +7794,7 @@ "Debug" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, clang, Debug, OFF)", "os": "linux", @@ -7808,7 +7808,7 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, ON)", "os": "macos", @@ -7822,7 +7822,7 @@ "Release" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Release, OFF)", "os": "macos", @@ -7836,7 +7836,7 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, ON)", "os": "macos", @@ -7850,7 +7850,7 @@ "Debug" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, gcc, Debug, OFF)", "os": "macos", @@ -7864,7 +7864,7 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, ON)", "os": "macos", @@ -7878,7 +7878,7 @@ "Release" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, clang, Release, OFF)", "os": "macos", @@ -7892,7 +7892,7 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, ON)", "os": "macos", @@ -7906,7 +7906,7 @@ "Debug" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (macos-latest, clang, Debug, OFF)", "os": "macos", @@ -7920,7 +7920,7 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, ON)", "os": "windows", @@ -7934,7 +7934,7 @@ "Release" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Release, OFF)", "os": "windows", @@ -7948,7 +7948,7 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, ON)", "os": "windows", @@ -7962,7 +7962,7 @@ "Debug" ], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: test (windows-latest, msvc, Debug, OFF)", "os": "windows", @@ -7974,7 +7974,7 @@ ], "configurations": [], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/ci.yml: format", "os": "linux", @@ -7986,7 +7986,7 @@ ], "configurations": [], "ecosystems": [ - "C/C++" + "C++" ], "name": ".github/workflows/codeql-analysis.yml: analyze", "os": "linux", @@ -8008,7 +8008,7 @@ ] }, "ecosystems": { - "C/C++": [ + "C++": [ "build file CMakeLists.txt", ".cpp files" ], diff --git a/tests/snapshots/well_configured_c_cpp.json b/tests/snapshots/well_configured_cpp.json similarity index 99% rename from tests/snapshots/well_configured_c_cpp.json rename to tests/snapshots/well_configured_cpp.json index ef3cf64b..bd3cce96 100644 --- a/tests/snapshots/well_configured_c_cpp.json +++ b/tests/snapshots/well_configured_cpp.json @@ -116,6 +116,37 @@ ] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C++", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "set(CMAKE_CXX_EXTENSIONS OFF)": [ + "CMakeLists.txt" + ] + }, + "missing": [ + "-DCMAKE_CXX_EXTENSIONS=OFF", + "CMAKE_CXX_EXTENSIONS OFF in a preset", + "CXX_EXTENSIONS OFF", + "cpp_std=c++20" + ] + } + ], + "language": "C++", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -271,37 +302,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "C++", - "units": [ - { - "answer": "yes", - "compilers": [ - { - "compiler": null, - "found": { - "set(CMAKE_CXX_EXTENSIONS OFF)": [ - "CMakeLists.txt" - ] - }, - "missing": [ - "-DCMAKE_CXX_EXTENSIONS=OFF", - "CMAKE_CXX_EXTENSIONS OFF in a preset", - "CXX_EXTENSIONS OFF", - "cpp_std=c++20" - ] - } - ], - "language": "C++", - "practice": "cxx-extensions", - "unit": ".", - "unknowns": [] - } - ] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1180,6 +1180,11 @@ "message": "compile_commands.json is exported with set(CMAKE_EXPORT_COMPILE_COMMANDS ON)", "status": "PASS" }, + "compiler-extensions": { + "details": [], + "message": "C++ compiler extensions are disabled with set(CMAKE_CXX_EXTENSIONS OFF)", + "status": "PASS" + }, "compiler-warnings": { "details": [], "message": "strict compiler warning flags are enabled: -Wall -Wextra -Wpedantic -Wshadow -Wconversion for clang and gcc; /W4 /permissive- for msvc", @@ -1195,11 +1200,6 @@ "message": "branch coverage is gated with gcovr; path coverage bonus: measured with gcc -fcondition-coverage (not reported)", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "C++ compiler extensions are disabled with set(CMAKE_CXX_EXTENSIONS OFF)", - "status": "PASS" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_dart.json b/tests/snapshots/well_configured_dart.json index 83b2279e..2500fdfd 100644 --- a/tests/snapshots/well_configured_dart.json +++ b/tests/snapshots/well_configured_dart.json @@ -93,6 +93,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Dart", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -183,13 +190,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Dart", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -832,6 +832,11 @@ "message": "not applicable to Dart", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Dart", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Dart analyzer settings are enabled: a lint set in analysis_options.yaml, dart analyze", @@ -850,11 +855,6 @@ "message": "branch coverage is measured with dart test --coverage", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Dart", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "7 YAML files parse", diff --git a/tests/snapshots/well_configured_data.json b/tests/snapshots/well_configured_data.json index e4075b54..a5fb1551 100644 --- a/tests/snapshots/well_configured_data.json +++ b/tests/snapshots/well_configured_data.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -534,6 +534,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -549,11 +554,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 4 JSON files parse; TOML: 1 TOML file parses; XML: 3 XML files parse; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_docker.json b/tests/snapshots/well_configured_docker.json index acffc3f5..e45df5df 100644 --- a/tests/snapshots/well_configured_docker.json +++ b/tests/snapshots/well_configured_docker.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [ { "auxiliary": {}, @@ -286,6 +286,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -301,11 +306,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "Data: 5 YAML files parse; Docker: 1 Dockerfile file parses", diff --git a/tests/snapshots/well_configured_documentation.json b/tests/snapshots/well_configured_documentation.json index 29c29104..b2f1ec5c 100644 --- a/tests/snapshots/well_configured_documentation.json +++ b/tests/snapshots/well_configured_documentation.json @@ -17,9 +17,9 @@ } ], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -341,6 +341,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -356,11 +361,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "6 YAML files parse", diff --git a/tests/snapshots/well_configured_dotnet.json b/tests/snapshots/well_configured_dotnet.json index 86707f4c..d63a4214 100644 --- a/tests/snapshots/well_configured_dotnet.json +++ b/tests/snapshots/well_configured_dotnet.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "C#", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -183,13 +190,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "C#", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -976,6 +976,11 @@ "message": "not applicable to C#", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to C#", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict .NET analyzer settings are enabled: AnalysisMode Recommended or All, EnforceCodeStyleInBuild, Nullable enable", @@ -994,11 +999,6 @@ "message": "branch coverage is measured with coverlet", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to C#", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 2 JSON files parse; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_emacs_lisp.json b/tests/snapshots/well_configured_emacs_lisp.json index 78ac1f3b..7ec303f0 100644 --- a/tests/snapshots/well_configured_emacs_lisp.json +++ b/tests/snapshots/well_configured_emacs_lisp.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Emacs Lisp", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -176,13 +183,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Emacs Lisp", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -763,6 +763,11 @@ "message": "not applicable to Emacs Lisp", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Emacs Lisp", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Emacs Lisp lints are enabled: package-lint, checkdoc", @@ -780,11 +785,6 @@ "message": "line coverage is reported with undercover.el", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Emacs Lisp", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_fortran.facts.json b/tests/snapshots/well_configured_fortran.facts.json index 30dd478b..2bc3acd2 100644 --- a/tests/snapshots/well_configured_fortran.facts.json +++ b/tests/snapshots/well_configured_fortran.facts.json @@ -3045,7 +3045,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3075,7 +3076,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3105,7 +3107,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3135,7 +3138,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3165,7 +3169,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3195,7 +3200,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3225,7 +3231,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3255,7 +3262,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3285,7 +3293,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3315,7 +3324,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3345,7 +3355,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -3375,7 +3386,8 @@ ], "default_compiler": false, "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5041,7 +5053,8 @@ "Debug" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5059,7 +5072,8 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5077,7 +5091,8 @@ "Release" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5095,7 +5110,8 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5113,7 +5129,8 @@ "Debug" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5131,7 +5148,8 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5149,7 +5167,8 @@ "Release" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5167,7 +5186,8 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5185,7 +5205,8 @@ "Debug" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5203,7 +5224,8 @@ "Debug + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5221,7 +5243,8 @@ "Release" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], @@ -5239,7 +5262,8 @@ "Release + sanitizers" ], "ecosystems": [ - "C/C++", + "C", + "C++", "Fortran", "Python" ], diff --git a/tests/snapshots/well_configured_fortran.json b/tests/snapshots/well_configured_fortran.json index efbc76eb..df003275 100644 --- a/tests/snapshots/well_configured_fortran.json +++ b/tests/snapshots/well_configured_fortran.json @@ -93,6 +93,45 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Fortran", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": "gcc", + "found": { + "-std=f2018": [ + "CI (.github/workflows/ci.yml)" + ] + }, + "missing": [ + "fortran_std=f2018" + ] + }, + { + "compiler": "intel", + "found": { + "-stand f18": [ + "CI (.github/workflows/ci.yml)" + ] + }, + "missing": [ + "fortran_std=f2018" + ] + } + ], + "language": "Fortran", + "practice": "compiler-extensions", + "unit": ".", + "unknowns": [] + } + ] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -216,45 +255,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Fortran", - "units": [ - { - "answer": "yes", - "compilers": [ - { - "compiler": "gcc", - "found": { - "-std=f2018": [ - "CI (.github/workflows/ci.yml)" - ] - }, - "missing": [ - "fortran_std=f2018" - ] - }, - { - "compiler": "intel", - "found": { - "-stand f18": [ - "CI (.github/workflows/ci.yml)" - ] - }, - "missing": [ - "fortran_std=f2018" - ] - } - ], - "language": "Fortran", - "practice": "cxx-extensions", - "unit": ".", - "unknowns": [] - } - ] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -936,6 +936,11 @@ "message": "not applicable to Fortran", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "Fortran is compiled to a standard, without the compilers' extensions, with -std=f2018, -stand f18", + "status": "PASS" + }, "compiler-warnings": { "details": [], "message": "strict Fortran compiler warning flags are enabled: -Wall -Wextra -Wpedantic -Wimplicit-interface for gcc; -warn all for intel", @@ -953,11 +958,6 @@ "message": "branch coverage is gated with gcovr", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "Fortran is compiled to a standard, without the compilers' extensions, with -std=f2018, -stand f18", - "status": "PASS" - }, "data-wellformed": { "details": [], "message": "TOML: 1 TOML file parses; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_github_action.json b/tests/snapshots/well_configured_github_action.json index 92497ec5..d3e6995f 100644 --- a/tests/snapshots/well_configured_github_action.json +++ b/tests/snapshots/well_configured_github_action.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -216,6 +216,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -231,11 +236,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_go.json b/tests/snapshots/well_configured_go.json index ada2b865..a09b029e 100644 --- a/tests/snapshots/well_configured_go.json +++ b/tests/snapshots/well_configured_go.json @@ -103,6 +103,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Go", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -197,13 +204,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Go", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -959,6 +959,11 @@ "message": "not applicable to Go", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Go", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Go linters are enabled: go vet, staticcheck", @@ -976,11 +981,6 @@ "message": "statement coverage is reported with go test -cover", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Go", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "7 YAML files parse", diff --git a/tests/snapshots/well_configured_graphql.json b/tests/snapshots/well_configured_graphql.json index 992b2f1c..f4c28332 100644 --- a/tests/snapshots/well_configured_graphql.json +++ b/tests/snapshots/well_configured_graphql.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -275,6 +275,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -290,11 +295,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_haskell.json b/tests/snapshots/well_configured_haskell.json index 754d76f4..a132bbb0 100644 --- a/tests/snapshots/well_configured_haskell.json +++ b/tests/snapshots/well_configured_haskell.json @@ -98,6 +98,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Haskell", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -198,13 +205,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Haskell", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -817,6 +817,11 @@ "message": "not applicable to Haskell", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Haskell", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict GHC warning flags are enabled: -Wall -Wcompat -Widentities -Wredundant-constraints", @@ -834,11 +839,6 @@ "message": "branch coverage is reported with HPC", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Haskell", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_javascript.facts.json b/tests/snapshots/well_configured_javascript.facts.json index d0562e42..d75689f5 100644 --- a/tests/snapshots/well_configured_javascript.facts.json +++ b/tests/snapshots/well_configured_javascript.facts.json @@ -79,15 +79,15 @@ { "ambiguous": false, "kind": "SourceFile", - "language": "TypeScript", - "origin": "src/add.test.ts", + "language": "JavaScript", + "origin": "src/add.js", "role": "product" }, { "ambiguous": false, "kind": "SourceFile", - "language": "TypeScript", - "origin": "src/add.ts", + "language": "JavaScript", + "origin": "src/add.test.js", "role": "product" }, { @@ -97,13 +97,6 @@ "origin": "stryker.config.json", "role": "product" }, - { - "ambiguous": false, - "kind": "SourceFile", - "language": "JSON", - "origin": "tsconfig.json", - "role": "product" - }, { "build_systems": [ "npm" @@ -114,8 +107,7 @@ ], "kind": "Unit", "languages": [ - "JavaScript", - "TypeScript" + "JavaScript" ], "origin": ".", "role": "product" @@ -200,16 +192,6 @@ "role": "product", "unread": null }, - { - "column": null, - "format": "JSON", - "kind": "DataFile", - "line": null, - "origin": "tsconfig.json", - "problem": null, - "role": "product", - "unread": null - }, { "kind": "Jazzer.js fuzz targets (an exported fuzz function or .fuzz())", "language": "JavaScript", @@ -217,8 +199,8 @@ }, { "kind": "*.test.*, *.spec.*, __tests__/ or test/ files", - "language": "TypeScript", - "origin": "src/add.test.ts" + "language": "JavaScript", + "origin": "src/add.test.js" }, { "kind": "CiConfiguration", @@ -455,37 +437,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[0]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[0]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -497,7 +448,7 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -514,7 +465,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -529,7 +480,7 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -545,7 +496,7 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -560,9 +511,9 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -579,7 +530,7 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -595,9 +546,9 @@ "job": ".github/workflows/ci.yml:test[0]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -714,37 +665,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[1]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[1]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -756,7 +676,7 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -773,7 +693,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -788,7 +708,7 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -804,7 +724,7 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -819,9 +739,9 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -838,7 +758,7 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -854,9 +774,9 @@ "job": ".github/workflows/ci.yml:test[1]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -973,37 +893,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[2]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[2]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -1015,7 +904,7 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -1032,7 +921,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -1047,7 +936,7 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -1063,7 +952,7 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -1078,9 +967,9 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -1097,7 +986,7 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -1113,9 +1002,9 @@ "job": ".github/workflows/ci.yml:test[2]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -1232,37 +1121,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[3]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[3]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -1274,7 +1132,7 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -1291,7 +1149,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -1306,7 +1164,7 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -1322,7 +1180,7 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -1337,9 +1195,9 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -1356,7 +1214,7 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -1372,9 +1230,9 @@ "job": ".github/workflows/ci.yml:test[3]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -1491,37 +1349,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[4]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[4]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -1533,7 +1360,7 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -1550,7 +1377,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -1565,7 +1392,7 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -1581,7 +1408,7 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -1596,9 +1423,9 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -1615,7 +1442,7 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -1631,9 +1458,9 @@ "job": ".github/workflows/ci.yml:test[4]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -1750,37 +1577,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "argv": [ - "npm", - "run", - "typecheck" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[5]", - "kind": "Command", - "line": "npm run typecheck", - "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", - "via": [] - }, - { - "argv": [ - "tsc", - "--noEmit" - ], - "condition": null, - "directory": null, - "env": {}, - "job": ".github/workflows/ci.yml:test[5]", - "kind": "Command", - "line": "tsc --noEmit", - "origin": "package.json:scripts.typecheck", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "argv": [ "npm", @@ -1792,7 +1588,7 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npm test", - "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", "via": [] }, { @@ -1809,7 +1605,7 @@ "line": "vitest run --coverage", "origin": "package.json:scripts.test", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -1824,7 +1620,7 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npm audit --audit-level=moderate", - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "via": [] }, { @@ -1840,7 +1636,7 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [] }, { @@ -1855,9 +1651,9 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npx stryker run --incremental", - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -1874,7 +1670,7 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [] }, { @@ -1890,9 +1686,9 @@ "job": ".github/workflows/ci.yml:test[5]", "kind": "Command", "line": "npx jazzer fuzz/add.fuzz.js -- -max_total_time=30", - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -2065,7 +1861,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[0]", @@ -2086,7 +1882,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[1]", @@ -2107,7 +1903,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[2]", @@ -2128,7 +1924,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[3]", @@ -2149,7 +1945,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[4]", @@ -2170,7 +1966,7 @@ "configurations": [], "default_compiler": false, "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "heuristic": false, "job": ".github/workflows/ci.yml:test[5]", @@ -2349,53 +2145,6 @@ "origin": "stryker.config.json", "reader": "StrykerJS" }, - { - "kind": "ConfigurationFile", - "origin": "tsconfig.json", - "reader": "TypeScript" - }, - { - "heuristic": false, - "key": "compilerOptions.target", - "kind": "Setting", - "origin": "tsconfig.json:compilerOptions.target", - "tool": "TypeScript", - "value": "es2022" - }, - { - "heuristic": false, - "key": "compilerOptions.module", - "kind": "Setting", - "origin": "tsconfig.json:compilerOptions.module", - "tool": "TypeScript", - "value": "nodenext" - }, - { - "heuristic": false, - "key": "compilerOptions.strict", - "kind": "Setting", - "origin": "tsconfig.json:compilerOptions.strict", - "tool": "TypeScript", - "value": true - }, - { - "heuristic": false, - "key": "compilerOptions.outDir", - "kind": "Setting", - "origin": "tsconfig.json:compilerOptions.outDir", - "tool": "TypeScript", - "value": "dist" - }, - { - "heuristic": false, - "key": "include", - "kind": "Setting", - "origin": "tsconfig.json:include", - "tool": "TypeScript", - "value": [ - "src" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[0]", @@ -2491,32 +2240,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[0]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[0]", @@ -2537,7 +2260,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -2563,7 +2286,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -2574,7 +2297,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -2595,7 +2318,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -2608,7 +2331,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -2619,7 +2342,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -2631,7 +2354,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -2729,32 +2452,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[1]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[1]", @@ -2775,7 +2472,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -2801,7 +2498,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -2812,7 +2509,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -2833,7 +2530,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -2846,7 +2543,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -2857,7 +2554,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -2869,7 +2566,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -2967,32 +2664,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[2]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[2]", @@ -3013,7 +2684,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3039,7 +2710,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3050,7 +2721,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -3071,7 +2742,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -3084,7 +2755,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -3095,7 +2766,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -3107,7 +2778,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -3205,32 +2876,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[3]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[3]", @@ -3251,7 +2896,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3277,7 +2922,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3288,7 +2933,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -3309,7 +2954,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -3322,7 +2967,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -3333,7 +2978,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -3345,7 +2990,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -3443,32 +3088,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[4]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[4]", @@ -3489,7 +3108,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3515,7 +3134,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3526,7 +3145,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -3547,7 +3166,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -3560,7 +3179,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -3571,7 +3190,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -3583,7 +3202,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -3681,32 +3300,6 @@ ".github/workflows/ci.yml:jobs.test.steps[4].run" ] }, - { - "heuristic": false, - "job": ".github/workflows/ci.yml:test[5]", - "kind": "ToolRun", - "languages": [ - "JavaScript", - "TypeScript" - ], - "origin": "package.json:scripts.typecheck", - "provides": { - "type-check": [ - "checks", - "strict" - ] - }, - "read": [ - "tsconfig.json" - ], - "scope": [ - "." - ], - "tool": "tsc", - "via": [ - ".github/workflows/ci.yml:jobs.test.steps[5].run" - ] - }, { "heuristic": false, "job": ".github/workflows/ci.yml:test[5]", @@ -3727,7 +3320,7 @@ ], "tool": "a JavaScript test runner", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3753,7 +3346,7 @@ ], "tool": "Vitest", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[6].run" + ".github/workflows/ci.yml:jobs.test.steps[5].run" ] }, { @@ -3764,7 +3357,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", "provides": { "audit": [ "runs" @@ -3785,7 +3378,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", "provides": { "mutation": [ "incremental", @@ -3798,7 +3391,7 @@ ], "tool": "StrykerJS", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[8].run" + ".github/workflows/ci.yml:jobs.test.steps[7].run" ] }, { @@ -3809,7 +3402,7 @@ "JavaScript", "TypeScript" ], - "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", "provides": { "fuzz": [ "runs" @@ -3821,7 +3414,7 @@ ], "tool": "Jazzer.js", "via": [ - ".github/workflows/ci.yml:jobs.test.steps[9].run" + ".github/workflows/ci.yml:jobs.test.steps[8].run" ] }, { @@ -3871,7 +3464,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, 22)", "os": "linux", @@ -3883,7 +3476,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (ubuntu-latest, 24)", "os": "linux", @@ -3895,7 +3488,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (macos-latest, 22)", "os": "macos", @@ -3907,7 +3500,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (macos-latest, 24)", "os": "macos", @@ -3919,7 +3512,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (windows-latest, 22)", "os": "windows", @@ -3931,7 +3524,7 @@ "compilers": [], "configurations": [], "ecosystems": [ - "JavaScript/TypeScript" + "JavaScript" ], "name": ".github/workflows/ci.yml: test (windows-latest, 24)", "os": "windows", @@ -3969,10 +3562,9 @@ ".json files", ".yml files" ], - "JavaScript/TypeScript": [ + "JavaScript": [ "build file package.json", - ".js files", - ".ts files" + ".js files" ] }, "formats": [ @@ -3980,8 +3572,7 @@ "YAML" ], "languages": [ - "JavaScript", - "TypeScript" + "JavaScript" ], "units": [ { @@ -3994,8 +3585,7 @@ "YAML" ], "languages": [ - "JavaScript", - "TypeScript" + "JavaScript" ], "role": "product" } diff --git a/tests/snapshots/well_configured_javascript.json b/tests/snapshots/well_configured_javascript.json index eaf4b1c1..35dfe3d8 100644 --- a/tests/snapshots/well_configured_javascript.json +++ b/tests/snapshots/well_configured_javascript.json @@ -43,49 +43,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "language": "TypeScript", - "references": [ - { - "path": ".github/workflows/ci-lint.yml", - "pinning": null, - "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" - }, - { - "path": ".github/workflows/ci-lint.yml", - "pinning": null, - "reference": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" - }, - { - "path": ".github/workflows/ci.yml", - "pinning": null, - "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" - }, - { - "path": ".github/workflows/ci.yml", - "pinning": null, - "reference": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" - }, - { - "path": ".github/workflows/copy-paste-detection.yml", - "pinning": null, - "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" - }, - { - "path": ".github/workflows/function-limits.yml", - "pinning": null, - "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" - } - ], - "unit": "." - } - ] } ], "ci-lint": [ @@ -108,26 +65,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "language": "TypeScript", - "providers": { - "GitHub Actions": { - "lintable": true, - "linters": [ - "actionlint", - "zizmor" - ] - } - }, - "unit": "." - } - ] } ], "committed-artifacts": [ @@ -142,18 +79,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "committed": [], - "language": "TypeScript", - "unit": "." - } - ] } ], "compile-commands": [ @@ -161,10 +86,12 @@ "auxiliary": {}, "language": "JavaScript", "units": [] - }, + } + ], + "compiler-extensions": [ { "auxiliary": {}, - "language": "TypeScript", + "language": "JavaScript", "units": [] } ], @@ -192,30 +119,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "compilers": [ - { - "compiler": null, - "found": { - "eslint": [ - "CI (package.json)" - ] - }, - "missing": [] - } - ], - "language": "TypeScript", - "practice": "compiler-warnings", - "unit": ".", - "unknowns": [] - } - ] } ], "coverage": [ @@ -292,92 +195,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "branch": { - "answer": "yes", - "gated": [], - "known": [ - "c8", - "nyc", - "jest --coverage", - "vitest --coverage", - "deno test --coverage", - "node --test --experimental-test-coverage" - ], - "reported": [ - "Vitest" - ], - "rung": "reported", - "tools": [ - "Vitest" - ] - }, - "language": "TypeScript", - "line": { - "answer": "yes", - "gated": [], - "known": [ - "c8", - "nyc", - "jest --coverage", - "vitest --coverage", - "deno test --coverage", - "node --test --experimental-test-coverage", - "bun test --coverage" - ], - "reported": [ - "Vitest" - ], - "rung": "reported", - "tools": [ - "Vitest" - ] - }, - "path": { - "answer": "impossible", - "gated": [], - "known": [], - "reported": [], - "rung": null, - "tools": [] - }, - "region": { - "answer": "impossible", - "gated": [], - "known": [], - "reported": [], - "rung": null, - "tools": [] - }, - "statement": { - "answer": "impossible", - "gated": [], - "known": [], - "reported": [], - "rung": null, - "tools": [] - }, - "unit": ".", - "unknowns": [] - } - ] - } - ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [] } ], "dependency-audit": [ @@ -468,187 +285,77 @@ "unknowns": [] } ] - }, + } + ], + "dependency-management": [ + { + "auxiliary": {}, + "language": "JavaScript", + "units": [ + { + "answer": "yes", + "declared": [ + { + "manager": "npm packages", + "manifest": "package.json" + } + ], + "language": "JavaScript", + "lock_required": true, + "locked": [ + "package-lock.json" + ], + "unit": ".", + "unknowns": [] + } + ] + } + ], + "formatting": [ { "auxiliary": {}, - "language": "TypeScript", + "language": "JavaScript", "units": [ { "answer": "yes", "defined": {}, "known": { - "GitLab Dependency Scanning": { - "can": { - "runs": "GitLab Dependency Scanning (Security/Dependency-Scanning.gitlab-ci.yml)" - }, - "needs_definition": false, - "required": false - }, - "bun audit": { - "can": { - "runs": "bun audit" - }, - "needs_definition": false, - "required": false - }, - "npm audit": { - "can": { - "runs": "npm audit" - }, - "needs_definition": false, - "required": false - }, - "osv-scanner": { + "biome": { "can": { - "runs": "osv-scanner" + "apply": "biome format --write", + "check": "biome ci" }, "needs_definition": false, "required": false }, - "pnpm audit": { + "deno fmt": { "can": { - "runs": "pnpm audit" + "apply": "deno fmt", + "check": "deno fmt --check" }, "needs_definition": false, "required": false }, - "snyk": { + "dprint": { "can": { - "runs": "snyk test" + "apply": "dprint fmt", + "check": "dprint check" }, "needs_definition": false, "required": false }, - "trivy": { + "oxfmt": { "can": { - "runs": "trivy fs" + "apply": "oxfmt", + "check": "oxfmt --check" }, "needs_definition": false, "required": false }, - "yarn audit": { + "prettier": { "can": { - "runs": "yarn audit" - }, - "needs_definition": false, - "required": false - }, - "yarn npm audit": { - "can": { - "runs": "yarn npm audit" - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "runs", - "runs": { - "npm audit": { - "levels": [ - "runs" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] - } - ], - "dependency-management": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "yes", - "declared": [ - { - "manager": "npm packages", - "manifest": "package.json" - } - ], - "language": "JavaScript", - "lock_required": true, - "locked": [ - "package-lock.json" - ], - "unit": ".", - "unknowns": [] - } - ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "declared": [ - { - "manager": "npm packages", - "manifest": "package.json" - } - ], - "language": "TypeScript", - "lock_required": true, - "locked": [ - "package-lock.json" - ], - "unit": ".", - "unknowns": [] - } - ] - } - ], - "formatting": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "yes", - "defined": {}, - "known": { - "biome": { - "can": { - "apply": "biome format --write", - "check": "biome ci" - }, - "needs_definition": false, - "required": false - }, - "deno fmt": { - "can": { - "apply": "deno fmt", - "check": "deno fmt --check" - }, - "needs_definition": false, - "required": false - }, - "dprint": { - "can": { - "apply": "dprint fmt", - "check": "dprint check" - }, - "needs_definition": false, - "required": false - }, - "oxfmt": { - "can": { - "apply": "oxfmt", - "check": "oxfmt --check" - }, - "needs_definition": false, - "required": false - }, - "prettier": { - "can": { - "apply": "prettier --write .", - "check": "prettier --check ." + "apply": "prettier --write .", + "check": "prettier --check ." }, "needs_definition": false, "required": false @@ -669,71 +376,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": {}, - "known": { - "biome": { - "can": { - "apply": "biome format --write", - "check": "biome ci" - }, - "needs_definition": false, - "required": false - }, - "deno fmt": { - "can": { - "apply": "deno fmt", - "check": "deno fmt --check" - }, - "needs_definition": false, - "required": false - }, - "dprint": { - "can": { - "apply": "dprint fmt", - "check": "dprint check" - }, - "needs_definition": false, - "required": false - }, - "oxfmt": { - "can": { - "apply": "oxfmt", - "check": "oxfmt --check" - }, - "needs_definition": false, - "required": false - }, - "prettier": { - "can": { - "apply": "prettier --write .", - "check": "prettier --check ." - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "check", - "runs": { - "prettier": { - "levels": [ - "check" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "function-limits": [ @@ -782,52 +424,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": {}, - "known": { - "eslint's max-lines-per-function": { - "can": { - "limits": "eslint with max-lines-per-function on" - }, - "needs_definition": true, - "required": false - }, - "lizard": { - "can": { - "limits": "lizard --length 30" - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "limits", - "runs": { - "eslint's max-lines-per-function": { - "levels": [ - "measures" - ], - "read": [] - }, - "lizard": { - "levels": [ - "limits", - "measures" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "fuzz-testing": [ @@ -873,49 +469,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "language": "TypeScript", - "other_runs": [], - "property_files": [], - "tools": { - "answer": "yes", - "defined": { - "Jazzer.js": [ - "fuzz/add.fuzz.js" - ] - }, - "known": { - "Jazzer.js": { - "can": { - "runs": "npx jazzer -- -max_total_time=30 (or jest with JAZZER_FUZZ=1)" - }, - "needs_definition": true, - "required": false - } - }, - "language": "TypeScript", - "level": "runs", - "runs": { - "Jazzer.js": { - "levels": [ - "runs" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - }, - "unit": "." - } - ] } ], "hardening": [ @@ -923,34 +476,12 @@ "auxiliary": {}, "language": "JavaScript", "units": [] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [] } - ], - "license": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "yes", - "files": { - "LICENSE": [ - "MIT" - ] - }, - "language": "JavaScript", - "mismatches": [], - "unit": "." - } - ] - }, + ], + "license": [ { "auxiliary": {}, - "language": "TypeScript", + "language": "JavaScript", "units": [ { "answer": "yes", @@ -959,7 +490,7 @@ "MIT" ] }, - "language": "TypeScript", + "language": "JavaScript", "mismatches": [], "unit": "." } @@ -983,23 +514,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "TypeScript", - "level": "checked", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "migration-safety": [ @@ -1019,23 +533,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "TypeScript", - "level": "linted", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "mutation-testing": [ @@ -1076,44 +573,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": { - "StrykerJS": [ - "stryker.config.json" - ] - }, - "known": { - "StrykerJS": { - "can": { - "incremental": "stryker run --incremental", - "runs": "stryker run" - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "runs", - "runs": { - "StrykerJS": { - "levels": [ - "incremental", - "runs" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "out-of-source-build": [ @@ -1121,11 +580,6 @@ "auxiliary": {}, "language": "JavaScript", "units": [] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [] } ], "platforms": [ @@ -1173,51 +627,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "axis": "runtime version", - "language": "TypeScript", - "notes": [], - "platforms": [ - { - "configurations": [], - "os": "linux", - "runtime version": "22" - }, - { - "configurations": [], - "os": "linux", - "runtime version": "24" - }, - { - "configurations": [], - "os": "macos", - "runtime version": "22" - }, - { - "configurations": [], - "os": "macos", - "runtime version": "24" - }, - { - "configurations": [], - "os": "windows", - "runtime version": "22" - }, - { - "configurations": [], - "os": "windows", - "runtime version": "24" - } - ], - "unit": "." - } - ] } ], "sanitizers": [ @@ -1225,11 +634,6 @@ "auxiliary": {}, "language": "JavaScript", "units": [] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [] } ], "schema-compatibility": [ @@ -1249,23 +653,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "TypeScript", - "level": "breaking", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "schema-declared": [], @@ -1285,154 +672,49 @@ "unknown_definitions": [], "unknowns": [] } - ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "TypeScript", - "level": "checked", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] - } - ], - "schema-validation": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "JavaScript", - "level": "validates", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "impossible", - "defined": {}, - "known": {}, - "language": "TypeScript", - "level": "validates", - "runs": {}, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] - } - ], - "secret-scanning": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "yes", - "configured": [], - "language": "JavaScript", - "scanners": [ - "gitleaks" - ], - "unit": "." - } - ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "configured": [], - "language": "TypeScript", - "scanners": [ - "gitleaks" - ], - "unit": "." - } - ] - } - ], - "security-scanning": [ - { - "auxiliary": {}, - "language": "JavaScript", - "units": [ - { - "answer": "yes", - "defined": {}, - "known": { - "CodeQL": { - "can": { - "scans": "CodeQL (github/codeql-action)" - }, - "needs_definition": false, - "required": false - }, - "GitLab SAST": { - "can": { - "scans": "GitLab SAST (Security/SAST.gitlab-ci.yml)" - }, - "needs_definition": false, - "required": false - }, - "eslint-plugin-security": { - "can": { - "scans": "eslint with eslint-plugin-security" - }, - "needs_definition": false, - "required": false - }, - "semgrep": { - "can": { - "scans": "semgrep ci" - }, - "needs_definition": false, - "required": false - } - }, + ] + } + ], + "schema-validation": [ + { + "auxiliary": {}, + "language": "JavaScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, "language": "JavaScript", - "level": "scans", - "runs": { - "eslint-plugin-security": { - "levels": [ - "scans" - ], - "read": [ - "eslint.config.js", - "package.json" - ] - } - }, + "level": "validates", + "runs": {}, "unit": ".", "unknown_definitions": [], "unknowns": [] } ] - }, + } + ], + "secret-scanning": [ + { + "auxiliary": {}, + "language": "JavaScript", + "units": [ + { + "answer": "yes", + "configured": [], + "language": "JavaScript", + "scanners": [ + "gitleaks" + ], + "unit": "." + } + ] + } + ], + "security-scanning": [ { "auxiliary": {}, - "language": "TypeScript", + "language": "JavaScript", "units": [ { "answer": "yes", @@ -1467,7 +749,7 @@ "required": false } }, - "language": "TypeScript", + "language": "JavaScript", "level": "scans", "runs": { "eslint-plugin-security": { @@ -1551,70 +833,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": { - "eslint": [ - "eslint.config.js" - ] - }, - "known": { - "biome": { - "can": { - "checks": "biome lint" - }, - "needs_definition": false, - "required": false - }, - "deno lint": { - "can": { - "checks": "deno lint" - }, - "needs_definition": false, - "required": false - }, - "eslint": { - "can": { - "checks": "eslint" - }, - "needs_definition": false, - "required": false - }, - "oxlint": { - "can": { - "checks": "oxlint" - }, - "needs_definition": false, - "required": false - }, - "xo": { - "can": { - "checks": "xo" - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "checks", - "runs": { - "eslint": { - "levels": [ - "checks" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "tests": [ @@ -1626,7 +844,7 @@ "answer": "yes", "defined": { "a JavaScript test runner": [ - "src/add.test.ts" + "src/add.test.js" ] }, "known": { @@ -1653,42 +871,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": { - "a JavaScript test runner": [ - "src/add.test.ts" - ] - }, - "known": { - "a JavaScript test runner": { - "can": { - "runs": "jest, vitest, mocha, node --test, deno test, bun test or playwright (or npm test)" - }, - "needs_definition": true, - "required": false - } - }, - "language": "TypeScript", - "level": "runs", - "runs": { - "a JavaScript test runner": { - "levels": [ - "runs" - ], - "read": [] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] } ], "top-level-guard": [ @@ -1696,11 +878,6 @@ "auxiliary": {}, "language": "JavaScript", "units": [] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [] } ], "type-checking": [ @@ -1709,91 +886,12 @@ "language": "JavaScript", "units": [ { - "answer": "yes", - "defined": { - "tsc": [ - "tsconfig.json" - ] - }, - "known": { - "deno check": { - "can": { - "checks": "deno check", - "strict": "deno check (strict by default)" - }, - "needs_definition": false, - "required": false - }, - "tsc": { - "can": { - "checks": "tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json)", - "strict": "\"strict\": true in the compilerOptions of tsconfig.json" - }, - "needs_definition": false, - "required": false - } - }, + "answer": "impossible", + "defined": {}, + "known": {}, "language": "JavaScript", "level": "checks", - "runs": { - "tsc": { - "levels": [ - "checks", - "strict" - ], - "read": [ - "tsconfig.json" - ] - } - }, - "unit": ".", - "unknown_definitions": [], - "unknowns": [] - } - ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "defined": { - "tsc": [ - "tsconfig.json" - ] - }, - "known": { - "deno check": { - "can": { - "checks": "deno check", - "strict": "deno check (strict by default)" - }, - "needs_definition": false, - "required": false - }, - "tsc": { - "can": { - "checks": "tsc --noEmit (JavaScript is checked with checkJs in a jsconfig.json)", - "strict": "\"strict\": true in the compilerOptions of tsconfig.json" - }, - "needs_definition": false, - "required": false - } - }, - "language": "TypeScript", - "level": "checks", - "runs": { - "tsc": { - "levels": [ - "checks", - "strict" - ], - "read": [ - "tsconfig.json" - ] - } - }, + "runs": {}, "unit": ".", "unknown_definitions": [], "unknowns": [] @@ -1817,22 +915,6 @@ "unit": "." } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "language": "TypeScript", - "outputs": { - "node_modules": { - ".gitignore": "node_modules/" - } - }, - "unit": "." - } - ] } ], "warnings-as-errors": [ @@ -1862,33 +944,6 @@ "unknowns": [] } ] - }, - { - "auxiliary": {}, - "language": "TypeScript", - "units": [ - { - "answer": "yes", - "compilers": [ - { - "compiler": null, - "found": { - "eslint --max-warnings 0": [ - "CI (package.json)" - ] - }, - "missing": [ - "biome ci", - "deno lint" - ] - } - ], - "language": "TypeScript", - "practice": "warnings-as-errors", - "unit": ".", - "unknowns": [] - } - ] } ], "wellformed": [ @@ -1902,8 +957,7 @@ "parsed": [ "package-lock.json", "package.json", - "stryker.config.json", - "tsconfig.json" + "stryker.config.json" ], "problems": [], "test_data": [], @@ -1945,7 +999,7 @@ }, "ci-build-types": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "ci-lint": { @@ -1975,7 +1029,12 @@ }, "compile-commands": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", + "status": "SKIP" + }, + "compiler-extensions": { + "details": [], + "message": "not applicable to JavaScript", "status": "SKIP" }, "compiler-warnings": { @@ -1995,14 +1054,9 @@ "message": "branch coverage is reported with Vitest", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to JavaScript, TypeScript", - "status": "SKIP" - }, "data-wellformed": { "details": [], - "message": "JSON: 4 JSON files parse; YAML: 5 YAML files parse", + "message": "JSON: 3 JSON files parse; YAML: 5 YAML files parse", "status": "PASS" }, "dependency-audit": { @@ -2034,7 +1088,7 @@ }, "hardening": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "large-files": { @@ -2051,12 +1105,12 @@ }, "link-check": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "migration-safety": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "mutation-testing": { @@ -2066,7 +1120,7 @@ }, "out-of-source-build": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "platform-matrix": { @@ -2086,27 +1140,27 @@ }, "sanitizers": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "schema-compatibility": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "schema-declared": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "schema-examples": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "schema-validation": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "secret-scanning": { @@ -2141,13 +1195,13 @@ }, "top-level-guard": { "details": [], - "message": "not applicable to JavaScript, TypeScript", + "message": "not applicable to JavaScript", "status": "SKIP" }, "type-checking": { "details": [], - "message": "tsc (tsconfig.json) runs; strict mode bonus: tsc (tsconfig.json)", - "status": "PASS" + "message": "not applicable to JavaScript", + "status": "SKIP" }, "vcs-ignore": { "details": [], diff --git a/tests/snapshots/well_configured_json_schema.json b/tests/snapshots/well_configured_json_schema.json index 8a040aa2..4edd4a12 100644 --- a/tests/snapshots/well_configured_json_schema.json +++ b/tests/snapshots/well_configured_json_schema.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -345,6 +345,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -360,11 +365,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 4 JSON files parse; YAML: 4 YAML files parse", diff --git a/tests/snapshots/well_configured_julia.json b/tests/snapshots/well_configured_julia.json index 08bba678..57165201 100644 --- a/tests/snapshots/well_configured_julia.json +++ b/tests/snapshots/well_configured_julia.json @@ -113,6 +113,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Julia", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -198,13 +205,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Julia", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -831,6 +831,11 @@ "message": "not applicable to Julia", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Julia", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Aqua.jl checks are enabled: Aqua.test_all", @@ -848,11 +853,6 @@ "message": "line coverage is reported with julia --code-coverage", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Julia", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "TOML: 2 TOML files parse; YAML: 4 YAML files parse", diff --git a/tests/snapshots/well_configured_jupyter.json b/tests/snapshots/well_configured_jupyter.json index a06d395a..c9154b9e 100644 --- a/tests/snapshots/well_configured_jupyter.json +++ b/tests/snapshots/well_configured_jupyter.json @@ -17,9 +17,9 @@ } ], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -282,6 +282,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -297,11 +302,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "Data: TOML: 1 TOML file parses; YAML: 4 YAML files parse; Jupyter: 1 Jupyter file parses", diff --git a/tests/snapshots/well_configured_jvm.json b/tests/snapshots/well_configured_jvm.json index 340bf5ee..fe37dd04 100644 --- a/tests/snapshots/well_configured_jvm.json +++ b/tests/snapshots/well_configured_jvm.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Java", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -181,13 +188,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Java", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -983,6 +983,11 @@ "message": "not applicable to Java", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Java", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict JVM compiler warnings are enabled: -Xlint:all", @@ -1000,11 +1005,6 @@ "message": "branch coverage is reported with JaCoCo", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Java", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "XML: 1 XML file parses; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_kubernetes.json b/tests/snapshots/well_configured_kubernetes.json index 006a1584..32ff83a1 100644 --- a/tests/snapshots/well_configured_kubernetes.json +++ b/tests/snapshots/well_configured_kubernetes.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -394,6 +394,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -409,11 +414,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [ "2 YAML files not parsed, a template, rendered before it is read" diff --git a/tests/snapshots/well_configured_latex.json b/tests/snapshots/well_configured_latex.json index 1ab84759..56c0fa11 100644 --- a/tests/snapshots/well_configured_latex.json +++ b/tests/snapshots/well_configured_latex.json @@ -83,6 +83,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "LaTeX", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -162,13 +169,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "LaTeX", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -687,6 +687,11 @@ "message": "not applicable to LaTeX", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to LaTeX", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict LaTeX lints are enabled: chktex", @@ -702,11 +707,6 @@ "message": "not applicable to LaTeX", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to LaTeX", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_lua.json b/tests/snapshots/well_configured_lua.json index a1f7fe10..1ea0e6df 100644 --- a/tests/snapshots/well_configured_lua.json +++ b/tests/snapshots/well_configured_lua.json @@ -98,6 +98,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Lua", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -185,13 +192,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Lua", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -861,6 +861,11 @@ "message": "not applicable to Lua", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Lua", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Lua linters are enabled: luacheck", @@ -878,11 +883,6 @@ "message": "line coverage is reported with luacov", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Lua", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 1 JSON file parses; TOML: 1 TOML file parses; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_nix.json b/tests/snapshots/well_configured_nix.json index 6a124f30..c851db93 100644 --- a/tests/snapshots/well_configured_nix.json +++ b/tests/snapshots/well_configured_nix.json @@ -93,6 +93,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Nix", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -175,13 +182,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Nix", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -759,6 +759,11 @@ "message": "not applicable to Nix", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Nix", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Nix lints are enabled: statix, deadnix", @@ -774,11 +779,6 @@ "message": "not applicable to Nix", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Nix", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_ocaml.json b/tests/snapshots/well_configured_ocaml.json index c7296725..c5303c77 100644 --- a/tests/snapshots/well_configured_ocaml.json +++ b/tests/snapshots/well_configured_ocaml.json @@ -83,6 +83,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "OCaml", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -168,13 +175,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "OCaml", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -742,6 +742,11 @@ "message": "not applicable to OCaml", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to OCaml", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict OCaml warning settings are enabled: dune's dev profile warning set (or -w +a)", @@ -759,11 +764,6 @@ "message": "branch coverage is reported with bisect_ppx", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to OCaml", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_openapi.json b/tests/snapshots/well_configured_openapi.json index ba3e3268..68179d16 100644 --- a/tests/snapshots/well_configured_openapi.json +++ b/tests/snapshots/well_configured_openapi.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -378,6 +378,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -393,11 +398,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "6 YAML files parse", diff --git a/tests/snapshots/well_configured_perl.json b/tests/snapshots/well_configured_perl.json index 2b14756c..3541192b 100644 --- a/tests/snapshots/well_configured_perl.json +++ b/tests/snapshots/well_configured_perl.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Perl", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -188,13 +195,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Perl", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -807,6 +807,11 @@ "message": "not applicable to Perl", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Perl", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Perl pragmas and lints are enabled: use strict and use warnings in every module, perlcritic", @@ -824,11 +829,6 @@ "message": "branch coverage is reported with Devel::Cover; path coverage bonus: reported with Devel::Cover", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Perl", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_php.json b/tests/snapshots/well_configured_php.json index 9f2d100d..5fe15d93 100644 --- a/tests/snapshots/well_configured_php.json +++ b/tests/snapshots/well_configured_php.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "PHP", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -185,13 +192,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "PHP", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -997,6 +997,11 @@ "message": "not applicable to PHP", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to PHP", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict PHP error reporting settings are enabled: error_reporting = E_ALL", @@ -1014,11 +1019,6 @@ "message": "branch coverage is reported with PHPUnit; path coverage bonus: reported with PHPUnit", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to PHP", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 1 JSON file parses; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_protobuf.json b/tests/snapshots/well_configured_protobuf.json index a978d014..d441b4b0 100644 --- a/tests/snapshots/well_configured_protobuf.json +++ b/tests/snapshots/well_configured_protobuf.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -276,6 +276,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -291,11 +296,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_python.json b/tests/snapshots/well_configured_python.json index f079fd93..b126ba4c 100644 --- a/tests/snapshots/well_configured_python.json +++ b/tests/snapshots/well_configured_python.json @@ -98,6 +98,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Python", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -187,13 +194,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Python", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1017,6 +1017,11 @@ "message": "not applicable to Python", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Python", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Python warning settings are enabled: -W error", @@ -1035,11 +1040,6 @@ "message": "branch coverage is measured with coverage.py", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Python", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "TOML: 1 TOML file parses; YAML: 5 YAML files parse", diff --git a/tests/snapshots/well_configured_r.json b/tests/snapshots/well_configured_r.json index 44bd7acc..99da7b47 100644 --- a/tests/snapshots/well_configured_r.json +++ b/tests/snapshots/well_configured_r.json @@ -103,6 +103,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "R", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -191,13 +198,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "R", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -797,6 +797,11 @@ "message": "not applicable to R", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to R", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict R lints are enabled: lintr, failing on lints (LINTR_ERROR_ON_LINT)", @@ -814,11 +819,6 @@ "message": "line coverage is reported with covr", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to R", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_racket.json b/tests/snapshots/well_configured_racket.json index 73283144..b320ea5b 100644 --- a/tests/snapshots/well_configured_racket.json +++ b/tests/snapshots/well_configured_racket.json @@ -83,6 +83,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Racket", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -149,13 +156,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Racket", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -691,6 +691,11 @@ "message": "not applicable to Racket", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Racket", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Racket", @@ -708,11 +713,6 @@ "message": "statement coverage is reported with raco cover", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Racket", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_ruby.json b/tests/snapshots/well_configured_ruby.json index ee024286..d324db4e 100644 --- a/tests/snapshots/well_configured_ruby.json +++ b/tests/snapshots/well_configured_ruby.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Ruby", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -182,13 +189,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Ruby", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -955,6 +955,11 @@ "message": "not applicable to Ruby", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Ruby", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Ruby warning settings are enabled: Ruby warnings, RuboCop or Standard", @@ -972,11 +977,6 @@ "message": "branch coverage is reported with SimpleCov", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Ruby", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "7 YAML files parse", diff --git a/tests/snapshots/well_configured_rust.json b/tests/snapshots/well_configured_rust.json index c905f6db..e50e34e0 100644 --- a/tests/snapshots/well_configured_rust.json +++ b/tests/snapshots/well_configured_rust.json @@ -103,6 +103,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Rust", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -217,13 +224,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Rust", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1039,6 +1039,11 @@ "message": "not applicable to Rust", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Rust", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Rust lint settings are enabled: cargo clippy -D warnings clippy::pedantic", @@ -1056,11 +1061,6 @@ "message": "branch coverage is reported with cargo-llvm-cov; path coverage bonus: reported with cargo-llvm-cov", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Rust", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "TOML: 1 TOML file parses; YAML: 6 YAML files parse", diff --git a/tests/snapshots/well_configured_scala.json b/tests/snapshots/well_configured_scala.json index 7cb22e41..f2f504be 100644 --- a/tests/snapshots/well_configured_scala.json +++ b/tests/snapshots/well_configured_scala.json @@ -93,6 +93,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Scala", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -193,13 +200,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Scala", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -859,6 +859,11 @@ "message": "not applicable to Scala", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Scala", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict scalac warning options are enabled: -deprecation, -feature, -Xlint or -Wunused", @@ -876,11 +881,6 @@ "message": "branch coverage is reported with scoverage", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Scala", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/snapshots/well_configured_shell.json b/tests/snapshots/well_configured_shell.json index f423c212..fbf60de4 100644 --- a/tests/snapshots/well_configured_shell.json +++ b/tests/snapshots/well_configured_shell.json @@ -178,6 +178,18 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "PowerShell", + "units": [] + }, + { + "auxiliary": {}, + "language": "Shell", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -344,18 +356,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "PowerShell", - "units": [] - }, - { - "auxiliary": {}, - "language": "Shell", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -1292,6 +1292,11 @@ "message": "not applicable to PowerShell, Shell", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to PowerShell, Shell", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "PowerShell: strict PowerShell lints are enabled: PSScriptAnalyzer; Shell: strict shell lints are enabled: shellcheck", @@ -1310,11 +1315,6 @@ "message": "PowerShell: statement coverage is reported with Pester; Shell: line coverage is reported with kcov", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to PowerShell, Shell", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_sql.json b/tests/snapshots/well_configured_sql.json index 9f08816d..deffe307 100644 --- a/tests/snapshots/well_configured_sql.json +++ b/tests/snapshots/well_configured_sql.json @@ -83,6 +83,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "SQL", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -143,13 +150,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "SQL", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -799,6 +799,11 @@ "message": "not applicable to SQL", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to SQL", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to SQL", @@ -814,11 +819,6 @@ "message": "not applicable to SQL", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to SQL", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "9 YAML files parse", diff --git a/tests/snapshots/well_configured_swift.json b/tests/snapshots/well_configured_swift.json index 36efba86..74c166f9 100644 --- a/tests/snapshots/well_configured_swift.json +++ b/tests/snapshots/well_configured_swift.json @@ -103,6 +103,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Swift", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -195,13 +202,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Swift", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -992,6 +992,11 @@ "message": "not applicable to Swift", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Swift", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "strict Swift warning settings are enabled: SwiftLint, complete concurrency checking", @@ -1010,11 +1015,6 @@ "message": "region coverage is measured with swift test", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Swift", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "8 YAML files parse", diff --git a/tests/snapshots/well_configured_tabular_data.json b/tests/snapshots/well_configured_tabular_data.json index c7d5e8ac..a9f92d78 100644 --- a/tests/snapshots/well_configured_tabular_data.json +++ b/tests/snapshots/well_configured_tabular_data.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [], @@ -196,6 +196,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -211,11 +216,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "JSON: 1 JSON file parses; YAML: 4 YAML files parse", diff --git a/tests/snapshots/well_configured_terraform.json b/tests/snapshots/well_configured_terraform.json index 1f5df44e..4adbfa73 100644 --- a/tests/snapshots/well_configured_terraform.json +++ b/tests/snapshots/well_configured_terraform.json @@ -93,6 +93,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Terraform", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -153,13 +160,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Terraform", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -812,6 +812,11 @@ "message": "not applicable to Terraform", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Terraform", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Terraform", @@ -827,11 +832,6 @@ "message": "not applicable to Terraform", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Terraform", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_typescript.facts.json b/tests/snapshots/well_configured_typescript.facts.json new file mode 100644 index 00000000..fe6b20a1 --- /dev/null +++ b/tests/snapshots/well_configured_typescript.facts.json @@ -0,0 +1,3994 @@ +{ + "facts": [ + { + "kind": "AuxiliaryCode", + "named": [], + "origin": "." + }, + { + "build_system": "npm", + "kind": "BuildFile", + "languages": [ + "JavaScript" + ], + "origin": "package.json" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/dependabot.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/ci-lint.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/ci.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/copy-paste-detection.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "YAML", + "origin": ".github/workflows/function-limits.yml", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": null, + "origin": "eslint.config.js", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "TypeScript", + "origin": "fuzz/add.fuzz.ts", + "role": "test" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "JSON", + "origin": "package-lock.json", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "JSON", + "origin": "package.json", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "TypeScript", + "origin": "src/add.test.ts", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "TypeScript", + "origin": "src/add.ts", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "JSON", + "origin": "stryker.config.json", + "role": "product" + }, + { + "ambiguous": false, + "kind": "SourceFile", + "language": "JSON", + "origin": "tsconfig.json", + "role": "product" + }, + { + "build_systems": [ + "npm" + ], + "formats": [ + "JSON", + "YAML" + ], + "kind": "Unit", + "languages": [ + "TypeScript" + ], + "origin": ".", + "role": "product" + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/dependabot.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/ci-lint.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/ci.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/copy-paste-detection.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "YAML", + "kind": "DataFile", + "line": null, + "origin": ".github/workflows/function-limits.yml", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "JSON", + "kind": "DataFile", + "line": null, + "origin": "package-lock.json", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "JSON", + "kind": "DataFile", + "line": null, + "origin": "package.json", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "JSON", + "kind": "DataFile", + "line": null, + "origin": "stryker.config.json", + "problem": null, + "role": "product", + "unread": null + }, + { + "column": null, + "format": "JSON", + "kind": "DataFile", + "line": null, + "origin": "tsconfig.json", + "problem": null, + "role": "product", + "unread": null + }, + { + "kind": "Jazzer.js fuzz targets (an exported fuzz function or .fuzz())", + "language": "TypeScript", + "origin": "fuzz/add.fuzz.ts" + }, + { + "kind": "*.test.*, *.spec.*, __tests__/ or test/ files", + "language": "TypeScript", + "origin": "src/add.test.ts" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/ci-lint.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/ci.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/copy-paste-detection.yml", + "provider": "GitHub Actions" + }, + { + "kind": "CiConfiguration", + "origin": ".github/workflows/function-limits.yml", + "provider": "GitHub Actions" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci-lint.yml:ci-lint", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "ci-lint", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "ActionStep", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "pipx", + "run", + "zizmor", + ".github" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "pipx run zizmor .github", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run", + "via": [] + }, + { + "argv": [ + "zizmor", + ".github" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "pipx run zizmor .github", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run", + "via": [ + ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[1].run" + ] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "ActionStep", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[2]", + "uses": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "argv": [ + "actionlint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[2]", + "via": [] + }, + { + "argv": [ + "gitleaks", + "git", + "--redact", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Command", + "line": "gitleaks git --redact .", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint.steps[3].run", + "via": [] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci-lint.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci-lint.yml", + "reference": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[0]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "22", + "os": "ubuntu-latest" + }, + "name": "test (ubuntu-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "22" + }, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[1]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "24", + "os": "ubuntu-latest" + }, + "name": "test (ubuntu-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "24" + }, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[2]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "22", + "os": "macos-latest" + }, + "name": "test (macos-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "22" + }, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[3]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "24", + "os": "macos-latest" + }, + "name": "test (macos-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "24" + }, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[4]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "22", + "os": "windows-latest" + }, + "name": "test (windows-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "22" + }, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/ci.yml:test[5]", + "image": null, + "kind": "CiJob", + "matrix": { + "node": "24", + "os": "windows-latest" + }, + "name": "test (windows-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "condition": null, + "inputs": { + "node-version": "24" + }, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ActionStep", + "origin": ".github/workflows/ci.yml:jobs.test.steps[1]", + "uses": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "argv": [ + "npm", + "ci" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm ci", + "origin": ".github/workflows/ci.yml:jobs.test.steps[2].run", + "via": [] + }, + { + "argv": [ + "npm", + "run", + "format:check" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm run format:check", + "origin": ".github/workflows/ci.yml:jobs.test.steps[3].run", + "via": [] + }, + { + "argv": [ + "prettier", + "--check", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "prettier --check .", + "origin": "package.json:scripts.format:check", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "argv": [ + "npm", + "run", + "lint" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm run lint", + "origin": ".github/workflows/ci.yml:jobs.test.steps[4].run", + "via": [] + }, + { + "argv": [ + "eslint", + "--max-warnings", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "eslint --max-warnings 0 .", + "origin": "package.json:scripts.lint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "argv": [ + "npm", + "run", + "typecheck" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm run typecheck", + "origin": ".github/workflows/ci.yml:jobs.test.steps[5].run", + "via": [] + }, + { + "argv": [ + "tsc", + "--noEmit" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "tsc --noEmit", + "origin": "package.json:scripts.typecheck", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "argv": [ + "npm", + "test" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm test", + "origin": ".github/workflows/ci.yml:jobs.test.steps[6].run", + "via": [] + }, + { + "argv": [ + "vitest", + "run", + "--coverage" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "vitest run --coverage", + "origin": "package.json:scripts.test", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "argv": [ + "npm", + "audit", + "--audit-level=moderate" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npm audit --audit-level=moderate", + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "via": [] + }, + { + "argv": [ + "npx", + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [] + }, + { + "argv": [ + "stryker", + "run", + "--incremental" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npx stryker run --incremental", + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "argv": [ + "npx", + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [] + }, + { + "argv": [ + "jazzer", + "fuzz/add.fuzz.ts", + "--", + "-max_total_time=30" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Command", + "line": "npx jazzer fuzz/add.fuzz.ts -- -max_total_time=30", + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "kind": "StepReference", + "origin": ".github/workflows/ci.yml", + "reference": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/copy-paste-detection.yml:copy-paste-detection", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "copy-paste-detection", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/copy-paste-detection.yml:copy-paste-detection", + "kind": "ActionStep", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "npx", + "--yes", + "jscpd@4", + "--threshold", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/copy-paste-detection.yml:copy-paste-detection", + "kind": "Command", + "line": "npx --yes jscpd@4 --threshold 0 .", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection.steps[1].run", + "via": [] + }, + { + "argv": [ + "jscpd@4", + "--threshold", + "0", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/copy-paste-detection.yml:copy-paste-detection", + "kind": "Command", + "line": "npx --yes jscpd@4 --threshold 0 .", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection.steps[1].run", + "via": [ + ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection.steps[1].run" + ] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/copy-paste-detection.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "builds": true, + "env": {}, + "heuristic": false, + "id": ".github/workflows/function-limits.yml:function-limits", + "image": null, + "kind": "CiJob", + "matrix": {}, + "name": "function-limits", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits", + "os": "linux", + "provider": "GitHub Actions", + "services": [] + }, + { + "condition": null, + "inputs": {}, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "ActionStep", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits.steps[0]", + "uses": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "argv": [ + "python", + "-m", + "pip", + "install", + "lizard" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "Command", + "line": "python -m pip install lizard", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits.steps[1].run", + "via": [] + }, + { + "argv": [ + "pip", + "install", + "lizard" + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "Command", + "line": "python -m pip install lizard", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits.steps[1].run", + "via": [ + ".github/workflows/function-limits.yml:jobs.function-limits.steps[1].run" + ] + }, + { + "argv": [ + "lizard", + "--length", + "30", + "--warnings_only", + "." + ], + "condition": null, + "directory": null, + "env": {}, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "Command", + "line": "lizard --length 30 --warnings_only .", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits.steps[2].run", + "via": [] + }, + { + "kind": "StepReference", + "origin": ".github/workflows/function-limits.yml", + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [], + "heuristic": false, + "job": ".github/workflows/ci-lint.yml:ci-lint", + "kind": "Job", + "name": ".github/workflows/ci-lint.yml: ci-lint", + "origin": ".github/workflows/ci-lint.yml:jobs.ci-lint", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "22" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (ubuntu-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "linux", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "24" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "22" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (macos-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "macos", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "24" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, 22)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "22" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "TypeScript" + ], + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "Job", + "name": ".github/workflows/ci.yml: test (windows-latest, 24)", + "origin": ".github/workflows/ci.yml:jobs.test", + "os": "windows", + "services": [], + "toolchains": [ + { + "language": "JavaScript runtime", + "version": "24" + } + ] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [], + "heuristic": false, + "job": ".github/workflows/copy-paste-detection.yml:copy-paste-detection", + "kind": "Job", + "name": ".github/workflows/copy-paste-detection.yml: copy-paste-detection", + "origin": ".github/workflows/copy-paste-detection.yml:jobs.copy-paste-detection", + "os": "linux", + "services": [], + "toolchains": [] + }, + { + "compilers": [], + "configurations": [], + "default_compiler": false, + "ecosystems": [ + "Python" + ], + "heuristic": false, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "Job", + "name": ".github/workflows/function-limits.yml: function-limits", + "origin": ".github/workflows/function-limits.yml:jobs.function-limits", + "os": "linux", + "services": [], + "toolchains": [ + { + "language": "Python", + "version": "default" + } + ] + }, + { + "kind": "ConfigurationFile", + "origin": ".gitignore", + "reader": ".gitignore entries" + }, + { + "kind": "IgnoreEntry", + "origin": ".gitignore", + "pattern": "node_modules/", + "syntax": "glob", + "written": "node_modules/" + }, + { + "kind": "IgnoreEntry", + "origin": ".gitignore", + "pattern": "coverage/", + "syntax": "glob", + "written": "coverage/" + }, + { + "kind": "IgnoreEntry", + "origin": ".gitignore", + "pattern": "dist/", + "syntax": "glob", + "written": "dist/" + }, + { + "kind": "ConfigurationFile", + "origin": "LICENSE", + "reader": "license files" + }, + { + "kind": "LicenseFile", + "licenses": [ + "MIT" + ], + "origin": "LICENSE" + }, + { + "kind": "ConfigurationFile", + "origin": "eslint.config.js", + "reader": "graphql-eslint" + }, + { + "kind": "ConfigurationFile", + "origin": "eslint.config.js", + "reader": "eslint" + }, + { + "kind": "ConfigurationFile", + "origin": "eslint.config.js", + "reader": "eslint rules" + }, + { + "heuristic": true, + "key": "security plugin", + "kind": "Setting", + "origin": "eslint.config.js:security plugin", + "tool": "eslint", + "value": true + }, + { + "kind": "ConfigurationFile", + "origin": "package-lock.json", + "reader": "npm packages lockfile" + }, + { + "kind": "Locked", + "manager": "npm packages", + "origin": "package-lock.json" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "graphql-eslint" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json prettier" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "Jest" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json dependencies" + }, + { + "kind": "Declared", + "manager": "npm packages", + "origin": "package.json" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "package.json license" + }, + { + "expression": "MIT", + "kind": "DeclaredLicense", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json" + }, + { + "kind": "ConfigurationFile", + "origin": "package.json", + "reader": "eslint rules" + }, + { + "heuristic": true, + "key": "security plugin", + "kind": "Setting", + "origin": "package.json:security plugin", + "tool": "eslint", + "value": true + }, + { + "kind": "ConfigurationFile", + "origin": "stryker.config.json", + "reader": "StrykerJS" + }, + { + "kind": "ConfigurationFile", + "origin": "tsconfig.json", + "reader": "TypeScript" + }, + { + "heuristic": false, + "key": "compilerOptions.target", + "kind": "Setting", + "origin": "tsconfig.json:compilerOptions.target", + "tool": "TypeScript", + "value": "es2022" + }, + { + "heuristic": false, + "key": "compilerOptions.module", + "kind": "Setting", + "origin": "tsconfig.json:compilerOptions.module", + "tool": "TypeScript", + "value": "nodenext" + }, + { + "heuristic": false, + "key": "compilerOptions.strict", + "kind": "Setting", + "origin": "tsconfig.json:compilerOptions.strict", + "tool": "TypeScript", + "value": true + }, + { + "heuristic": false, + "key": "compilerOptions.outDir", + "kind": "Setting", + "origin": "tsconfig.json:compilerOptions.outDir", + "tool": "TypeScript", + "value": "dist" + }, + { + "heuristic": false, + "key": "include", + "kind": "Setting", + "origin": "tsconfig.json:include", + "tool": "TypeScript", + "value": [ + "src" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[0]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[1]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[2]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[3]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[4]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.format:check", + "provides": { + "format": [ + "check" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "prettier", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[3].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "analysis": [ + "checks" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": true, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "security": [ + "scans" + ] + }, + "read": [ + "eslint.config.js", + "package.json" + ], + "scope": [ + "." + ], + "tool": "eslint-plugin-security", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.lint", + "provides": { + "function-length": [ + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "eslint's max-lines-per-function", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[4].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "TypeScript" + ], + "origin": "package.json:scripts.typecheck", + "provides": { + "type-check": [ + "checks", + "strict" + ] + }, + "read": [ + "tsconfig.json" + ], + "scope": [ + "." + ], + "tool": "tsc", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[5].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "test": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "a JavaScript test runner", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": "package.json:scripts.test", + "provides": { + "coverage": [ + "branch reported", + "branch", + "line reported", + "line" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Vitest", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[6].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[7].run", + "provides": { + "audit": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "npm audit", + "via": [] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[8].run", + "provides": { + "mutation": [ + "incremental", + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "StrykerJS", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[8].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/ci.yml:test[5]", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/ci.yml:jobs.test.steps[9].run", + "provides": { + "fuzz": [ + "runs" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "Jazzer.js", + "via": [ + ".github/workflows/ci.yml:jobs.test.steps[9].run" + ] + }, + { + "heuristic": false, + "job": ".github/workflows/function-limits.yml:function-limits", + "kind": "ToolRun", + "languages": [ + "JavaScript", + "TypeScript" + ], + "origin": ".github/workflows/function-limits.yml:jobs.function-limits.steps[2].run", + "provides": { + "function-length": [ + "limits", + "measures" + ] + }, + "read": [], + "scope": [ + "." + ], + "tool": "lizard", + "via": [] + } + ], + "map": { + "build_systems": [ + "npm" + ], + "ci": { + "files": [ + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/copy-paste-detection.yml", + ".github/workflows/function-limits.yml" + ], + "jobs": [ + { + "compilers": [], + "configurations": [], + "ecosystems": [], + "name": ".github/workflows/ci-lint.yml: ci-lint", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, 22)", + "os": "linux", + "toolchains": [ + "JavaScript runtime 22" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (ubuntu-latest, 24)", + "os": "linux", + "toolchains": [ + "JavaScript runtime 24" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, 22)", + "os": "macos", + "toolchains": [ + "JavaScript runtime 22" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (macos-latest, 24)", + "os": "macos", + "toolchains": [ + "JavaScript runtime 24" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, 22)", + "os": "windows", + "toolchains": [ + "JavaScript runtime 22" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "TypeScript" + ], + "name": ".github/workflows/ci.yml: test (windows-latest, 24)", + "os": "windows", + "toolchains": [ + "JavaScript runtime 24" + ] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [], + "name": ".github/workflows/copy-paste-detection.yml: copy-paste-detection", + "os": "linux", + "toolchains": [] + }, + { + "compilers": [], + "configurations": [], + "ecosystems": [ + "Python" + ], + "name": ".github/workflows/function-limits.yml: function-limits", + "os": "linux", + "toolchains": [ + "Python default" + ] + } + ], + "providers": [ + "GitHub Actions" + ] + }, + "ecosystems": { + "Data": [ + ".json files", + ".yml files" + ], + "TypeScript": [ + ".ts files" + ] + }, + "formats": [ + "JSON", + "YAML" + ], + "languages": [ + "TypeScript" + ], + "units": [ + { + "build_systems": [ + "npm" + ], + "directory": ".", + "formats": [ + "JSON", + "YAML" + ], + "languages": [ + "TypeScript" + ], + "role": "product" + } + ], + "unrecognised_suffixes": [] + } +} diff --git a/tests/snapshots/well_configured_typescript.json b/tests/snapshots/well_configured_typescript.json new file mode 100644 index 00000000..d9478d18 --- /dev/null +++ b/tests/snapshots/well_configured_typescript.json @@ -0,0 +1,1249 @@ +{ + "answers": { + "action-pinning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "language": "TypeScript", + "references": [ + { + "path": ".github/workflows/ci-lint.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/ci-lint.yml", + "pinning": null, + "reference": "rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca" + }, + { + "path": ".github/workflows/ci.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/ci.yml", + "pinning": null, + "reference": "actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1" + }, + { + "path": ".github/workflows/copy-paste-detection.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + }, + { + "path": ".github/workflows/function-limits.yml", + "pinning": null, + "reference": "actions/checkout@11d5960a326750d5838078e36cf38b85af677262" + } + ], + "unit": "." + } + ] + } + ], + "ci-lint": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "language": "TypeScript", + "providers": { + "GitHub Actions": { + "lintable": true, + "linters": [ + "actionlint", + "zizmor" + ] + } + }, + "unit": "." + } + ] + } + ], + "committed-artifacts": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "committed": [], + "language": "TypeScript", + "unit": "." + } + ] + } + ], + "compile-commands": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "compiler-warnings": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "eslint": [ + "CI (package.json)" + ] + }, + "missing": [] + } + ], + "language": "TypeScript", + "practice": "compiler-warnings", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "coverage": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "branch": { + "answer": "yes", + "gated": [], + "known": [ + "c8", + "nyc", + "jest --coverage", + "vitest --coverage", + "deno test --coverage", + "node --test --experimental-test-coverage" + ], + "reported": [ + "Vitest" + ], + "rung": "reported", + "tools": [ + "Vitest" + ] + }, + "language": "TypeScript", + "line": { + "answer": "yes", + "gated": [], + "known": [ + "c8", + "nyc", + "jest --coverage", + "vitest --coverage", + "deno test --coverage", + "node --test --experimental-test-coverage", + "bun test --coverage" + ], + "reported": [ + "Vitest" + ], + "rung": "reported", + "tools": [ + "Vitest" + ] + }, + "path": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "region": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "statement": { + "answer": "impossible", + "gated": [], + "known": [], + "reported": [], + "rung": null, + "tools": [] + }, + "unit": ".", + "unknowns": [] + } + ] + } + ], + "dependency-audit": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "GitLab Dependency Scanning": { + "can": { + "runs": "GitLab Dependency Scanning (Security/Dependency-Scanning.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "bun audit": { + "can": { + "runs": "bun audit" + }, + "needs_definition": false, + "required": false + }, + "npm audit": { + "can": { + "runs": "npm audit" + }, + "needs_definition": false, + "required": false + }, + "osv-scanner": { + "can": { + "runs": "osv-scanner" + }, + "needs_definition": false, + "required": false + }, + "pnpm audit": { + "can": { + "runs": "pnpm audit" + }, + "needs_definition": false, + "required": false + }, + "snyk": { + "can": { + "runs": "snyk test" + }, + "needs_definition": false, + "required": false + }, + "trivy": { + "can": { + "runs": "trivy fs" + }, + "needs_definition": false, + "required": false + }, + "yarn audit": { + "can": { + "runs": "yarn audit" + }, + "needs_definition": false, + "required": false + }, + "yarn npm audit": { + "can": { + "runs": "yarn npm audit" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": { + "npm audit": { + "levels": [ + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "dependency-management": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "declared": [ + { + "manager": "npm packages", + "manifest": "package.json" + } + ], + "language": "TypeScript", + "lock_required": true, + "locked": [ + "package-lock.json" + ], + "unit": ".", + "unknowns": [] + } + ] + } + ], + "formatting": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "biome": { + "can": { + "apply": "biome format --write", + "check": "biome ci" + }, + "needs_definition": false, + "required": false + }, + "deno fmt": { + "can": { + "apply": "deno fmt", + "check": "deno fmt --check" + }, + "needs_definition": false, + "required": false + }, + "dprint": { + "can": { + "apply": "dprint fmt", + "check": "dprint check" + }, + "needs_definition": false, + "required": false + }, + "oxfmt": { + "can": { + "apply": "oxfmt", + "check": "oxfmt --check" + }, + "needs_definition": false, + "required": false + }, + "prettier": { + "can": { + "apply": "prettier --write .", + "check": "prettier --check ." + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "check", + "runs": { + "prettier": { + "levels": [ + "check" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "function-limits": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "eslint's max-lines-per-function": { + "can": { + "limits": "eslint with max-lines-per-function on" + }, + "needs_definition": true, + "required": false + }, + "lizard": { + "can": { + "limits": "lizard --length 30" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "limits", + "runs": { + "eslint's max-lines-per-function": { + "levels": [ + "measures" + ], + "read": [] + }, + "lizard": { + "levels": [ + "limits", + "measures" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "fuzz-testing": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "language": "TypeScript", + "other_runs": [], + "property_files": [], + "tools": { + "answer": "yes", + "defined": { + "Jazzer.js": [ + "fuzz/add.fuzz.ts" + ] + }, + "known": { + "Jazzer.js": { + "can": { + "runs": "npx jazzer -- -max_total_time=30 (or jest with JAZZER_FUZZ=1)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": { + "Jazzer.js": { + "levels": [ + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + }, + "unit": "." + } + ] + } + ], + "hardening": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "license": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "files": { + "LICENSE": [ + "MIT" + ] + }, + "language": "TypeScript", + "mismatches": [], + "unit": "." + } + ] + } + ], + "link-check": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "migration-safety": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "linted", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "mutation-testing": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": { + "StrykerJS": [ + "stryker.config.json" + ] + }, + "known": { + "StrykerJS": { + "can": { + "incremental": "stryker run --incremental", + "runs": "stryker run" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": { + "StrykerJS": { + "levels": [ + "incremental", + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "out-of-source-build": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "platforms": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "axis": "runtime version", + "language": "TypeScript", + "notes": [], + "platforms": [ + { + "configurations": [], + "os": "linux", + "runtime version": "22" + }, + { + "configurations": [], + "os": "linux", + "runtime version": "24" + }, + { + "configurations": [], + "os": "macos", + "runtime version": "22" + }, + { + "configurations": [], + "os": "macos", + "runtime version": "24" + }, + { + "configurations": [], + "os": "windows", + "runtime version": "22" + }, + { + "configurations": [], + "os": "windows", + "runtime version": "24" + } + ], + "unit": "." + } + ] + } + ], + "sanitizers": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "schema-compatibility": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "breaking", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-declared": [], + "schema-examples": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "checked", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "schema-validation": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "impossible", + "defined": {}, + "known": {}, + "language": "TypeScript", + "level": "validates", + "runs": {}, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "secret-scanning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "configured": [], + "language": "TypeScript", + "scanners": [ + "gitleaks" + ], + "unit": "." + } + ] + } + ], + "security-scanning": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": {}, + "known": { + "CodeQL": { + "can": { + "scans": "CodeQL (github/codeql-action)" + }, + "needs_definition": false, + "required": false + }, + "GitLab SAST": { + "can": { + "scans": "GitLab SAST (Security/SAST.gitlab-ci.yml)" + }, + "needs_definition": false, + "required": false + }, + "eslint-plugin-security": { + "can": { + "scans": "eslint with eslint-plugin-security" + }, + "needs_definition": false, + "required": false + }, + "semgrep": { + "can": { + "scans": "semgrep ci" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "scans", + "runs": { + "eslint-plugin-security": { + "levels": [ + "scans" + ], + "read": [ + "eslint.config.js", + "package.json" + ] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "static-analysis": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": { + "eslint": [ + "eslint.config.js" + ] + }, + "known": { + "biome": { + "can": { + "checks": "biome lint" + }, + "needs_definition": false, + "required": false + }, + "deno lint": { + "can": { + "checks": "deno lint" + }, + "needs_definition": false, + "required": false + }, + "eslint": { + "can": { + "checks": "eslint" + }, + "needs_definition": false, + "required": false + }, + "oxlint": { + "can": { + "checks": "oxlint" + }, + "needs_definition": false, + "required": false + }, + "xo": { + "can": { + "checks": "xo" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "checks", + "runs": { + "eslint": { + "levels": [ + "checks" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "tests": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": { + "a JavaScript test runner": [ + "src/add.test.ts" + ] + }, + "known": { + "a JavaScript test runner": { + "can": { + "runs": "jest, vitest, mocha, node --test, deno test, bun test or playwright (or npm test)" + }, + "needs_definition": true, + "required": false + } + }, + "language": "TypeScript", + "level": "runs", + "runs": { + "a JavaScript test runner": { + "levels": [ + "runs" + ], + "read": [] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "top-level-guard": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [] + } + ], + "type-checking": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "defined": { + "tsc": [ + "tsconfig.json" + ] + }, + "known": { + "deno check": { + "can": { + "checks": "deno check", + "strict": "deno check (strict by default)" + }, + "needs_definition": false, + "required": false + }, + "tsc": { + "can": { + "checks": "tsc --noEmit", + "strict": "\"strict\": true in the compilerOptions of tsconfig.json" + }, + "needs_definition": false, + "required": false + } + }, + "language": "TypeScript", + "level": "checks", + "runs": { + "tsc": { + "levels": [ + "checks", + "strict" + ], + "read": [ + "tsconfig.json" + ] + } + }, + "unit": ".", + "unknown_definitions": [], + "unknowns": [] + } + ] + } + ], + "vcs-ignore": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "language": "TypeScript", + "outputs": { + "node_modules": { + ".gitignore": "node_modules/" + } + }, + "unit": "." + } + ] + } + ], + "warnings-as-errors": [ + { + "auxiliary": {}, + "language": "TypeScript", + "units": [ + { + "answer": "yes", + "compilers": [ + { + "compiler": null, + "found": { + "eslint --max-warnings 0": [ + "CI (package.json)" + ] + }, + "missing": [ + "biome ci", + "deno lint" + ] + } + ], + "language": "TypeScript", + "practice": "warnings-as-errors", + "unit": ".", + "unknowns": [] + } + ] + } + ], + "wellformed": [ + { + "auxiliary": {}, + "language": "JSON", + "units": [ + { + "answer": "yes", + "language": "JSON", + "parsed": [ + "package-lock.json", + "package.json", + "stryker.config.json", + "tsconfig.json" + ], + "problems": [], + "test_data": [], + "test_problems": [], + "unit": ".", + "unread": {} + } + ] + }, + { + "auxiliary": {}, + "language": "YAML", + "units": [ + { + "answer": "yes", + "language": "YAML", + "parsed": [ + ".github/dependabot.yml", + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/copy-paste-detection.yml", + ".github/workflows/function-limits.yml" + ], + "problems": [], + "test_data": [], + "test_problems": [], + "unit": ".", + "unread": {} + } + ] + } + ] + }, + "results": { + "action-pinning": { + "details": [], + "message": "all 6 actions are pinned to a commit", + "status": "PASS" + }, + "ci-build-types": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "ci-lint": { + "details": [], + "message": "CI lints its configuration (GitHub Actions: actionlint, zizmor)", + "status": "PASS" + }, + "ci-present": { + "details": [ + ".github/workflows/ci-lint.yml", + ".github/workflows/ci.yml", + ".github/workflows/copy-paste-detection.yml", + ".github/workflows/function-limits.yml" + ], + "message": "CI configuration found for GitHub Actions", + "status": "PASS" + }, + "code-formatting": { + "details": [], + "message": "CI enforces the prettier style", + "status": "PASS" + }, + "committed-artifacts": { + "details": [], + "message": "no build outputs are committed", + "status": "PASS" + }, + "compile-commands": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "compiler-extensions": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "compiler-warnings": { + "details": [], + "message": "strict JavaScript linters are enabled: eslint", + "status": "PASS" + }, + "copy-paste-detection": { + "details": [], + "message": "CI runs copy-paste detection with jscpd", + "status": "PASS" + }, + "coverage": { + "details": [ + "consider failing CI when branch coverage falls below a threshold" + ], + "message": "branch coverage is reported with Vitest", + "status": "PASS" + }, + "data-wellformed": { + "details": [], + "message": "JSON: 4 JSON files parse; YAML: 5 YAML files parse", + "status": "PASS" + }, + "dependency-audit": { + "details": [], + "message": "CI audits the dependencies with npm audit", + "status": "PASS" + }, + "dependency-management": { + "details": [], + "message": "dependencies are declared in package.json (npm packages) and locked in package-lock.json", + "status": "PASS" + }, + "dependency-updates": { + "details": [ + ".github/dependabot.yml" + ], + "message": "automated dependency updates are configured with Dependabot", + "status": "PASS" + }, + "function-limits": { + "details": [], + "message": "function length is limited with lizard", + "status": "PASS" + }, + "fuzz-testing": { + "details": [], + "message": "fuzz targets in 1 file(s), run by Jazzer.js", + "status": "PASS" + }, + "hardening": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "large-files": { + "details": [], + "message": "no committed file is larger than 5 MiB", + "status": "PASS" + }, + "license": { + "details": [ + "LICENSE" + ], + "message": "the project is licensed under MIT", + "status": "PASS" + }, + "link-check": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "migration-safety": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "mutation-testing": { + "details": [], + "message": "StrykerJS (stryker.config.json) runs; on the pull request's changes only (bonus)", + "status": "PASS" + }, + "out-of-source-build": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "platform-matrix": { + "details": [ + ".github/workflows/ci-lint.yml: ci-lint: linux / no runtime version", + ".github/workflows/ci.yml: test (ubuntu-latest, 22): linux / 22", + ".github/workflows/ci.yml: test (ubuntu-latest, 24): linux / 24", + ".github/workflows/ci.yml: test (macos-latest, 22): macos / 22", + ".github/workflows/ci.yml: test (macos-latest, 24): macos / 24", + ".github/workflows/ci.yml: test (windows-latest, 22): windows / 22", + ".github/workflows/ci.yml: test (windows-latest, 24): windows / 24", + ".github/workflows/copy-paste-detection.yml: copy-paste-detection: linux / no runtime version", + ".github/workflows/function-limits.yml: function-limits: linux / no runtime version" + ], + "message": "CI covers 3 OS(es) (linux, macos, windows), 2 runtime version(s) (22, 24), 6 combination(s)", + "status": "PASS" + }, + "sanitizers": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-compatibility": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-declared": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-examples": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "schema-validation": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "secret-scanning": { + "details": [], + "message": "secrets are scanned for with gitleaks", + "status": "PASS" + }, + "security-policy": { + "details": [], + "message": "SECURITY.md says how to report a vulnerability", + "status": "PASS" + }, + "security-scanning": { + "details": [], + "message": "CI scans the code for security problems with eslint-plugin-security", + "status": "PASS" + }, + "static-analysis": { + "details": [], + "message": "eslint (eslint.config.js) runs", + "status": "PASS" + }, + "status-badges": { + "details": [], + "message": "README.md shows CI (GitHub Actions) and quality (Codecov) badges", + "status": "PASS" + }, + "tests-run": { + "details": [], + "message": "*.test.*, *.spec.*, __tests__/ or test/ files: 1 file(s), run by a JavaScript test runner", + "status": "PASS" + }, + "top-level-guard": { + "details": [], + "message": "not applicable to TypeScript", + "status": "SKIP" + }, + "type-checking": { + "details": [], + "message": "tsc (tsconfig.json) runs; strict mode bonus: tsc (tsconfig.json)", + "status": "PASS" + }, + "vcs-ignore": { + "details": [], + "message": ".gitignore ignores node_modules/", + "status": "PASS" + }, + "warnings-as-errors": { + "details": [], + "message": "warnings are treated as errors with eslint --max-warnings 0", + "status": "PASS" + } + } +} diff --git a/tests/snapshots/well_configured_typst.json b/tests/snapshots/well_configured_typst.json index ea5c26ee..94931ccb 100644 --- a/tests/snapshots/well_configured_typst.json +++ b/tests/snapshots/well_configured_typst.json @@ -83,6 +83,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Typst", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -143,13 +150,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Typst", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -650,6 +650,11 @@ "message": "not applicable to Typst", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Typst", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Typst", @@ -665,11 +670,6 @@ "message": "not applicable to Typst", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Typst", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "4 YAML files parse", diff --git a/tests/snapshots/well_configured_xml_schemas.json b/tests/snapshots/well_configured_xml_schemas.json index 84e49e4b..9b7b32c2 100644 --- a/tests/snapshots/well_configured_xml_schemas.json +++ b/tests/snapshots/well_configured_xml_schemas.json @@ -4,9 +4,9 @@ "ci-lint": [], "committed-artifacts": [], "compile-commands": [], + "compiler-extensions": [], "compiler-warnings": [], "coverage": [], - "cxx-extensions": [], "dependency-audit": [], "dependency-management": [], "formatting": [ @@ -371,6 +371,11 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to a project of no recognised language", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to a project of no recognised language", @@ -386,11 +391,6 @@ "message": "not applicable to a project of no recognised language", "status": "SKIP" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to a project of no recognised language", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "XML: 4 XML files parse; YAML: 4 YAML files parse", diff --git a/tests/snapshots/well_configured_zig.json b/tests/snapshots/well_configured_zig.json index b6596ee3..f2138b98 100644 --- a/tests/snapshots/well_configured_zig.json +++ b/tests/snapshots/well_configured_zig.json @@ -88,6 +88,13 @@ "units": [] } ], + "compiler-extensions": [ + { + "auxiliary": {}, + "language": "Zig", + "units": [] + } + ], "compiler-warnings": [ { "auxiliary": {}, @@ -154,13 +161,6 @@ ] } ], - "cxx-extensions": [ - { - "auxiliary": {}, - "language": "Zig", - "units": [] - } - ], "dependency-audit": [ { "auxiliary": {}, @@ -777,6 +777,11 @@ "message": "not applicable to Zig", "status": "SKIP" }, + "compiler-extensions": { + "details": [], + "message": "not applicable to Zig", + "status": "SKIP" + }, "compiler-warnings": { "details": [], "message": "not applicable to Zig", @@ -794,11 +799,6 @@ "message": "line coverage is reported with kcov", "status": "PASS" }, - "cxx-extensions": { - "details": [], - "message": "not applicable to Zig", - "status": "SKIP" - }, "data-wellformed": { "details": [], "message": "5 YAML files parse", diff --git a/tests/support.py b/tests/support.py index 3be5fb26..c02bf97d 100644 --- a/tests/support.py +++ b/tests/support.py @@ -11,14 +11,15 @@ from pathlib import Path from types import MappingProxyType -from project_validator import pretty from project_validator.core import Check, Context, Options, Project, Result from project_validator.ecosystems import BUILT_IN, C_FAMILY, Ecosystem, ecosystems_for -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.c import C +from project_validator.ecosystems.cpp import CXX from project_validator.facts import Command, Origin, resolved from project_validator.facts.expansion import script_facts from project_validator.facts.jobs import Job from project_validator.plugins import discover +from project_validator.views import console as console_view from tests import layouts from tests.layouts.model import ProjectLayout @@ -29,7 +30,7 @@ label="Widget data", kind="format", languages=frozenset({"WDATA"}), source_suffixes={".wdata": "WDATA"} ) -requires_rich = unittest.skipUnless(pretty.available(), "rich is not installed") +requires_rich = unittest.skipUnless(console_view.available(), "rich is not installed") NO_FILES: Mapping[str, str] = MappingProxyType({}) @@ -83,15 +84,20 @@ def layouts_checked_as(selected: Check, *ecosystems: Ecosystem) -> tuple[Project return tuple(layout for layout in PROJECT_LAYOUTS if checked_ecosystems(selected, layout) == ecosystems) +def c_family_layouts(selected: Check) -> tuple[ProjectLayout, ...]: + """The layouts in which `selected` judges only C, or only C++.""" + return (*layouts_checked_as(selected, C), *layouts_checked_as(selected, CXX)) + + def c_family_layouts_built_with(selected: Check, build_system: str) -> tuple[ProjectLayout, ...]: - """The layouts in which `selected` judges only C/C++, by the rules of `build_system`. + """The layouts in which `selected` judges only C or only C++, by the rules of `build_system`. - A layout without a C/C++ build system is judged as a CMake project. + A layout without a C or C++ build system is judged as a CMake project. """ return tuple( layout - for layout in layouts_checked_as(selected, C_AND_CXX) - if C_AND_CXX.used_build_systems(layout.build_systems)[0].name == build_system + for layout in c_family_layouts(selected) + if CXX.used_build_systems(layout.build_systems)[0].name == build_system ) @@ -136,10 +142,10 @@ def run_in_every_layout( ) -> Result: """The result of `selected` in a project of each layout with `files` added, which must not depend on the layout. - By default the layouts are every one in which `selected` judges only C/C++. + By default the layouts are every one in which `selected` judges only C, or only C++. """ if layouts is None: - layouts = layouts_checked_as(selected, C_AND_CXX) + layouts = c_family_layouts(selected) results: dict[str, Result] = {} for layout in layouts: with temp_project({**layout.files, **files}) as root: @@ -151,8 +157,8 @@ def run_in_every_layout( return expected -WELL_CONFIGURED = fixture_files("well_configured_c_cpp") -BARE_PROJECT = fixture_files("bare_c_cpp") +WELL_CONFIGURED = fixture_files("well_configured_cpp") +BARE_PROJECT = fixture_files("bare_cpp") def well_configured(layout: ProjectLayout) -> dict[str, str]: diff --git a/tests/test_analysis.py b/tests/test_analysis.py new file mode 100644 index 00000000..76e7f4d3 --- /dev/null +++ b/tests/test_analysis.py @@ -0,0 +1,164 @@ +"""One analysis of a project, which every view renders: what was detected and how it was read, the results, the score, +and progress while it works.""" + +from __future__ import annotations + +import json +import shutil +import subprocess +import unittest +from pathlib import Path + +from project_validator.analysis import Analysis, Progress, RoleSummary, analyse, file_url, git_of +from project_validator.core import Options +from project_validator.plugins import discover +from tests.support import FIXTURES, make_context, temp_project + +MIXED = { + "CMakeLists.txt": "project(app CXX)\n", + "src/main.cpp": "", + "tests/test_main.cpp": "", + "examples/demo.cpp": "", + "scripts/release.py": "", + "third_party/lib/lib.c": "", +} + + +def _analysis(files: dict[str, str], **options: object) -> Analysis: + with temp_project(files) as root: + return analyse(make_context(root), discover().checks, **options) # type: ignore[arg-type] + + +class AnalysisTests(unittest.TestCase): + def test_it_holds_the_structure_facts_reports_and_score(self) -> None: + analysis = _analysis(MIXED) + if analysis.structure is None: + self.fail("not read") + self.assertEqual(sorted(analysis.structure.languages), ["C++", "Python"]) + self.assertTrue(analysis.facts.all) + self.assertEqual({report.check.name for report in analysis.reports}, {c.name for c in discover().checks}) + self.assertIsNotNone(analysis.score) + self.assertGreater(analysis.seconds, 0) + + def test_the_score_can_be_left_out(self) -> None: + self.assertIsNone(_analysis(MIXED, scored=False).score) + + def test_each_extraction_stage_is_timed_with_what_it_found(self) -> None: + stages = {stage.name: stage for stage in _analysis(MIXED).stages} + self.assertIn("the project's structure", stages) + self.assertIn("the tool runs", stages) + self.assertGreater(stages["the project's structure"].found, 0) + self.assertTrue(all(stage.seconds >= 0 for stage in stages.values())) + + def test_the_code_in_each_detected_role_is_summarised(self) -> None: + roles = {summary.role: summary for summary in _analysis(MIXED).roles} + self.assertEqual(set(roles), {"product", "test", "example", "tooling", "vendored"}) + self.assertEqual(roles["test"], RoleSummary(role="test", directories=("tests",), files=1, languages=("C++",))) + self.assertEqual(roles["tooling"].languages, ("Python",)) + self.assertEqual(roles["vendored"].directories, ("third_party",)) + + def test_a_role_suggests_the_option_that_judges_it_as_auxiliary(self) -> None: + roles = {summary.role: summary for summary in _analysis(MIXED).roles} + self.assertEqual(roles["example"].suggestion, "--auxiliary example") + self.assertIsNone(roles["product"].suggestion) + self.assertIsNone(roles["vendored"].suggestion) + + def test_a_role_already_named_auxiliary_suggests_nothing(self) -> None: + with temp_project(MIXED) as root: + analysis = analyse(make_context(root, auxiliary=("example",)), discover().checks) + roles = {summary.role: summary for summary in analysis.roles} + self.assertTrue(roles["example"].auxiliary) + self.assertIsNone(roles["example"].suggestion) + + def test_the_options_and_validator_version_are_recorded(self) -> None: + analysis = _analysis(MIXED) + self.assertEqual(analysis.options["allow_unknown"], False) + self.assertRegex(analysis.validator, r"^\d+\.\d+") + + def test_an_extraction_failure_is_kept(self) -> None: + with temp_project({"CMakeLists.txt": ""}) as root: + context = make_context(root) + context._extracted = None + from project_validator.core import ExtractionError + + context._extracted = ExtractionError("the CI configuration", ValueError("broken")) + analysis = analyse(context, discover().checks) + self.assertIn("the CI configuration", str(analysis.error)) + self.assertIsNone(analysis.score) + + def test_as_json(self) -> None: + data = _analysis(MIXED).as_dict() + self.assertEqual( + set(data), + {"project", "validator", "options", "seconds", "stages", "structure", "roles", "results", "score", "git"}, + ) + json.dumps(data) + + +class ProgressTests(unittest.TestCase): + def test_the_stages_and_checks_are_reported_as_they_start_and_end(self) -> None: + events: list[Progress] = [] + with temp_project(MIXED) as root: + analyse(make_context(root), discover().checks[:3], progress=events.append) + kinds = [(event.kind, event.done) for event in events] + self.assertEqual(kinds[0], ("stage", False)) + self.assertIn(("stage", True), kinds) + self.assertEqual( + [event.name for event in events if event.kind == "check" and event.done], + [check.name for check in discover().checks[:3]], + ) + finished = [event for event in events if event.kind == "check" and event.done] + self.assertEqual([event.total for event in finished], [3, 3, 3]) + self.assertEqual([event.index for event in finished], [1, 2, 3]) + + def test_progress_of_the_fixture_extraction_is_reported_once(self) -> None: + events: list[Progress] = [] + with temp_project(MIXED) as root: + context = make_context(root) + context.observe(events.append) + _ = context.facts + _ = context.facts + self.assertEqual(sum(1 for event in events if event.kind == "stage" and not event.done), 9) + + +def _git(root: Path, *arguments: str) -> None: + subprocess.run([shutil.which("git") or "git", *arguments], cwd=root, check=True) # noqa: S603 - tests + + +class GitTests(unittest.TestCase): + def test_a_checkout_gives_its_commit_and_its_github_files(self) -> None: + with temp_project({"main.py": ""}) as root: + _git(root, "init", "-q") + _git(root, "remote", "add", "origin", "git@github.com:o/r.git") + _git(root, "-c", "user.name=t", "-c", "user.email=t@e", "commit", "-q", "--allow-empty", "-m", "m") + analysis = analyse(make_context(root), ()) + self.assertRegex(analysis.git.commit or "", r"^[0-9a-f]{40}$") + self.assertEqual(analysis.git.web, "https://github.com/o/r") + self.assertEqual( + file_url(analysis.git, "src/a.py:3"), f"https://github.com/o/r/blob/{analysis.git.commit}/src/a.py#L3" + ) + + def test_without_git_there_is_no_commit_and_no_links(self) -> None: + with temp_project({"main.py": ""}) as root: + analysis = analyse(make_context(root), ()) + self.assertIsNone(analysis.git.commit) + self.assertIsNone(file_url(analysis.git, "main.py")) + + def test_a_git_that_can_not_run_gives_no_commit(self) -> None: + from unittest import mock + + with temp_project({"main.py": ""}) as root, mock.patch("subprocess.run", side_effect=OSError("no git")): + self.assertIsNone(git_of(root).commit) + + def test_https_remotes_and_the_fixture_name(self) -> None: + from project_validator.analysis import web_url + + self.assertEqual(web_url("https://github.com/o/r.git"), "https://github.com/o/r") + self.assertEqual(web_url("https://gitlab.com/g/p"), "https://gitlab.com/g/p") + self.assertIsNone(web_url("/local/path")) + analysis = analyse(make_context(FIXTURES / "well_configured_python", Options()), ()) + self.assertEqual(analysis.name, "well_configured_python") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_build_site.py b/tests/test_build_site.py index d94f306d..cd00f8b9 100644 --- a/tests/test_build_site.py +++ b/tests/test_build_site.py @@ -101,11 +101,14 @@ def test_a_page_says_which_branch_and_commit_it_was_built_from(self) -> None: self.assertIn("T - project_validator", page) self.assertIn("

    body

    ", page) - def test_the_navigation_is_relative_and_skips_the_current_page(self) -> None: + def test_the_navigation_is_relative_and_marks_the_current_section(self) -> None: page = render_page("# E\n", "docs/ecosystems/index.html", SITE, "2026-11-10") self.assertIn('Overview', page) self.assertIn('Support matrix', page) - self.assertIn("Ecosystems", page) + self.assertIn('Ecosystems', page) + board = render_page("# P\n", "leaderboard/projects/o--r.html", SITE, "2026-11-10") + self.assertIn('Leaderboard', board) + self.assertIn('class="page wrap wide"', board) self.assertIn('', page) def test_headings_get_the_ids_github_gives_them_and_tables_render(self) -> None: @@ -132,10 +135,33 @@ def test_the_pages_are_the_readme_the_docs_their_index_and_the_generated_matrix( def test_the_ecosystems_index_links_every_ecosystem_page_by_its_title(self) -> None: index = pages(ROOT)["docs/ecosystems/index.html"] self.assertIn("- [Fortran](fortran.md)", index) - self.assertIn("- [C/C++](c_cpp.md)", index) + self.assertIn("- [C](c.md)", index) + self.assertIn("- [C++](cpp.md)", index) self.assertEqual(index.count("\n- ["), len(PROFILES)) +def _nightly(name: str, language: str) -> dict[str, object]: + """A night's result for a project, as `leaderboard evaluate` writes it.""" + return { + "name": name, + "language": language, + "commit": "c" * 40, + "validator": "v" * 40, + "evaluated": "2026-11-18T03:17:00Z", + "score": { + "version": "1", + "percent": 50.0, + "level": 1, + "level_name": "Foundations", + "filled": 1, + "slots": 2, + "summary": "50% · Level 1 Foundations · 1 of 2 gates in place", + "cells": [], + "next_steps": [], + }, + } + + class BuildTests(unittest.TestCase): def test_the_site_builds_from_the_repository_and_every_link_and_anchor_resolves(self) -> None: with tempfile.TemporaryDirectory() as tmp: @@ -146,22 +172,7 @@ def test_the_site_builds_from_the_repository_and_every_link_and_anchor_resolves( def test_the_leaderboard_is_built_from_the_nightly_results(self) -> None: listed = entries(ROOT / "leaderboard" / "projects.toml") - result: dict[str, object] = { - "name": listed[0].name, - "language": listed[0].language, - "commit": "c" * 40, - "validator": "v" * 40, - "evaluated": "2026-11-18T03:17:00Z", - "score": { - "version": "0", - "level": 1, - "completeness": 0.5, - "depth": 20, - "locked_depth": 0, - "cells": [], - "opportunities": [], - }, - } + result = _nightly(listed[0].name, listed[0].language) with tempfile.TemporaryDirectory() as tmp: results, data, output = Path(tmp) / "results", Path(tmp) / "data", Path(tmp) / "site" write(result, results) diff --git a/tests/test_c_and_cxx.py b/tests/test_c_and_cxx.py new file mode 100644 index 00000000..168a6bb5 --- /dev/null +++ b/tests/test_c_and_cxx.py @@ -0,0 +1,140 @@ +"""C and C++ are separate languages, each its own ecosystem: a project is judged for the ones its code is written in.""" + +from __future__ import annotations + +import unittest +from collections.abc import Mapping + +from project_validator.checks.compiler_extensions import compiler_extensions +from project_validator.core import Status +from project_validator.runner import select +from tests.support import checks_named, make_context, temp_project + +CMAKE_DEFAULT = "cmake_minimum_required(VERSION 3.21)\nproject(app)\nadd_executable(app {sources})\n" + + +def _ecosystems(files: Mapping[str, str]) -> dict[str, list[str]]: + """Each unit's directory -> the ecosystems the map recognises in it.""" + with temp_project(files) as root: + structure = make_context(root).structure + recognised = list(structure.recognised_by) + return { + unit.directory: sorted(label for label in recognised if label in _labels(unit.languages)) + for unit in structure.units + } + + +def _labels(languages: frozenset[str]) -> set[str]: + return {language for language in languages if language in {"C", "C++"}} + + +def _languages(files: Mapping[str, str]) -> list[str]: + with temp_project(files) as root: + return sorted(make_context(root).structure.languages) + + +class EcosystemTests(unittest.TestCase): + def test_c_sources_make_a_c_project(self) -> None: + self.assertEqual(_ecosystems({"main.c": "", "util.h": ""}), {".": ["C"]}) + + def test_cxx_sources_make_a_cxx_project(self) -> None: + self.assertEqual(_ecosystems({"main.cpp": "", "util.hpp": ""}), {".": ["C++"]}) + + def test_both_kinds_of_source_make_both(self) -> None: + self.assertEqual(_ecosystems({"main.cpp": "", "legacy.c": ""}), {".": ["C", "C++"]}) + + def test_the_labels_name_one_language_each(self) -> None: + with temp_project({"main.c": "", "main.cpp": ""}) as root: + self.assertEqual(sorted(make_context(root).structure.recognised_by), ["C", "C++"]) + + +class CMakeDefaultLanguageTests(unittest.TestCase): + """CMake's project() enables C and C++ unless told otherwise; that says nothing about the code.""" + + def test_a_cxx_project_with_the_default_languages_is_cxx(self) -> None: + files = {"CMakeLists.txt": CMAKE_DEFAULT.format(sources="main.cpp"), "main.cpp": ""} + self.assertEqual(_languages(files), ["C++"]) + + def test_a_c_project_with_the_default_languages_is_c(self) -> None: + files = {"CMakeLists.txt": CMAKE_DEFAULT.format(sources="main.c"), "main.c": ""} + self.assertEqual(_languages(files), ["C"]) + + def test_a_build_file_without_sources_keeps_what_it_declares(self) -> None: + files = {"CMakeLists.txt": "project(app LANGUAGES CXX)\n"} + self.assertEqual(_languages(files), ["C++"]) + + def test_the_c_project_is_not_recognised_as_cxx(self) -> None: + files = {"CMakeLists.txt": CMAKE_DEFAULT.format(sources="main.c"), "main.c": ""} + with temp_project(files) as root: + self.assertEqual(list(make_context(root).structure.recognised_by), ["C"]) + + +class HeaderTests(unittest.TestCase): + """A `.h` header is C or C++ by the sources around it: the majority below its nearest ancestor that has any.""" + + def test_headers_beside_cxx_sources_are_cxx(self) -> None: + self.assertEqual(_languages({"src/main.cpp": "", "include/app/app.h": ""}), ["C++"]) + + def test_headers_beside_c_sources_are_c(self) -> None: + self.assertEqual(_languages({"src/main.c": "", "include/app/app.h": ""}), ["C"]) + + def test_each_part_of_a_mixed_tree_keeps_its_own_language(self) -> None: + files = { + "CMakeLists.txt": "project(app)\nadd_subdirectory(clib)\nadd_subdirectory(app)\n", + "clib/CMakeLists.txt": "add_library(clib a.c b.c)\n", + "clib/a.c": "", + "clib/b.c": "", + "clib/include/clib.h": "", + "app/CMakeLists.txt": "add_executable(app main.cpp)\n", + "app/main.cpp": "", + "app/app.h": "", + } + with temp_project(files) as root: + facts = make_context(root).facts + from project_validator.facts.structure import SourceFile + + headers = {source.path: source.language for source in facts.of(SourceFile) if source.path.endswith(".h")} + self.assertEqual(headers, {"clib/include/clib.h": "C", "app/app.h": "C++"}) + + def test_a_header_only_project_is_c_unless_the_build_says_cxx(self) -> None: + self.assertEqual(_languages({"CMakeLists.txt": "project(lib)\n", "include/lib.h": ""}), ["C"]) + self.assertEqual(_languages({"CMakeLists.txt": "project(lib CXX)\n", "include/lib.h": ""}), ["C++"]) + + +class CompilerExtensionsTests(unittest.TestCase): + def test_the_check_is_named_for_every_language_it_judges(self) -> None: + self.assertEqual(compiler_extensions.name, "compiler-extensions") + + def test_the_old_name_still_selects_it(self) -> None: + self.assertEqual( + [found.name for found in select(checks_named("compiler-extensions"), ["cxx-extensions"], [])], + ["compiler-extensions"], + ) + + +if __name__ == "__main__": + unittest.main() + + +class PerLanguageFlagsTests(unittest.TestCase): + """Each language is judged by its own flags: C++'s do not warn about C, nor C's about C++.""" + + def _warnings_as_errors(self, cmake: str) -> dict[str, Status]: + from project_validator.checks.warnings_as_errors import warnings_as_errors + + files = {"CMakeLists.txt": cmake, "src/main.cpp": "", "src/legacy.c": ""} + with temp_project(files) as root: + result = warnings_as_errors.run(make_context(root)) + return {place.ecosystem: place.result.status for place in result.places} + + def test_cxx_flags_count_for_cxx_alone(self) -> None: + found = self._warnings_as_errors('project(app C CXX)\nset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")\n') + self.assertEqual(found, {"C": Status.FAIL, "C++": Status.PASS}) + + def test_c_flags_count_for_c_alone(self) -> None: + found = self._warnings_as_errors('project(app C CXX)\nset(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")\n') + self.assertEqual(found, {"C": Status.PASS, "C++": Status.FAIL}) + + def test_flags_for_every_language_count_for_both(self) -> None: + found = self._warnings_as_errors("project(app C CXX)\nadd_compile_options(-Werror)\n") + self.assertEqual(found, {"C": Status.PASS, "C++": Status.PASS}) diff --git a/tests/test_cli.py b/tests/test_cli.py index f82bf04c..2becfc06 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -11,13 +11,14 @@ from unittest import mock from unittest.mock import patch -from project_validator import pretty, yaml_support +from project_validator import yaml_support from project_validator.cli import EXIT_FAILURE, EXIT_SUCCESS, EXIT_USAGE, main from project_validator.ecosystems import applies_to from project_validator.facts import Fact from project_validator.facts.wellformed import parsed_formats from project_validator.plugins import discover from project_validator.support_matrix import render, support_matrix +from project_validator.views import console as console_view from tests.layouts.model import ProjectLayout from tests.support import ( BARE_PROJECT, @@ -41,10 +42,8 @@ LANGUAGE_SPECIFIC_CHECKS = tuple(found for found in discover().checks if found.languages - parsed_formats()) # The checks that apply to the C++ fixture: those of every project, and of its languages and the formats its CI # configuration is in (YAML); the fixture passes them all. -_C_CPP_FIXTURE_NAMES = make_context(FIXTURES / "well_configured_c_cpp").structure.languages_and_formats -PASSING_IN_C_CPP = [ - found for found in discover().checks if not found.languages or found.languages & _C_CPP_FIXTURE_NAMES -] +_CXX_FIXTURE_NAMES = make_context(FIXTURES / "well_configured_cpp").structure.languages_and_formats +PASSING_IN_C_CPP = [found for found in discover().checks if not found.languages or found.languages & _CXX_FIXTURE_NAMES] COMPILER_CHECKS = ",".join(found.name for found in LANGUAGE_SPECIFIC_CHECKS) # Language -> the language-specific checks that do not apply to it. NOT_APPLICABLE = { @@ -97,13 +96,14 @@ def test_mixed_language_project_passes_when_every_language_is_well_configured(se ".github/workflows/python.yml": WELL_CONFIGURED_PYTHON[".github/workflows/ci.yml"], } mixed = [layout for layout in C_FAMILY_LAYOUTS if layout not in C_FAMILY_ONLY_LAYOUTS] - # ci-build-types is left out: a Python-only job on a runner counts as a C/C++ build with its default compiler. + # ci-build-types is left out: a Python-only job on a runner counts as a C or C++ build with its default + # compiler. judged_per_language = "compiler-warnings,coverage,tests-run,hardening,platform-matrix" for layout in mixed: with layout_project(self, layout, {**WELL_CONFIGURED, **python}) as root: code, output, _ = run_cli("--only", judged_per_language, str(root)) self.assertEqual(code, EXIT_SUCCESS, output) - self.assertIn("[PASS] coverage: C/C++: branch coverage is gated with gcovr", output) + self.assertIn("[PASS] coverage: C++: branch coverage is gated with gcovr", output) def test_bare_project_fails(self) -> None: for layout in PROJECT_LAYOUTS: @@ -156,7 +156,7 @@ def failing(project: object) -> Iterator[Fact]: self.assertIn(cause, errors) def test_map_prints_the_project_structure(self) -> None: - code, output, _ = run_cli("--map", str(FIXTURES / "well_configured_c_cpp")) + code, output, _ = run_cli("--map", str(FIXTURES / "well_configured_cpp")) self.assertEqual(code, EXIT_SUCCESS) mapped = json.loads(output) self.assertEqual(mapped["languages"], ["C++"]) @@ -216,48 +216,47 @@ def test_usage_errors(self) -> None: self.assertEqual(raised.exception.code, EXIT_USAGE) def test_max_file_size_sets_the_large_file_limit(self) -> None: - code, output, _ = run_cli("--only", "large-files", "--max-file-size", "0.5", str(FIXTURES / "bare_c_cpp")) - self.assertEqual( - (code, output.strip()), (EXIT_SUCCESS, "[PASS] large-files: no committed file is larger than 512 KiB") - ) + code, output, _ = run_cli("--only", "large-files", "--max-file-size", "0.5", str(FIXTURES / "bare_cpp")) + self.assertEqual(code, EXIT_SUCCESS) + self.assertIn("\n[PASS] large-files: no committed file is larger than 512 KiB\n", output) @requires_rich def test_color_always_beautifies_the_output(self) -> None: - code, output, _ = run_cli("--color", "always", str(FIXTURES / "well_configured_c_cpp")) + code, output, _ = run_cli("--color", "always", str(FIXTURES / "well_configured_cpp")) self.assertEqual(code, EXIT_SUCCESS, output) self.assertIn("\x1b[", output) self.assertIn(f"{len(PASSING_IN_C_CPP)} passed", output) def test_color_never_and_auto_when_redirected_keep_plain_text(self) -> None: for choice in ("never", "auto"): - _, output, _ = run_cli("--color", choice, str(FIXTURES / "well_configured_c_cpp")) + _, output, _ = run_cli("--color", choice, str(FIXTURES / "well_configured_cpp")) self.assertNotIn("\x1b[", output) self.assertIn("[PASS] coverage:", output) self.assertEqual(output.count("[PASS] "), len(PASSING_IN_C_CPP)) def test_color_auto_is_used_for_a_terminal_unless_no_color_is_set(self) -> None: - with mock.patch.object(pretty, "available", return_value=False): + with mock.patch.object(console_view, "available", return_value=False): with mock.patch.dict("os.environ", {}, clear=True): - self.assertIn("install rich", run_cli(str(FIXTURES / "well_configured_c_cpp"), terminal=True)[2]) + self.assertIn("install rich", run_cli(str(FIXTURES / "well_configured_cpp"), terminal=True)[2]) with mock.patch.dict("os.environ", {"NO_COLOR": "1"}): - self.assertEqual(run_cli(str(FIXTURES / "well_configured_c_cpp"), terminal=True)[2], "") + self.assertEqual(run_cli(str(FIXTURES / "well_configured_cpp"), terminal=True)[2], "") def test_color_without_rich_falls_back_to_plain_text_and_says_so(self) -> None: - with mock.patch.object(pretty, "_rich", None): - code, output, errors = run_cli("--color", "always", str(FIXTURES / "well_configured_c_cpp")) + with mock.patch.object(console_view, "_rich", None): + code, output, errors = run_cli("--color", "always", str(FIXTURES / "well_configured_cpp")) self.assertEqual(code, EXIT_SUCCESS, output) self.assertIn("[PASS] coverage:", output) self.assertIn("install rich", errors) def test_missing_pyyaml_is_an_error_instead_of_reduced_accuracy(self) -> None: with mock.patch.object(yaml_support, "_yaml", None): - code, output, error = run_cli(str(FIXTURES / "well_configured_c_cpp")) + code, output, error = run_cli(str(FIXTURES / "well_configured_cpp")) self.assertEqual((code, output), (EXIT_USAGE, "")) self.assertIn("PyYAML", error) def test_pyyaml_can_not_be_disabled(self) -> None: with self.assertRaises(SystemExit), contextlib.redirect_stderr(io.StringIO()): - main(["--no-yaml", str(FIXTURES / "well_configured_c_cpp")]) + main(["--no-yaml", str(FIXTURES / "well_configured_cpp")]) class DependencyTests(unittest.TestCase): @@ -269,7 +268,7 @@ def test_pyyaml_is_a_required_dependency(self) -> None: class ListTests(unittest.TestCase): def test_facts_are_printed_as_json(self) -> None: - code, output, _ = run_cli("--facts", str(FIXTURES / "well_configured_c_cpp")) + code, output, _ = run_cli("--facts", str(FIXTURES / "well_configured_cpp")) self.assertEqual(code, EXIT_SUCCESS) facts = json.loads(output) self.assertIn("CiJob", {fact["kind"] for fact in facts}) @@ -293,7 +292,7 @@ def test_list_as_json_is_the_check_list(self) -> None: matrix = {row["check"]: row["applies_to"] for row in json.loads(output)} self.assertEqual(matrix, {found.name: list(applies_to(found)) for found in discover().checks}) self.assertEqual(matrix["ci-present"], []) - self.assertIn("C/C++", matrix["ci-build-types"]) + self.assertIn("C", matrix["ci-build-types"]) self.assertNotIn("Python", matrix["ci-build-types"]) def test_list_as_markdown_is_a_table(self) -> None: @@ -301,7 +300,7 @@ def test_list_as_markdown_is_a_table(self) -> None: self.assertEqual(code, EXIT_SUCCESS) self.assertTrue(output.startswith("| Check | Applies to | Passes when |\n|---|---|---|\n| `")) self.assertIn("| `ci-present` | every project | ", output) - self.assertIn("| `ci-build-types` | C/C++, ", output) + self.assertIn("| `ci-build-types` | C, C++, ", output) def test_support_matrix_is_printed_as_markdown(self) -> None: code, output, _ = run_cli("--support-matrix") @@ -314,7 +313,7 @@ def test_support_matrix_is_printed_as_markdown(self) -> None: def test_support_matrix_as_json(self) -> None: code, output, _ = run_cli("--support-matrix", "--format", "json") self.assertEqual(code, EXIT_SUCCESS) - self.assertIn("C/C++", json.loads(output)["ecosystems"]) + self.assertIn("C", json.loads(output)["ecosystems"]) def test_support_matrix_needs_no_yaml(self) -> None: with mock.patch.object(yaml_support, "available", return_value=False): diff --git a/tests/test_cli_options.py b/tests/test_cli_options.py index 2ed370ac..79b0b834 100644 --- a/tests/test_cli_options.py +++ b/tests/test_cli_options.py @@ -49,6 +49,10 @@ def test_every_option_has_its_documented_default(self) -> None: "allow_official_tags": False, "allow_unknown": False, "score": False, + "html": None, + "verbose": False, + "tui": False, + "explain": None, "list": False, "support_matrix": False, } diff --git a/tests/test_ecosystems.py b/tests/test_ecosystems.py index d111f776..4ba19fee 100644 --- a/tests/test_ecosystems.py +++ b/tests/test_ecosystems.py @@ -17,7 +17,7 @@ register, registered, ) -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.model import runs, subcommands, toolchain_patterns from project_validator.ecosystems.perl import PERL_ECOSYSTEM from project_validator.ecosystems.php import PHP @@ -30,8 +30,8 @@ class EcosystemsForTests(unittest.TestCase): def test_the_supported_ecosystems_of_the_languages(self) -> None: - self.assertEqual(ecosystems_for(frozenset({"C++", "Python"}), BUILT_IN), (C_AND_CXX, PYTHON)) - self.assertEqual(ecosystems_for(frozenset({"Rust", "Python"}), (C_AND_CXX, RUST)), (RUST,)) + self.assertEqual(ecosystems_for(frozenset({"C++", "Python"}), BUILT_IN), (CXX, PYTHON)) + self.assertEqual(ecosystems_for(frozenset({"Rust", "Python"}), (CXX, RUST)), (RUST,)) def test_no_ecosystem_for_unknown_languages(self) -> None: self.assertEqual(ecosystems_for(frozenset(), BUILT_IN), ()) @@ -42,7 +42,7 @@ def test_no_ecosystem_when_none_of_the_supported_ones_is_used(self) -> None: class CheckEachEcosystemTests(unittest.TestCase): RESULTS: ClassVar[dict[Ecosystem, Result]] = { - C_AND_CXX: Result.warned("c warned", "c detail"), + CXX: Result.warned("c warned", "c detail"), PYTHON: Result.passed("python passed", "python detail"), RUST: Result.failed("rust failed"), FORMAT_ECOSYSTEM: Result.passed("data passed"), @@ -54,7 +54,7 @@ def _judge(self, files: dict[str, str]) -> Result: def test_a_single_ecosystem_result_is_unchanged(self) -> None: self.assertEqual(self._judge({"Cargo.toml": ""}), self.RESULTS[RUST]) - self.assertEqual(self._judge({"main.c": ""}), self.RESULTS[C_AND_CXX]) + self.assertEqual(self._judge({"main.cpp": ""}), self.RESULTS[CXX]) def test_a_project_of_no_recognised_ecosystem_is_skipped(self) -> None: self.assertEqual( @@ -64,7 +64,7 @@ def test_a_project_of_no_recognised_ecosystem_is_skipped(self) -> None: def test_several_ecosystems_combine_into_the_worst_result_with_labelled_findings(self) -> None: self.assertEqual( self._judge({"main.cpp": "", "setup.py": ""}), - Result.warned("C/C++: c warned; Python: python passed", "C/C++: c detail", "Python: python detail"), + Result.warned("C++: c warned; Python: python passed", "C++: c detail", "Python: python detail"), ) self.assertEqual(self._judge({"main.c": "", "Cargo.toml": "", "setup.py": ""}).status, Status.FAIL) @@ -94,10 +94,10 @@ class CombinedTests(unittest.TestCase): SKIPPED = Result(status=Status.SKIP, message="not applicable") def test_skipped_ecosystems_are_left_out(self) -> None: - self.assertEqual(by_ecosystem({C_AND_CXX: self.SKIPPED, PYTHON: Result.failed("no")}), Result.failed("no")) + self.assertEqual(by_ecosystem({CXX: self.SKIPPED, PYTHON: Result.failed("no")}), Result.failed("no")) def test_a_skip_only_when_every_ecosystem_is_skipped(self) -> None: - result = by_ecosystem({C_AND_CXX: self.SKIPPED, PYTHON: self.SKIPPED}) + result = by_ecosystem({CXX: self.SKIPPED, PYTHON: self.SKIPPED}) self.assertEqual(result.status, Status.SKIP) # The same result for every ecosystem is said once. self.assertEqual(result.message, "not applicable") @@ -115,7 +115,7 @@ def run(_: Context) -> Result: return Result.passed("") self.assertEqual( - applies_to(Check(name="c", description="", run=run, languages_from=lambda: frozenset({"C"}))), ("C/C++",) + applies_to(Check(name="c", description="", run=run, languages_from=lambda: frozenset({"C"}))), ("C",) ) self.assertEqual(applies_to(Check(name="any", description="", run=run)), ()) diff --git a/tests/test_explanations.py b/tests/test_explanations.py new file mode 100644 index 00000000..f6bad58a --- /dev/null +++ b/tests/test_explanations.py @@ -0,0 +1,69 @@ +"""Every check explains why it matters, and `--explain CHECK` prints that with what it looks for and the tools it +recognises for each language.""" + +from __future__ import annotations + +import unittest + +from project_validator.cli import EXIT_SUCCESS, EXIT_USAGE +from project_validator.explanations import CATEGORIES, WHY, Explanation, category, explain +from project_validator.plugins import discover +from tests.test_cli import run_cli + + +class ExplanationTests(unittest.TestCase): + def test_every_built_in_check_says_why_it_matters(self) -> None: + self.assertEqual(set(WHY), {found.name for found in discover().checks}) + + def test_every_check_is_in_a_known_category(self) -> None: + for name, reason in WHY.items(): + with self.subTest(check=name): + self.assertIn(reason.category, CATEGORIES) + self.assertTrue(reason.why.endswith(".")) + + def test_a_plugin_check_without_an_explanation_is_in_other(self) -> None: + self.assertEqual(category("plugin-check"), "Other") + + def test_an_explanation_names_the_tools_recognised_per_language(self) -> None: + checks = discover().checks + found = explain(next(c for c in checks if c.name == "static-analysis"), checks) + self.assertIn("clang-tidy", found.tools["C++"]) + self.assertIn("clang-tidy", found.tools["C"]) + self.assertEqual(found.level, 2) + self.assertEqual(found.category, "Analysis") + + def test_an_unscored_check_says_so(self) -> None: + checks = discover().checks + lines = explain(next(c for c in checks if c.name == "status-badges"), checks).lines() + self.assertIn("reported but not scored", "\n".join(lines)) + self.assertIn("Applies to: every project.", lines) + + def test_a_check_without_a_rationale_says_what_it_looks_for_only(self) -> None: + found = Explanation( + name="x", description="looks", why="", category="Other", level=4, scored=True, applies_to=(), tools={} + ) + self.assertEqual(found.lines()[:3], ["x", "", "What it looks for: looks"]) + self.assertNotIn("Why it matters", "\n".join(found.lines())) + self.assertIn("Category: Other. Needed for Level 4 (Complete).", found.lines()) + + +class ExplainOptionTests(unittest.TestCase): + def test_explain_prints_what_why_and_the_tools(self) -> None: + code, output, _ = run_cli("--explain", "fuzz-testing") + self.assertEqual(code, EXIT_SUCCESS) + self.assertTrue(output.startswith("fuzz-testing\n")) + self.assertIn("Why it matters: Fuzzers find", output) + self.assertIn("Tools recognised:", output) + self.assertIn(" Rust: cargo-fuzz", output) + + def test_an_old_name_is_explained_too(self) -> None: + self.assertTrue(run_cli("--explain", "cxx-extensions")[1].startswith("compiler-extensions\n")) + + def test_an_unknown_check_is_a_usage_error(self) -> None: + code, _, errors = run_cli("--explain", "nonsense") + self.assertEqual(code, EXIT_USAGE) + self.assertIn("unknown check(s): nonsense", errors) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_fortran.py b/tests/test_fortran.py index 2a424c7e..a51a3bf3 100644 --- a/tests/test_fortran.py +++ b/tests/test_fortran.py @@ -9,8 +9,8 @@ from project_validator.checks.ci_build_types import ci_build_types from project_validator.checks.code_formatting import code_formatting from project_validator.checks.committed_artifacts import committed_artifacts +from project_validator.checks.compiler_extensions import compiler_extensions from project_validator.checks.compiler_warnings import compiler_warnings -from project_validator.checks.cxx_extensions import cxx_extensions from project_validator.checks.hardening import hardening from project_validator.checks.platform_matrix import platform_matrix from project_validator.checks.static_analysis import static_analysis @@ -110,9 +110,9 @@ def test_each_compiler_ci_builds_with_is_asked_for_its_own_flags(self) -> None: self.assertEqual(intel, Result.passed("warnings are treated as errors with -warn errors")) def test_a_standard_disables_the_dialects(self) -> None: - self.assertEqual(self._run(cxx_extensions, _ci("gfortran -std=f2018 -c a.f90")).status, Status.PASS) - self.assertEqual(self._run(cxx_extensions, _ci("gfortran -std=gnu -c a.f90")).status, Status.FAIL) - self.assertEqual(self._run(cxx_extensions, _ci("ifx -stand f18 -c a.f90")).status, Status.PASS) + self.assertEqual(self._run(compiler_extensions, _ci("gfortran -std=f2018 -c a.f90")).status, Status.PASS) + self.assertEqual(self._run(compiler_extensions, _ci("gfortran -std=gnu -c a.f90")).status, Status.FAIL) + self.assertEqual(self._run(compiler_extensions, _ci("ifx -stand f18 -c a.f90")).status, Status.PASS) def test_hardening_asks_for_the_back_end_protections(self) -> None: self.assertEqual(self._run(hardening, _ci("gfortran -fhardened -c a.f90")).status, Status.PASS) @@ -185,10 +185,10 @@ def test_meson_warning_levels_pass_gfortran_flags(self) -> None: ), ) self.assertEqual( - run_in_layout(self, "Meson Fortran", cxx_extensions, {"meson.build": meson}).status, Status.PASS + run_in_layout(self, "Meson Fortran", compiler_extensions, {"meson.build": meson}).status, Status.PASS ) legacy = "project('app', 'fortran', default_options: ['fortran_std=legacy'])\n" - result = run_in_layout(self, "Meson Fortran", cxx_extensions, {"meson.build": legacy}) + result = run_in_layout(self, "Meson Fortran", compiler_extensions, {"meson.build": legacy}) self.assertEqual(result.status, Status.FAIL) diff --git a/tests/test_fuzzing.py b/tests/test_fuzzing.py index 9d02a976..48c2d5ce 100644 --- a/tests/test_fuzzing.py +++ b/tests/test_fuzzing.py @@ -5,13 +5,13 @@ import re import unittest -from project_validator.core import Result -from project_validator.ecosystems.c_cpp.fuzzing import ( +from project_validator.c_family.fuzzing import ( AFL, C_FUZZ_TARGETS, C_PROPERTY_TESTS, LIBFUZZER, ) +from project_validator.core import Result from project_validator.ecosystems.dotnet.fuzzing import DOTNET_FUZZ_TARGETS, DOTNET_PROPERTY_TESTS, SHARPFUZZ from project_validator.ecosystems.go import GO_FUZZ, GO_FUZZ_TARGETS, GO_PROPERTY_TESTS, GO_TEST_FILES from project_validator.ecosystems.javascript.fuzzing import ( @@ -197,7 +197,7 @@ def test_afl_fuzz_is_a_run(self) -> None: def test_a_ctest_registered_fuzz_target_runs(self) -> None: files = { - **fixture_files("well_configured_c_cpp"), + **fixture_files("well_configured_cpp"), "fuzz_test/CMakeLists.txt": "add_test(NAME other_run COMMAND other_tool crashes/crash-1)\n", } self.assertEqual(_ctest_entries(files), ()) @@ -215,12 +215,12 @@ def test_only_a_registration_with_a_libfuzzer_option_is_a_fuzz_run(self) -> None ("add_test(NAME t_max_total_time=10 COMMAND fuzz_tester)", False), ): with self.subTest(registration=registration): - files = {**fixture_files("well_configured_c_cpp"), "fuzz_test/CMakeLists.txt": registration + "\n"} + files = {**fixture_files("well_configured_cpp"), "fuzz_test/CMakeLists.txt": registration + "\n"} self.assertEqual(bool(_ctest_entries(files)), counted) def test_a_ctest_fuzz_test_does_not_run_without_a_ctest_run(self) -> None: files = { - **fixture_files("well_configured_c_cpp"), + **fixture_files("well_configured_cpp"), **github_job("ubuntu-latest", "cmake --build build"), "fuzz_test/CMakeLists.txt": "add_test(NAME fuzz_tester_run COMMAND fuzz_tester -max_total_time=10)\n", } @@ -248,7 +248,7 @@ def test_ctest_regexes_choose_the_tests_it_runs(self) -> None: ): with self.subTest(line=line): files = { - **fixture_files("well_configured_c_cpp"), + **fixture_files("well_configured_cpp"), **github_job("ubuntu-latest", line), "fuzz_test/CMakeLists.txt": FUZZ_TESTER_REGISTRATION, } diff --git a/tests/test_grid.py b/tests/test_grid.py index 8638c911..6524776a 100644 --- a/tests/test_grid.py +++ b/tests/test_grid.py @@ -33,9 +33,9 @@ def coverage_and_formatting() -> list[Report]: check=cxx("coverage"), result=Result( status=Status.FAIL, - message="C/C++: fine; Python: none", + message="C++: fine; Python: none", places=( - Placed(ecosystem="C/C++", unit=".", result=Result.passed("fine"), tools=("gcovr",)), + Placed(ecosystem="C++", unit=".", result=Result.passed("fine"), tools=("gcovr",)), Placed(ecosystem="Python", unit="tools", result=Result.failed("none")), ), ), @@ -45,7 +45,7 @@ def coverage_and_formatting() -> list[Report]: result=Result( status=Status.PASS, message="ok", - places=(Placed(ecosystem="C/C++", unit=".", result=Result.passed("ok"), tools=("clang-format",)),), + places=(Placed(ecosystem="C++", unit=".", result=Result.passed("ok"), tools=("clang-format",)),), ), ) return [coverage, formatting] @@ -57,10 +57,10 @@ def test_a_grid_of_two_ecosystems_in_two_units(self) -> None: render_grid(coverage_and_formatting()), "# project_validator results\n\n✅ pass · ⚠️ warn · ❌ fail · ❗ error · ⏭️ skip · — does not apply\n\n" "## Results by ecosystem\n\n" - "| Check | C/C++ in the root | Python in tools |\n|---|---|---|\n" + "| Check | C++ in the root | Python in tools |\n|---|---|---|\n" "| `coverage` | ✅ gcovr | ❌ |\n" "| `code-formatting` | ✅ clang-format | — |\n\n" - "## Findings\n\n- ❌ `coverage`: C/C++: fine; Python: none\n", + "## Findings\n\n- ❌ `coverage`: C++: fine; Python: none\n", ) def test_one_unit_heads_columns_by_ecosystem_alone(self) -> None: @@ -72,12 +72,12 @@ def test_one_unit_heads_columns_by_ecosystem_alone(self) -> None: message="ok", places=( Placed(ecosystem="Python", unit=".", result=Result.passed("ok")), - Placed(ecosystem="C/C++", unit=".", result=Result.passed("ok")), + Placed(ecosystem="C++", unit=".", result=Result.passed("ok")), ), ), ) ] - self.assertIn("| Check | C/C++ | Python |\n|---|---|---|\n| `a` | ✅ | ✅ |\n", render_grid(reports)) + self.assertIn("| Check | C++ | Python |\n|---|---|---|\n| `a` | ✅ | ✅ |\n", render_grid(reports)) def test_no_ecosystem_recognised_is_said(self) -> None: # A project of no recognised ecosystem: the language checks skip without a place, so the grid has no column. @@ -96,13 +96,13 @@ def test_whole_project_table_and_skipped_marks(self) -> None: result=Result( status=Status.SKIP, message="n/a", - places=(Placed(ecosystem="C/C++", unit=".", result=Result.skipped("n/a")),), + places=(Placed(ecosystem="C++", unit=".", result=Result.skipped("n/a")),), ), ) self.assertEqual( render_grid([ci, skipped]), "# project_validator results\n\n✅ pass · ⚠️ warn · ❌ fail · ❗ error · ⏭️ skip · — does not apply\n\n" - "## Results by ecosystem\n\n| Check | C/C++ |\n|---|---|\n| `hardening` | ⏭️ |\n\n" + "## Results by ecosystem\n\n| Check | C++ |\n|---|---|\n| `hardening` | ⏭️ |\n\n" "## Whole project\n\n| Check | Result |\n|---|---|\n| `ci-present` | ✅ found |\n", ) @@ -123,7 +123,7 @@ def test_tools_are_escaped_and_marks_cover_every_status(self) -> None: result=Result( status=Status.PASS, message="ok", - places=(Placed(ecosystem="C/C++", unit=".", result=Result.passed("ok"), tools=("a|b",)),), + places=(Placed(ecosystem="C++", unit=".", result=Result.passed("ok"), tools=("a|b",)),), ), ) self.assertIn("| `p` | ✅ a\\|b |", render_grid([piped])) @@ -136,7 +136,7 @@ def test_markdown_in_messages_details_and_tools_is_escaped(self) -> None: status=Status.WARN, message="git rm -r --cached ", details=("consider ignoring __pycache__/",), - places=(Placed(ecosystem="C/C++", unit=".", result=Result.warned("w"), tools=("![a](b)",)),), + places=(Placed(ecosystem="C++", unit=".", result=Result.warned("w"), tools=("![a](b)",)),), ), ) out = render_grid([report]) @@ -155,12 +155,12 @@ def test_an_ecosystem_wide_result_spans_the_units_of_its_ecosystem(self) -> None ) formatting = placed_report( cxx("code-formatting"), - Placed(ecosystem="C/C++", unit=".", result=Result.passed("ok")), + Placed(ecosystem="C++", unit=".", result=Result.passed("ok")), Placed(ecosystem="Python", unit="py", result=Result.passed("ok")), ) out = render_grid([matrix, formatting]) self.assertIn( - "| Check | C/C++ in the root | Python in py |\n|---|---|---|\n| `platform-matrix` | — | ✅ |\n", out + "| Check | C++ in the root | Python in py |\n|---|---|---|\n| `platform-matrix` | — | ✅ |\n", out ) self.assertNotIn("Python in the root", out) @@ -171,13 +171,13 @@ def test_an_ecosystem_with_only_a_whole_project_place_is_headed_by_its_label(sel status=Status.FAIL, message="no", places=( - Placed(ecosystem="C/C++", unit=".", result=Result.passed("ok")), + Placed(ecosystem="C++", unit=".", result=Result.passed("ok")), Placed(ecosystem="Rust", unit="", result=Result.failed("no")), ), ), ) self.assertIn( - "| Check | Rust | C/C++ in the root |\n|---|---|---|\n| `platform-matrix` | ❌ | ✅ |\n", + "| Check | Rust | C++ in the root |\n|---|---|---|\n| `platform-matrix` | ❌ | ✅ |\n", render_grid([matrix]), ) diff --git a/tests/test_javascript.py b/tests/test_javascript.py index 82354ac4..c9c8e7e9 100644 --- a/tests/test_javascript.py +++ b/tests/test_javascript.py @@ -1,4 +1,4 @@ -"""The JavaScript/TypeScript profile's rules, judged by the generic checks in every JavaScript project layout.""" +"""The JavaScript profile's rules, judged by the generic checks in every JavaScript project layout.""" from __future__ import annotations @@ -21,7 +21,7 @@ from project_validator.checks.vcs_ignore import vcs_ignore from project_validator.checks.warnings_as_errors import warnings_as_errors from project_validator.core import Check, Result, Status -from project_validator.ecosystems.javascript import JAVASCRIPT_AND_TYPESCRIPT, JS_PACKAGE_MANAGER, NODE_MODULES +from project_validator.ecosystems.javascript import JAVASCRIPT_ECOSYSTEM, JS_PACKAGE_MANAGER, NODE_MODULES from project_validator.facts import Command, Unknown from tests.support import ( GITHUB_WORKFLOW, @@ -34,10 +34,7 @@ _GATE_HINT = "consider failing CI when branch coverage falls below a threshold" _REPORT_HINT = "consider reporting branch coverage where it can be seen (a report CI publishes, a coverage service)" -TYPE_HINT = ( - "consider running a type checker in CI: tsc --noEmit (JavaScript is checked with checkJs in a " - "jsconfig.json) or deno check" -) +TYPE_HINT = "consider running a type checker in CI: tsc --noEmit or deno check" STRICT_HINT = ( 'consider enabling strict mode: "strict": true in the compilerOptions of tsconfig.json or deno check ' "(strict by default)" @@ -81,7 +78,7 @@ def test_sources_in_node_modules_do_not_count(self) -> None: class JavaScriptTests(unittest.TestCase): def _run(self, selected: Check, files: dict[str, str]) -> Result: - return run_as(self, selected, files, JAVASCRIPT_AND_TYPESCRIPT) + return run_as(self, selected, files, JAVASCRIPT_ECOSYSTEM) def test_formatting_is_enforced_by_any_formatter_in_ci_or_a_script_it_runs(self) -> None: for files in ( @@ -203,7 +200,7 @@ def test_package_manager_audits_count_but_not_signature_checks(self) -> None: class FunctionLimitTests(unittest.TestCase): def _run(self, files: dict[str, str]) -> Result: - return run_as(self, function_limits, files, JAVASCRIPT_AND_TYPESCRIPT) + return run_as(self, function_limits, files, JAVASCRIPT_ECOSYSTEM) def test_eslint_max_lines_per_function_limits_functions_when_eslint_runs(self) -> None: config = {"eslint.config.js": 'export default [{ rules: { "max-lines-per-function": ["error", 40] } }];\n'} @@ -223,7 +220,7 @@ def test_a_disabled_rule_limits_nothing(self) -> None: class StaticAnalysisTests(unittest.TestCase): def _run(self, selected: Check, files: dict[str, str]) -> Result: - return run_as(self, selected, files, JAVASCRIPT_AND_TYPESCRIPT) + return run_as(self, selected, files, JAVASCRIPT_ECOSYSTEM) def test_a_linter_is_the_static_analyzer(self) -> None: files = {"eslint.config.js": "export default [];\n", **_scripts(lint="eslint ."), **_ci("npm run lint")} @@ -242,7 +239,7 @@ def test_security_lints_are_a_plugin_or_semgrep_rules(self) -> None: class TypeCheckingTests(unittest.TestCase): def _npm(self, files: dict[str, str]) -> Result: - return run_in_layout(self, "npm JavaScript", type_checking, files) + return run_in_layout(self, "npm TypeScript", type_checking, files) def _deno(self, files: dict[str, str]) -> Result: return run_in_layout(self, "Deno TypeScript", type_checking, files) @@ -319,7 +316,7 @@ def test_the_package_license_must_match_the_license_file(self) -> None: class OutputTests(unittest.TestCase): def _run(self, selected: Check, files: dict[str, str]) -> Result: - return run_as(self, selected, files, JAVASCRIPT_AND_TYPESCRIPT) + return run_as(self, selected, files, JAVASCRIPT_ECOSYSTEM) def test_node_modules_must_be_ignored(self) -> None: for entry in ("node_modules", "/node_modules/", "**/node_modules"): diff --git a/tests/test_javascript_and_typescript.py b/tests/test_javascript_and_typescript.py new file mode 100644 index 00000000..655d5472 --- /dev/null +++ b/tests/test_javascript_and_typescript.py @@ -0,0 +1,67 @@ +"""JavaScript and TypeScript are separate ecosystems: they share the npm and Deno tooling, but type checking is +TypeScript's defining gate and not a norm of JavaScript.""" + +from __future__ import annotations + +import unittest +from collections.abc import Mapping + +from project_validator.checks.type_checking import type_checking +from project_validator.ecosystems import applies_to +from tests.support import make_context, temp_project + +PACKAGE = '{"name": "app", "main": "dist/index.js", "types": "dist/index.d.ts"}\n' + + +def _structure(files: Mapping[str, str]) -> tuple[list[str], list[str]]: + """The project's languages, and the language ecosystems recognised (package.json is JSON data too).""" + with temp_project(files) as root: + structure = make_context(root).structure + return sorted(structure.languages), sorted(label for label in structure.recognised_by if label != "Data") + + +class EcosystemTests(unittest.TestCase): + def test_javascript_sources_make_a_javascript_project(self) -> None: + self.assertEqual( + _structure({"package.json": '{"main": "index.js"}\n', "index.js": ""}), (["JavaScript"], ["JavaScript"]) + ) + + def test_typescript_sources_make_a_typescript_project(self) -> None: + self.assertEqual(_structure({"package.json": PACKAGE, "src/index.ts": ""}), (["TypeScript"], ["TypeScript"])) + + def test_a_package_built_from_typescript_is_not_javascript(self) -> None: + """Its package.json names the JavaScript it publishes (`main`), but the code is TypeScript.""" + languages, _ = _structure({"package.json": PACKAGE, "src/index.ts": "", "tsconfig.json": "{}\n"}) + self.assertEqual(languages, ["TypeScript"]) + + def test_tool_configuration_in_javascript_does_not_make_a_typescript_project_javascript(self) -> None: + files = { + "package.json": PACKAGE, + "src/index.ts": "", + "eslint.config.js": "", + "vite.config.mjs": "", + ".prettierrc.cjs": "", + "jest.config.js": "", + } + self.assertEqual(_structure(files), (["TypeScript"], ["TypeScript"])) + + def test_tool_configuration_of_a_javascript_project_is_javascript(self) -> None: + self.assertEqual( + _structure({"package.json": "{}\n", "eslint.config.js": "", "index.js": ""})[0], ["JavaScript"] + ) + + def test_both_languages_make_both(self) -> None: + self.assertEqual(_structure({"src/index.ts": "", "scripts/build.js": ""})[1], ["JavaScript", "TypeScript"]) + + +class TypeCheckingTests(unittest.TestCase): + def test_type_checking_is_asked_of_typescript(self) -> None: + self.assertIn("TypeScript", applies_to(type_checking)) + + def test_type_checking_is_not_asked_of_javascript(self) -> None: + """Type checking JavaScript (checkJs, JSDoc types) is a choice, not the ecosystem's norm.""" + self.assertNotIn("JavaScript", applies_to(type_checking)) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_judging.py b/tests/test_judging.py index a0850851..ec347f2f 100644 --- a/tests/test_judging.py +++ b/tests/test_judging.py @@ -6,7 +6,7 @@ from collections.abc import Callable from project_validator.core import Check, Options, Placed, Result, Status -from project_validator.ecosystems.c_cpp import C_AND_CXX +from project_validator.ecosystems.cpp import CXX from project_validator.ecosystems.python import PYTHON from project_validator.facts import Facts from project_validator.facts.coverage import Granularity @@ -229,12 +229,12 @@ def test_by_ecosystem_names_the_places_and_makes_one_of_a_plain_result(self) -> message="ok", places=(Placed(ecosystem="", unit="lib", result=Result.passed("ok"), tools=("t",)),), ) - result = by_ecosystem({C_AND_CXX: inner, PYTHON: Result.skipped("n/a")}) + result = by_ecosystem({CXX: inner, PYTHON: Result.skipped("n/a")}) self.assertEqual(result, Result.passed("ok")) self.assertEqual( result.places, ( - Placed(ecosystem="C/C++", unit="lib", result=Result.passed("ok"), tools=("t",)), + Placed(ecosystem="C++", unit="lib", result=Result.passed("ok"), tools=("t",)), Placed(ecosystem="Python", unit="", result=Result.skipped("n/a")), ), ) diff --git a/tests/test_leaderboard.py b/tests/test_leaderboard.py index 0d4eea64..71e2cc20 100644 --- a/tests/test_leaderboard.py +++ b/tests/test_leaderboard.py @@ -7,6 +7,8 @@ import contextlib import io import json +import math +import re import shutil import subprocess import tempfile @@ -21,12 +23,12 @@ from leaderboard import SEED, Entry, ManifestError, by_name, entries, parse from leaderboard.__main__ import PREVIEW_MARKER, check, main -from leaderboard.evaluation import evaluate, failed, fetch, write +from leaderboard.evaluation import REPORT, evaluate, failed, fetch, write from leaderboard.history import movement, ranked, read_history, record from leaderboard.rules import BOARDS, MOST_KB, Repository, changed, duplicates, problems from leaderboard.site import badge, build, sparkline from project_validator.core import Context, ExtractionError -from project_validator.score import SCORE_VERSION +from project_validator.score import LEVEL_NAMES, SCORE_VERSION from tests.support import FIXTURES WORKFLOWS = Path(__file__).resolve().parent.parent / ".github" / "workflows" @@ -42,14 +44,14 @@ def setUp(self) -> None: self.entries = entries() def test_the_seed_list_has_one_project_per_language(self) -> None: - self.assertEqual(len(self.entries), 26) + self.assertEqual(len(self.entries), 28) languages = [entry.language for entry in self.entries] self.assertEqual(sorted(set(languages)), sorted(languages)) self.assertLessEqual(set(languages), BOARDS) def test_compiler_explorer_is_the_typescript_seed(self) -> None: (entry,) = by_name(["compiler-explorer/compiler-explorer"], self.entries) - self.assertEqual(entry.language, "JavaScript/TypeScript") + self.assertEqual(entry.language, "TypeScript") def test_every_entry_is_well_formed_and_listed_once(self) -> None: self.assertEqual(duplicates(self.entries), []) @@ -160,7 +162,8 @@ def _git(directory: Path, *arguments: str) -> str: ).stdout.strip() -def _result(name: str, level: int, completeness: float, depth: int, **extra: object) -> dict[str, object]: +def _result(name: str, level: int, percent: float, **extra: object) -> dict[str, object]: + """A night's result, scored `percent` at `level`, as `evaluate` writes it.""" cells = extra.pop("cells", []) return { "name": name, @@ -170,27 +173,29 @@ def _result(name: str, level: int, completeness: float, depth: int, **extra: obj "evaluated": "2026-11-18T03:17:00Z", "score": { "version": SCORE_VERSION, + "percent": percent, "level": level, - "completeness": completeness, - "depth": depth, - "locked_depth": 0, + "level_name": LEVEL_NAMES[level], + "filled": 3, + "slots": 4, + "summary": extra.pop("summary", f"{math.floor(percent)}% · Level {level} {LEVEL_NAMES[level]}"), "cells": cells, - "opportunities": extra.pop("opportunities", []), + "next_steps": extra.pop("next_steps", []), }, **extra, } -def _line(date: str, commit: str, level: int, completeness: float, depth: int) -> dict[str, object]: +def _line(date: str, commit: str, level: int, percent: float) -> dict[str, object]: """A night's history line.""" - numbers = {"version": SCORE_VERSION, "level": level, "completeness": completeness, "depth": depth} + numbers = {"version": SCORE_VERSION, "percent": percent, "level": level, "filled": 3, "slots": 4} return {"date": date, "commit": commit, "validator": "v" * 40, **numbers} -def _opportunity(**overrides: object) -> dict[str, object]: - """An opportunity as the score's JSON has it: a project cell of coverage, unless overridden.""" +def _step(**overrides: object) -> dict[str, object]: + """A next step as the score's JSON has it: the project's own coverage slot, unless overridden.""" defaults: dict[str, object] = {"check": "coverage", "ecosystem": "", "unit": "", "tier": "project"} - defaults |= {"status": "FAIL", "level": 2, "completeness": 0.01, "depth": 0, "blocks": None, "unlocks": None} + defaults |= {"status": "FAIL", "level": 2, "points": 1.0, "needed_for": None, "completes": False} return defaults | overrides @@ -203,8 +208,9 @@ def _cell(check: str, *tools: str) -> dict[str, object]: "tier": "core", "status": "PASS", "tools": list(tools), - "points": 10, - "counted": True, + "weight": 1.0, + "filled": 1.0, + "extra": 0, } @@ -235,11 +241,21 @@ def test_a_project_is_scored_with_every_check(self) -> None: self.assertIn({"check": "license", "status": "PASS", "message": "the project is licensed under MIT"}, checks) self.assertNotIn("error", result) + def test_the_full_html_report_is_written_beside_the_result(self) -> None: + with _directory() as root: + shutil.copytree(FIXTURES / "well_configured_python", root / "p") + result = evaluate(self.ENTRY, root / "p", commit="c" * 40, validator="v" * 40, now=NOW) + self.assertTrue(str(result[REPORT]).startswith("")) + path = write(result, root / "out") + self.assertNotIn(REPORT, json.loads(path.read_text())) + self.assertIn("project_validator", path.with_suffix(".html").read_text()) + self.assertFalse(write(failed(self.ENTRY, "x", validator="v"), root / "bare").with_suffix(".html").exists()) + def test_the_entry_s_auxiliary_and_exclude_reach_the_validator(self) -> None: with _directory() as root: shutil.copytree(FIXTURES / "well_configured_python", root / "p") - shutil.copytree(FIXTURES / "bare_c_cpp", root / "p" / "examples" / "c") - completeness = {} + shutil.copytree(FIXTURES / "bare_cpp", root / "p" / "examples" / "c") + percents = {} for label, entry in ( ("plain", self.ENTRY), ("auxiliary", Entry(name="o/well", language="Python", consent=SEED, auxiliary=("example",))), @@ -248,9 +264,9 @@ def test_the_entry_s_auxiliary_and_exclude_reach_the_validator(self) -> None: scored = evaluate(entry, root / "p", commit="c", validator="v")["score"] if not isinstance(scored, dict): self.fail(scored) - completeness[label] = scored["completeness"] - self.assertLess(completeness["plain"], completeness["auxiliary"]) - self.assertLess(completeness["auxiliary"], completeness["excluded"]) + percents[label] = scored["percent"] + self.assertLess(percents["plain"], percents["auxiliary"]) + self.assertLess(percents["auxiliary"], percents["excluded"]) def test_an_extraction_failure_is_recorded_without_the_checkout_s_path(self) -> None: with _directory() as root: @@ -331,25 +347,32 @@ def _night(self, data: Path, date: str, *results: dict[str, object]) -> list[str def test_each_night_is_one_history_line_and_the_last_becomes_previous(self) -> None: with _directory() as data: - self.assertEqual(self._night(data, "2026-11-17", _result("o/r", 1, 0.5, 30)), ["o/r"]) + self.assertEqual(self._night(data, "2026-11-17", _result("o/r", 1, 50)), ["o/r"]) self.assertFalse((data / "previous" / "o--r.json").exists()) - self._night(data, "2026-11-18", _result("o/r", 2, 0.75, 45, commit="b" * 40)) + self._night(data, "2026-11-18", _result("o/r", 2, 75, commit="b" * 40)) history = read_history(data / "history" / "o--r.jsonl") - self.assertEqual( - history, [_line("2026-11-17", "a" * 40, 1, 0.5, 30), _line("2026-11-18", "b" * 40, 2, 0.75, 45)] - ) + self.assertEqual(history, [_line("2026-11-17", "a" * 40, 1, 50), _line("2026-11-18", "b" * 40, 2, 75)]) previous = json.loads((data / "previous" / "o--r.json").read_text()) self.assertEqual(previous["score"]["level"], 1) self.assertEqual(json.loads((data / "latest" / "o--r.json").read_text())["score"]["level"], 2) def test_a_rerun_of_a_night_replaces_it(self) -> None: with _directory() as data: - self._night(data, "2026-11-17", _result("o/r", 1, 0.5, 30)) - self._night(data, "2026-11-18", _result("o/r", 1, 0.6, 30)) - self._night(data, "2026-11-18", _result("o/r", 1, 0.7, 30)) + self._night(data, "2026-11-17", _result("o/r", 1, 50)) + self._night(data, "2026-11-18", _result("o/r", 1, 60)) + self._night(data, "2026-11-18", _result("o/r", 1, 70)) history = read_history(data / "history" / "o--r.jsonl") - self.assertEqual([line["completeness"] for line in history], [0.5, 0.7]) - self.assertEqual(json.loads((data / "previous" / "o--r.json").read_text())["score"]["completeness"], 0.5) + self.assertEqual([line["percent"] for line in history], [50, 70]) + self.assertEqual(json.loads((data / "previous" / "o--r.json").read_text())["score"]["percent"], 50) + + def test_the_latest_report_alone_is_kept(self) -> None: + with _directory() as data: + with _directory() as results: + write({**_result("o/r", 1, 50), REPORT: "night one"}, results) + record(results, data, "2026-11-17") + self.assertEqual((data / "reports" / "o--r.html").read_text(), "night one") + self._night(data, "2026-11-18", _result("o/r", 1, 50)) + self.assertFalse((data / "reports" / "o--r.html").exists()) def test_an_unscored_night_is_kept(self) -> None: with _directory() as data: @@ -363,39 +386,74 @@ def test_a_missing_history_is_empty(self) -> None: class MovementTests(unittest.TestCase): def test_tools_that_arrived_or_left_and_the_numbers(self) -> None: - before = _result("o/r", 1, 0.5, 30, cells=[_cell("static-analysis", "clippy"), _cell("coverage", "grcov")]) - after = _result("o/r", 2, 0.625, 35, commit="b" * 40, cells=[_cell("static-analysis", "clippy", "cargo-deny")]) + before = _result("o/r", 1, 50, cells=[_cell("static-analysis", "clippy"), _cell("coverage", "grcov")]) + after = _result("o/r", 2, 62.5, commit="b" * 40, cells=[_cell("static-analysis", "clippy", "cargo-deny")]) self.assertEqual( movement(before, after), - ["+cargo-deny (static-analysis)", "-grcov (coverage)", "Level 1 → 2", "+12.5% completeness", "+5 depth"], + ["+cargo-deny (static-analysis)", "-grcov (coverage)", "Level 1 → 2", "+12.5 points"], ) def test_a_change_without_a_new_commit_is_the_validator_s(self) -> None: self.assertEqual( - movement(_result("o/r", 1, 0.5, 30), _result("o/r", 1, 0.5, 20)), - ["-10 depth", "same commit: the validator changed"], + movement(_result("o/r", 1, 50), _result("o/r", 1, 40)), + ["-10.0 points", "same commit: the validator changed"], ) def test_no_change_and_a_first_night(self) -> None: - self.assertEqual(movement(_result("o/r", 1, 0.5, 30), _result("o/r", 1, 0.5, 30)), []) - self.assertEqual(movement(None, _result("o/r", 1, 0.5, 30)), ["new on the board"]) - self.assertEqual(movement(failed(EvaluationTests.ENTRY, "x", validator="v"), _result("o/r", 1, 0.5, 30)), []) + self.assertEqual(movement(_result("o/r", 1, 50), _result("o/r", 1, 50)), []) + self.assertEqual(movement(None, _result("o/r", 1, 50)), ["new on the board"]) + self.assertEqual(movement(failed(EvaluationTests.ENTRY, "x", validator="v"), _result("o/r", 1, 50)), []) class RankingTests(unittest.TestCase): - def test_level_then_completeness_then_depth_and_the_unscored_last(self) -> None: + def test_the_score_then_the_level_then_the_name_and_the_unscored_last(self) -> None: results = [ failed(EvaluationTests.ENTRY, "x", validator="v"), - _result("a/deep", 1, 0.9, 500), - _result("b/high", 2, 0.4, 10), - _result("c/complete", 1, 0.95, 5), - _result("d/tie", 1, 0.9, 600), + _result("a/tie", 1, 90), + _result("b/high", 2, 40), + _result("c/extra", 4, 104), + _result("d/tie", 2, 90), + _result("e/tie", 1, 90), ] self.assertEqual( - [result["name"] for result in ranked(results)], ["b/high", "c/complete", "d/tie", "a/deep", "o/well"] + [result["name"] for result in ranked(results)], ["c/extra", "d/tie", "a/tie", "e/tie", "b/high", "o/well"] ) +class EarlierScoreVersionTests(unittest.TestCase): + """A night scored by an earlier version of the score (the data branch before the score changed) holds other + numbers: it is not compared, ranked or shown as this version's.""" + + OLD = _result("o/old", 0, 0) | {"score": {"version": "0", "completeness": 0.47, "depth": 50, "level": 0}} + + def test_it_ranks_with_the_unscored_and_moves_nothing(self) -> None: + self.assertEqual([result["name"] for result in ranked([self.OLD, _result("o/new", 1, 10)])], ["o/new", "o/old"]) + self.assertEqual(movement(self.OLD, _result("o/old", 1, 50)), []) + + def test_the_board_and_its_page_say_it_awaits_tonight(self) -> None: + with _directory() as data: + with _directory() as results: + write(self.OLD, results) + record(results, data, "2026-11-18") + pages, files = build((Entry(name="o/old", language="Rust", consent=SEED),), data, "https://o.github.io/p/") + self.assertIn("Not scored tonight: scored by score version 0", pages["leaderboard/projects/o--old.html"]) + self.assertIn('-', pages["leaderboard/index.html"]) + self.assertEqual(json.loads(files["leaderboard/badges/o--old.json"])["message"], "error") + + def test_its_night_is_left_out_of_the_history_drawn(self) -> None: + entry = Entry(name="o/old", language="Rust", consent=SEED) + with _directory() as data: + for date, result in ( + ("2026-11-17", self.OLD | {"score": {"version": "0", "percent": 5}}), + ("2026-11-18", _result("o/old", 1, 50)), + ): + with _directory() as results: + write(result, results) + record(results, data, date) + pages, _ = build((entry,), data, "https://o.github.io/p/") + self.assertIn("The history starts after a second night.", pages["leaderboard/projects/o--old.html"]) + + class SiteTests(unittest.TestCase): LISTED = ( Entry(name="o/first", language="Rust", consent=SEED), @@ -407,36 +465,38 @@ class SiteTests(unittest.TestCase): FIRST = _result( "o/first", 2, - 0.75, - 40, + 75, commit="b" * 40, seed=True, unknowns=2, cells=[_cell("static-analysis", "clippy | lint")], - opportunities=[ - _opportunity(check="fuzz-testing", ecosystem="Rust", unit=".", tier="core", status="WARN", level=3) - | {"completeness": 0.0625, "depth": 5, "blocks": 3, "unlocks": 3} + next_steps=[ + _step(check="fuzz-testing", ecosystem="Rust", unit=".", tier="core", status="WARN", level=3) + | {"points": 6.25, "needed_for": 3, "completes": True} ], ) def _data(self, data: Path) -> None: - second = _result("o/second", 1, 0.5, 30, language="Go") + second = _result("o/second", 1, 50, language="Go") with _directory() as results: - write(_result("o/first", 1, 0.5, 30), results) + write(_result("o/first", 1, 50), results) write(second, results) record(results, data, "2026-11-17") with _directory() as results: write(self.FIRST, results) write(second, results) write(failed(self.LISTED[2], "git fetch failed", validator="v"), results) - write(_result("gone/away", 4, 1.0, 999), results) # recorded once, since removed from the list + write(_result("gone/away", 4, 100), results) # recorded once, since removed from the list record(results, data, "2026-11-18") def test_before_the_first_night_the_board_lists_the_projects(self) -> None: pages, files = build(self.LISTED, None, "https://o.github.io/p/") self.assertEqual(set(pages), {"leaderboard/index.html"}) self.assertIn("No nightly results yet", pages["leaderboard/index.html"]) - self.assertIn("- [o/first](https://github.com/o/first) (Rust)", pages["leaderboard/index.html"]) + self.assertIn( + 'o/first', pages["leaderboard/index.html"] + ) + self.assertIn("[how the score works](../docs/score.md)", pages["leaderboard/index.html"]) self.assertEqual(files, {"leaderboard/data/latest.json": "[]\n"}) def test_the_boards_rank_every_listed_project(self) -> None: @@ -444,17 +504,22 @@ def test_the_boards_rank_every_listed_project(self) -> None: self._data(data) pages, _ = build(self.LISTED, data, "https://o.github.io/p/") board = pages["leaderboard/index.html"] - self.assertIn( - "| 1 | [o/first](projects/o--first.md) | Rust | 2 | 75% | 40 " - "| +clippy \\| lint (static-analysis), Level 1 → 2, +25.0% completeness, +10 depth |", - board, + rows = re.findall(r"", board) + self.assertEqual( + [re.search(r"(.*?)", row).group(1) for row in rows], # type: ignore[union-attr] + ["o/first", "o/second", "o/broken"], ) - self.assertIn("| 2 | [o/second](projects/o--second.md) | Go | 1 | 50% | 30 | - |", board) - self.assertIn("| 3 | [o/broken](projects/o--broken.md) | Go | - | - | - | error: git fetch failed |", board) + first, second, broken = rows + self.assertIn('1', first) + self.assertIn('href="projects/o--first.html"', first) + self.assertIn('seed', first) + self.assertIn("75%", first) + self.assertIn("Level 2 · Analysis", first) + self.assertIn("+clippy | lint (static-analysis), Level 1 → 2, +25.0 points", first) + self.assertIn('data-language="Go"', second) + self.assertIn('error git fetch failed', broken) self.assertNotIn("gone/away", board) - go_board = board.split("### Go", 1)[1] - self.assertIn("| 1 | [o/second](projects/o--second.md) | 1 | 50% | 30 | - |", go_board) - self.assertLess(board.index("### Go"), board.index("### Rust")) + self.assertIn('', board) def test_a_project_page(self) -> None: with _directory() as data: @@ -463,46 +528,59 @@ def test_a_project_page(self) -> None: page = pages["leaderboard/projects/o--first.html"] self.assertTrue(page.startswith("# o/first\n")) for expected in ( - "- A seed: awaiting a maintainer's confirmation", - f"- Commit evaluated: [bbbbbbbbbbbb](https://github.com/o/first/commit/{'b' * 40})", + "a seed, awaiting a maintainer's confirmation", + f'commit bbbbbbbbbbbb', f"score version {SCORE_VERSION}", - "- 2 check(s) judged by what could be read", - "**Level 2 · 75% complete · 40 depth**", + "2 check(s) judged by what could be read", + "Level 2 · Analysis", "fuzz-testing completes Level 3', + "+6.2", + 'clippy | lint', + "1.0 of 1.0", "https://img.shields.io/endpoint?url=https://o.github.io/p/leaderboard/badges/o--first.json", ): with self.subTest(expected=expected): self.assertIn(expected, page) + self.assertNotIn("the full report", page) self.assertIn("Not scored tonight: git fetch failed", pages["leaderboard/projects/o--broken.html"]) - self.assertIn("Every applicable cell is covered.", pages["leaderboard/projects/o--second.html"]) + self.assertIn("Every quality gate that applies is in place.", pages["leaderboard/projects/o--second.html"]) self.assertEqual( json.loads(files["leaderboard/badges/o--first.json"]), - {"schemaVersion": 1, "label": "project_validator", "message": "Level 2 · 75%", "color": "yellow"}, + {"schemaVersion": 1, "label": "project_validator", "message": "75% · Level 2", "color": "yellow"}, ) latest = json.loads(files["leaderboard/data/latest.json"]) self.assertEqual([entry["name"] for entry in latest], ["o/first", "o/second", "o/broken"]) + def test_a_project_s_full_report_is_published_and_linked(self) -> None: + with _directory() as data: + with _directory() as results: + write({**_result("o/first", 1, 50), REPORT: "report"}, results) + record(results, data, "2026-11-18") + pages, files = build(self.LISTED, data, "https://o.github.io/p/") + self.assertEqual(files["leaderboard/reports/o--first.html"], "report") + self.assertIn('', pages["leaderboard/projects/o--first.html"]) + def test_a_long_list_of_next_steps_is_cut(self) -> None: - opportunity = _opportunity() + step = _step() with _directory() as data: with _directory() as results: - write(_result("o/first", 1, 0.5, 30, opportunities=[opportunity] * 12), results) + write(_result("o/first", 1, 50, next_steps=[step] * 12), results) record(results, data, "2026-11-18") pages, _ = build(self.LISTED, data, "https://o.github.io/p/") page = pages["leaderboard/projects/o--first.html"] - self.assertIn("| `coverage` | the project | project | FAIL | +1.0% | +0 | |", page) + self.assertIn("coveragethe project", page) self.assertIn("And 2 more.", page) def test_badges(self) -> None: - self.assertEqual(badge(_result("o/r", 4, 1.0, 9))["color"], "brightgreen") - self.assertEqual(badge(_result("o/r", 0, 0.123, 9))["message"], "Level 0 · 12%") + self.assertEqual(badge(_result("o/r", 4, 100))["color"], "brightgreen") + self.assertEqual(badge(_result("o/r", 0, 12.3))["message"], "12% · Level 0") self.assertEqual(badge(failed(EvaluationTests.ENTRY, "x", validator="v"))["message"], "error") def test_sparkline(self) -> None: - self.assertEqual(sparkline([0.5]), "") - self.assertIn('points="0.0,20.0 120.0,10.0 240.0,0.0"', sparkline([0.5, 0.75, 1.0])) + self.assertEqual(sparkline([50]), "") + self.assertIn('points="0.0,20.0 120.0,10.0 240.0,0.0"', sparkline([50, 75, 100])) + self.assertIn('points="0.0,20.0 240.0,0.0"', sparkline([60, 120])) class PreviewTests(unittest.TestCase): @@ -512,12 +590,8 @@ def _scored(self, entry: Entry) -> dict[str, object]: return _result( entry.name, 1, - 0.5, - 30, - opportunities=[ - {"check": "coverage", "ecosystem": "Rust", "unit": ".", "tier": "core"}, - {"check": "license", "ecosystem": "", "unit": "", "tier": "project"}, - ], + 50, + next_steps=[_step(ecosystem="Rust", unit=".", tier="core", points=25), _step(check="license", points=12.5)], ) def test_a_new_entry_is_previewed_with_its_score_and_next_steps(self) -> None: @@ -525,8 +599,8 @@ def test_a_new_entry_is_previewed_with_its_score_and_next_steps(self) -> None: self.assertTrue(ok) self.assertTrue(preview.startswith(PREVIEW_MARKER + "\n## Leaderboard preview\n")) self.assertIn("### [new/one](https://github.com/new/one) on the Rust board", preview) - self.assertIn("**Level 1 · 50% complete · 30 depth**", preview) - self.assertIn("- `coverage` (Rust in .)\n- `license`\n", preview) + self.assertIn("**50% · Level 1 Foundations**", preview) + self.assertIn("- `coverage` (Rust): +25.0 points\n- `license`: +12.5 points\n", preview) self.assertNotIn("owner/repo", preview) def test_problems_fail_the_check_and_skip_the_evaluation(self) -> None: @@ -546,10 +620,10 @@ def test_a_duplicate_fails_and_an_unscored_entry_says_why(self) -> None: def test_an_entry_without_next_steps_and_one_rounded_down(self) -> None: def complete(entry: Entry) -> dict[str, object]: - return _result(entry.name, 4, 0.996, 300) + return _result(entry.name, 3, 99.6) _, preview = check([], [self.NEW], lambda _: PUBLIC, complete) - self.assertIn("**Level 4 · 99% complete · 300 depth**\n\nScored by", preview) + self.assertIn("**99% · Level 3 Hardening**\n\nScored by", preview) def test_nothing_changed(self) -> None: self.assertIn("No entry is added or changed.", check([ENTRY], [ENTRY], lambda _: PUBLIC, self._scored)[1]) @@ -569,7 +643,7 @@ def test_matrix_lists_every_name(self) -> None: def test_record_adds_the_results(self) -> None: with _directory() as root: - write(_result("o/r", 1, 0.5, 30), root / "results") + write(_result("o/r", 1, 50), root / "results") code, output, _ = self._run("record", str(root / "results"), str(root / "data"), "--date", "2026-11-18") self.assertEqual((code, output), (0, "o/r\n")) self.assertTrue((root / "data" / "history" / "o--r.jsonl").is_file()) diff --git a/tests/test_mutation.py b/tests/test_mutation.py index 226326f3..6df37ee1 100644 --- a/tests/test_mutation.py +++ b/tests/test_mutation.py @@ -6,7 +6,7 @@ import unittest from collections.abc import Mapping -from project_validator.ecosystems.c_cpp.mutation import DEXTOOL, MULL +from project_validator.c_family.mutation import DEXTOOL, MULL from project_validator.ecosystems.dotnet.mutation import STRYKER_NET from project_validator.ecosystems.go import GO_MUTESTING, GREMLINS from project_validator.ecosystems.javascript.mutation import STRYKER_JS diff --git a/tests/test_mutation_setup.py b/tests/test_mutation_setup.py index 55754cb5..50000a0b 100644 --- a/tests/test_mutation_setup.py +++ b/tests/test_mutation_setup.py @@ -4,6 +4,9 @@ from __future__ import annotations import ast +import re +import subprocess +import sys import tomllib import unittest from pathlib import Path @@ -58,6 +61,35 @@ def test_the_mutation_step_caps_each_worker_s_memory(self) -> None: for script in running: self.assertRegex(script, r"\bulimit -[vd] \d+") + @unittest.skipIf( + sys.platform == "win32", + "the mutation workflow runs on Linux; the bash Windows finds first is the WSL launcher, with no Linux", + ) + def test_running_out_of_budget_is_reported_not_failed(self) -> None: + # timeout sends INT at the budget's end and KILL two minutes later: mutmut busy in its stats pass ignores the + # INT, so a pull request with too much to mutate ends in 137, which is the budget running out, as 124 is. + workflow = yaml.safe_load(WORKFLOW.read_text(encoding="utf-8")) + script = next( + step["run"] for step in workflow["jobs"]["mutmut"]["steps"] if "budget_minutes" in step.get("run", "") + ) + check = next(line.strip() for line in script.splitlines() if line.strip().startswith('[ "$status" -eq 0 ]')) + for status, code in (("0", 0), ("124", 0), ("137", 0), ("1", 1)): + with self.subTest(status=status): + ran = subprocess.run( # noqa: S603 - bash with the workflow's own line + ["bash", "-c", f"status={status}; {check}"], # noqa: S607 - bash from PATH + check=False, + ) + self.assertEqual(min(ran.returncode, 1), code) + + def test_the_budget_and_its_kill_fit_in_the_job_s_timeout(self) -> None: + workflow = yaml.safe_load(WORKFLOW.read_text(encoding="utf-8")) + job = workflow["jobs"]["mutmut"] + script = next(step["run"] for step in job["steps"] if "budget_minutes" in step.get("run", "")) + budget = int(re.search(r"budget_minutes=(\d+)", script)[1]) # type: ignore[index] + # The priming run's 5 minutes, the budget, timeout's 2 minutes before KILL, and setup and the report. + self.assertLessEqual(5 + budget + 2 + 5, job["timeout-minutes"]) + self.assertGreaterEqual(budget, 30) + def test_the_fresh_import_test_is_left_out_of_mutation_runs(self) -> None: # It imports every module afresh, so mutmut maps every import-time function to it, yet it only fails on a # mutant that breaks an import: each such mutant paid its 70 seconds and survived. diff --git a/tests/test_practices.py b/tests/test_practices.py index b7b2ed13..85b77db9 100644 --- a/tests/test_practices.py +++ b/tests/test_practices.py @@ -52,7 +52,7 @@ def _command(line: str) -> Command: class TextsTests(unittest.TestCase): def test_hints_narrow_what_is_searched_for_each_requirement(self) -> None: - """Two requirements may share a pattern but search different commands (`-Werror` for C/C++ and for + """Two requirements may share a pattern but search different commands (`-Werror` for C and C++ and for Fortran, found by different hints): each gets its own matches, whichever asks first.""" cmake, fpm = _command("cmake -DWERROR=ON"), _command("fpm build --flag -DWERROR") texts = Texts(found=((cmake, cmake.line), (fpm, fpm.line))) diff --git a/tests/test_pretty.py b/tests/test_pretty.py deleted file mode 100644 index 0d728ceb..00000000 --- a/tests/test_pretty.py +++ /dev/null @@ -1,63 +0,0 @@ -from __future__ import annotations - -import io -import unittest -from unittest import mock - -from project_validator import pretty -from project_validator.core import Check, Result, Status -from project_validator.runner import Report -from tests.support import requires_rich - -ANSI_ESCAPE = "\x1b[" - - -def _report(name: str, result: Result) -> Report: - return Report(check=Check(name=name, description=name, run=lambda context: result), result=result) - - -REPORTS = [ - _report("ci-present", Result.passed("CI configuration found", ".github/workflows/ci.yml")), - _report("coverage", Result.warned("no path coverage")), - _report("platform-matrix", Result.failed("too few compilers")), -] - - -def _render(reports: list[Report]) -> str: - stream = io.StringIO() - pretty.print_reports(reports, stream) - return stream.getvalue() - - -@requires_rich -class PrettyTests(unittest.TestCase): - def test_output_is_colored(self) -> None: - self.assertIn(ANSI_ESCAPE, _render(REPORTS)) - - def test_every_result_and_detail_is_shown(self) -> None: - output = _render(REPORTS) - for text in ("ci-present", "CI configuration found", ".github/workflows/ci.yml", "too few compilers"): - self.assertIn(text, output) - - def test_summary_counts_each_status(self) -> None: - self.assertIn("1 passed", _render(REPORTS)) - self.assertIn("1 warned", _render(REPORTS)) - self.assertIn("1 failed", _render(REPORTS)) - - def test_summary_counts_skipped_checks(self) -> None: - skipped = _report("tests-run", Result(status=Status.SKIP, message="not applicable to Rust")) - self.assertIn("1 skipped", _render([*REPORTS, skipped])) - - def test_summary_without_checks(self) -> None: - self.assertIn("no checks were run", _render([])) - - def test_messages_are_not_treated_as_markup(self) -> None: - self.assertIn("[bold]literal[/bold]", _render([_report("markup", Result.passed("[bold]literal[/bold]"))])) - - -class PrettyUnavailableTests(unittest.TestCase): - def test_printing_without_rich_is_an_error(self) -> None: - with mock.patch.object(pretty, "_rich", None): - self.assertFalse(pretty.available()) - with self.assertRaisesRegex(pretty.PrettyError, "rich is not available"): - _render(REPORTS) diff --git a/tests/test_project.py b/tests/test_project.py index 98fd7dad..a87713f2 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -101,6 +101,14 @@ def test_lists_every_file_outside_a_git_checkout(self) -> None: with mock.patch("shutil.which", return_value=None): self.assertEqual(Project(root).tracked_files(), ["src/main.c"]) + def test_lists_every_file_of_a_directory_git_ignores(self) -> None: + """A copy in an ignored directory (mutmut's mutants/) is not part of the checkout around it: git tracks none of + its files, yet they are the project being validated.""" + with temp_project({".gitignore": "copy/\n", "copy/src/main.c": "", "copy/main.o": ""}) as root: + git(root, "init", "-q") + git(root, "add", ".gitignore") + self.assertEqual(Project(root / "copy").tracked_files(), ["main.o", "src/main.c"]) + def test_a_dangling_symlink_is_skipped_not_read(self) -> None: """A symlink to nothing (jekyll's test/source/_includes/tmp, argo-cd's testdata/link-to-nowhere) is listed as a file and crashes the extraction with FileNotFoundError; it has no content to read and must be skipped.""" diff --git a/tests/test_recognition.py b/tests/test_recognition.py index 8c773805..0f92d7c4 100644 --- a/tests/test_recognition.py +++ b/tests/test_recognition.py @@ -11,7 +11,6 @@ from project_validator.core import Context, Project from project_validator.ecosystems import ( BUILT_IN, - C_FAMILY, BuildSystem, Ecosystem, RegistryError, @@ -89,9 +88,10 @@ def test_an_ambiguous_suffix_counts_only_once_the_ecosystem_is_recognised(self) self.assertEqual(structure.unrecognised_suffixes, ()) def test_an_ambiguous_suffix_without_a_language_adds_none(self) -> None: + """A CMake module adds no language; a header alone is C (see tests/test_c_and_cxx.py).""" with _structure({"CMakeLists.txt": "", "include/app.h": "", "cmake/Warnings.cmake": ""}) as structure: - self.assertEqual(structure.languages, C_FAMILY) - self.assertEqual(structure.recognised_by, {"C/C++": ("build file CMakeLists.txt",)}) + self.assertEqual(structure.languages, frozenset({"C"})) + self.assertEqual(structure.recognised_by, {"C": ("build file CMakeLists.txt", ".h files")}) self.assertEqual(structure.unrecognised_suffixes, ()) with _structure({"include/app.h": ""}) as structure: self.assertEqual(structure.languages, frozenset()) @@ -138,7 +138,7 @@ def test_suffixes_of_no_ecosystem_are_counted_most_common_first(self) -> None: mapped["unrecognised_suffixes"], [{"suffix": ".odin", "files": 2}, {"suffix": ".awk", "files": 1}, {"suffix": ".nim", "files": 1}], ) - self.assertEqual(mapped["ecosystems"], {"C/C++": ["build file meson.build"]}) + self.assertEqual(mapped["ecosystems"], {"C": ["build file meson.build"]}) class ClaimConflictTests(unittest.TestCase): diff --git a/tests/test_score.py b/tests/test_score.py index 9f1922d9..a1da5e2a 100644 --- a/tests/test_score.py +++ b/tests/test_score.py @@ -1,5 +1,6 @@ -"""The tooling score (upstream #295): breadth before depth, core code before auxiliary, foundations before flashy -tools. Statuses and exit codes do not change; the score is read from the reports alone.""" +"""The tooling score, version 1 (upstream #295): 100% means every quality gate that applies to each part of the +project is in place, and extra credit above 100% rewards complementary tools, once every gate is. Statuses and exit +codes do not change; the score is read from the reports alone.""" from __future__ import annotations @@ -11,21 +12,40 @@ from project_validator.cli import EXIT_FAILURE, EXIT_SUCCESS, main from project_validator.core import Check, Placed, Result, Status from project_validator.runner import Report -from project_validator.score import LEVELS, SCORE_VERSION, Score, score +from project_validator.score import ( + LEVEL_NAMES, + LEVELS, + NOT_FOR_AUXILIARY, + SCORE_VERSION, + UNSCORED, + Score, + family, + score, +) from tests.support import FIXTURES PASS, WARN, FAIL, ERROR, SKIP = Status.PASS, Status.WARN, Status.FAIL, Status.ERROR, Status.SKIP def _check(name: str) -> Check: - return Check(name=name, description=name, run=lambda _: Result.passed("")) + return Check(name=name, description=f"what {name} asks", run=lambda _: Result.passed("")) def place( - status: Status, *tools: str, ecosystem: str = "C/C++", unit: str = ".", auxiliary: tuple[str, ...] = () + status: Status, + *tools: str, + ecosystem: str = "C++", + unit: str = ".", + auxiliary: tuple[str, ...] = (), + message: str = "", + details: tuple[str, ...] = (), ) -> Placed: return Placed( - ecosystem=ecosystem, unit=unit, result=Result(status=status, message=""), tools=tools, auxiliary=auxiliary + ecosystem=ecosystem, + unit=unit, + result=Result(status=status, message=message, details=details), + tools=tools, + auxiliary=auxiliary, ) @@ -33,8 +53,8 @@ def report(name: str, status: Status, *places: Placed) -> Report: return Report(check=_check(name), result=Result(status=status, message=f"{name} {status}", places=places)) -def project_wide(name: str, status: Status) -> Report: - return report(name, status) +def project_wide(name: str, status: Status, message: str = "") -> Report: + return Report(check=_check(name), result=Result(status=status, message=message or f"{name} {status}")) def foundations(status: Status = PASS) -> list[Report]: @@ -52,6 +72,110 @@ def scored(*reports: Report | list[Report], every_check: tuple[str, ...] = ()) - return score(flat, every_check) +class PercentTests(unittest.TestCase): + """Base: the share of the applicable slots that are filled, pooled across the project.""" + + def test_every_gate_in_place_is_100_percent(self) -> None: + self.assertEqual(scored(foundations()).percent, 100) + + def test_a_missing_gate_costs_its_share_of_the_slots(self) -> None: + reports = [report("tests-run", PASS, place(PASS)), report("coverage", FAIL, place(FAIL))] + self.assertEqual(scored(reports).percent, 50) + + def test_a_warning_fills_half_a_slot(self) -> None: + reports = [report("tests-run", PASS, place(PASS)), report("coverage", WARN, place(WARN))] + self.assertEqual(scored(reports).percent, 75) + + def test_an_error_stays_in_the_slots_and_fills_nothing(self) -> None: + reports = [report("tests-run", PASS, place(PASS)), report("coverage", ERROR, place(ERROR))] + self.assertEqual(scored(reports).percent, 50) + + def test_a_skip_is_not_a_slot(self) -> None: + reports = [report("tests-run", PASS, place(PASS)), report("coverage", SKIP, place(SKIP))] + self.assertEqual(scored(reports).percent, 100) + + def test_slots_are_pooled_so_a_small_part_weighs_its_size(self) -> None: + """A one-gate data folder weighs one slot, not as much as the code with three.""" + reports = [ + report("tests-run", PASS, place(PASS), place(FAIL, ecosystem="Data")), + report("coverage", PASS, place(PASS)), + report("static-analysis", PASS, place(PASS)), + ] + self.assertEqual(scored(reports).percent, 75) + + def test_auxiliary_slots_weigh_half(self) -> None: + reports = [report("static-analysis", FAIL, place(PASS), place(FAIL, ecosystem="Python", auxiliary=("test",)))] + self.assertAlmostEqual(scored(reports).percent, 100 * 1 / 1.5) + + def test_auxiliary_code_is_not_asked_for_the_product_only_gates(self) -> None: + for check in sorted(NOT_FOR_AUXILIARY): + with self.subTest(check=check): + reports = [report(check, FAIL, place(PASS), place(FAIL, ecosystem="Python", auxiliary=("test",)))] + self.assertEqual(scored(reports).percent, 100) + + def test_unscored_checks_are_reported_not_scored(self) -> None: + self.assertIn("status-badges", UNSCORED) + reports = [report("tests-run", PASS, place(PASS)), project_wide("status-badges", WARN)] + self.assertEqual(scored(reports).percent, 100) + + def test_project_wide_checks_are_one_slot_each(self) -> None: + reports = [report("tests-run", PASS, place(PASS)), project_wide("license", FAIL)] + result = scored(reports) + self.assertEqual((result.filled, result.slots), (1, 2)) + + def test_nothing_to_score_is_100_percent(self) -> None: + self.assertEqual(scored([]).percent, 100) + + +class ExtraCreditTests(unittest.TestCase): + """Complementary tools earn extra credit, held until every gate is in place.""" + + def test_a_second_distinct_tool_earns_a_quarter_slot(self) -> None: + reports = [report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck"))] + self.assertEqual(scored(reports).percent, 125) + + def test_a_third_earns_a_tenth_and_more_earn_nothing(self) -> None: + reports = [report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck", "PVS-Studio", "Infer"))] + self.assertEqual(scored(reports).percent, 135) + + def test_extra_credit_is_held_until_every_gate_is_in_place(self) -> None: + reports = [ + report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck")), + report("coverage", FAIL, place(FAIL)), + ] + result = scored(reports) + self.assertEqual(result.percent, 50) + self.assertEqual(result.held, 12.5) + + def test_only_complementary_gates_earn_extra_credit(self) -> None: + """Two formatters, or two coverage tools, do not make a project stronger.""" + for check in ("code-formatting", "coverage", "mutation-testing", "tests-run"): + with self.subTest(check=check): + self.assertEqual(scored([report(check, PASS, place(PASS, "one", "two"))]).percent, 100) + + def test_tools_of_one_family_count_once(self) -> None: + reports = [report("static-analysis", PASS, place(PASS, "ruff", "flake8"))] + self.assertEqual(scored(reports).percent, 100) + reports = [report("security-scanning", PASS, place(PASS, "golangci-lint's gosec", "golangci-lint's revive"))] + self.assertEqual(scored(reports).percent, 100) + + def test_a_bundled_linter_belongs_to_its_bundle(self) -> None: + self.assertEqual(family("golangci-lint's gosec"), "golangci-lint") + self.assertEqual(family("flake8"), family("ruff")) + self.assertEqual(family("CodeQL"), "CodeQL") + + def test_extra_credit_scales_with_the_slot(self) -> None: + reports = [ + report( + "static-analysis", + PASS, + place(PASS, "clang-tidy"), + place(PASS, "ruff", "mypy", ecosystem="Python", auxiliary=("test",)), + ) + ] + self.assertAlmostEqual(scored(reports).percent, 100 + 100 * 0.25 * 0.5 / 1.5) + + class LevelTests(unittest.TestCase): def test_a_project_missing_a_foundation_is_level_0(self) -> None: reports = foundations() @@ -76,258 +200,125 @@ def test_auxiliary_code_does_not_hold_a_level_back(self) -> None: def test_levels_are_gated_in_order(self) -> None: analysis = [report(name, PASS, place(PASS, "tool")) for name in LEVELS[2]] hardening = [report(name, PASS, place(PASS, "tool")) for name in LEVELS[3]] + self.assertEqual(scored(analysis).level, 0) self.assertEqual(scored(foundations(), analysis).level, 2) self.assertEqual(scored(foundations(), analysis, hardening, every_check=("security-policy",)).level, 3) - broken = foundations() - broken[0] = report(broken[0].check.name, FAIL, place(FAIL)) - self.assertEqual(scored(broken, analysis, hardening).level, 0) - - def test_a_level_whose_checks_all_skip_is_complete(self) -> None: - analysis = [report(name, SKIP) for name in LEVELS[2]] - self.assertEqual(scored(foundations(), analysis).level, 2) - - def test_level_4_needs_every_applicable_cell_in_every_tier(self) -> None: - every: list[Report | list[Report]] = [ - foundations(), - [report(name, PASS, place(PASS, "tool")) for name in (*LEVELS[2], *LEVELS[3])], - project_wide("security-policy", PASS), - ] - self.assertEqual(scored(*every, every_check=("security-policy",)).level, 4) - helper = report("status-badges", FAIL, place(FAIL, ecosystem="Python", auxiliary=("scripts",))) - self.assertEqual(scored(*every, helper).level, 3) - self.assertEqual(scored(*every, every_check=("security-policy", "large-files")).level, 3) + def test_the_top_level_is_100_percent_with_every_check_run(self) -> None: + analysis = [report(name, PASS, place(PASS, "tool")) for name in LEVELS[2]] + hardening = [report(name, PASS, place(PASS, "tool")) for name in LEVELS[3]] + every = (*(name for level in LEVELS.values() for name in level), "secret-scanning") + complete = project_wide("secret-scanning", PASS) + self.assertEqual(scored(foundations(), analysis, hardening, complete, every_check=every).level, 4) + incomplete = project_wide("secret-scanning", WARN) + self.assertEqual(scored(foundations(), analysis, hardening, incomplete, every_check=every).level, 3) -class NarrowedRunTests(unittest.TestCase): - def test_a_level_whose_checks_did_not_run_is_not_reached(self) -> None: + def test_a_level_needs_its_checks_to_have_run(self) -> None: self.assertEqual(scored(foundations()[1:]).level, 0) - self.assertEqual(scored(foundations(), report("coverage", PASS, place(PASS))).level, 1) + def test_every_level_has_a_name(self) -> None: + self.assertEqual(set(LEVEL_NAMES), {0, 1, 2, 3, 4}) + self.assertEqual(LEVEL_NAMES[4], "Complete") -class CompletenessTests(unittest.TestCase): - def test_passing_cells_over_applicable_cells(self) -> None: - reports = [report("static-analysis", FAIL, place(PASS), place(FAIL, ecosystem="Python")), report("x", SKIP)] - self.assertEqual(scored(reports).completeness, 0.5) - def test_a_warning_covers_half_a_cell(self) -> None: - self.assertEqual(scored(report("coverage", WARN, place(WARN))).completeness, 0.5) - - def test_an_error_or_unknown_scores_0_but_stays_in_the_maximum(self) -> None: - self.assertEqual( - scored(report("tests-run", ERROR, place(PASS), place(ERROR, ecosystem="Go"))).completeness, 0.5 - ) - - def test_auxiliary_cells_weigh_half(self) -> None: - reports = report("static-analysis", FAIL, place(PASS), place(FAIL, ecosystem="Python", auxiliary=("scripts",))) - self.assertAlmostEqual(scored(reports).completeness, 1 / 1.5) - - def test_an_untooled_language_lowers_completeness(self) -> None: - tooled = scored(report("static-analysis", PASS, place(PASS))) - untooled = scored(report("static-analysis", FAIL, place(PASS), place(FAIL, ecosystem="Shell"))) - self.assertLess(untooled.completeness, tooled.completeness) - - def test_completeness_is_averaged_across_units(self) -> None: +class NextStepTests(unittest.TestCase): + def test_each_unfilled_slot_is_a_next_step_worth_its_points(self) -> None: reports = [ - report("static-analysis", FAIL, place(PASS), place(FAIL, unit="a"), place(FAIL, unit="a", ecosystem="Go")), - project_wide("license", PASS), + report("tests-run", PASS, place(PASS)), + report("coverage", FAIL, place(FAIL, message="no coverage", details=("run gcovr in CI",))), + report("fuzz-testing", WARN, place(WARN)), ] - # unit ".": 1/1, unit "a": 0/2, the project: 1/1 - self.assertAlmostEqual(scored(reports).completeness, 2 / 3) - - def test_nothing_applicable_is_complete(self) -> None: - self.assertEqual(scored(report("fuzz-testing", SKIP)).completeness, 1.0) - - -class DepthTests(unittest.TestCase): - def test_breadth_beats_depth(self) -> None: - one_each = scored(foundations(), report("static-analysis", PASS, place(PASS, "clang-tidy"))) - both_in_one = scored(foundations(), report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck"))) - self.assertEqual(one_each.depth, both_in_one.depth - 5) - self.assertGreater( - scored( - foundations(), - report("static-analysis", PASS, place(PASS, "clang-tidy")), - report("coverage", PASS, place(PASS, "gcovr")), - ).depth, - both_in_one.depth, - ) + steps = {step.check: step for step in scored(reports).next_steps} + self.assertEqual(set(steps), {"coverage", "fuzz-testing"}) + self.assertAlmostEqual(steps["coverage"].points, 100 / 3) + self.assertAlmostEqual(steps["fuzz-testing"].points, 100 / 6) + self.assertEqual(steps["coverage"].message, "no coverage") + self.assertEqual(steps["coverage"].hint, "run gcovr in CI") + + def test_the_next_levels_blockers_come_first(self) -> None: + reports = [*foundations(), report("fuzz-testing", FAIL, place(FAIL))] + reports[0] = report(reports[0].check.name, FAIL, place(FAIL)) + first = scored(reports).next_steps[0] + self.assertEqual((first.check, first.needed_for), (reports[0].check.name, 1)) - def test_each_tool_in_a_cell_earns_less_than_the_one_before(self) -> None: - base = scored(foundations()).depth - points = [ - scored(foundations(), report("static-analysis", PASS, place(PASS, *tools))).depth - base - for tools in (("a",), ("a", "b"), ("a", "b", "c"), ("a", "b", "c", "d"), tuple("abcdefgh")) + def test_a_next_step_says_what_to_do_where_and_what_it_is_worth(self) -> None: + reports = [ + report("tests-run", PASS, place(PASS)), + report("coverage", FAIL, place(FAIL, unit="lib", details=("run gcovr in CI",))), ] - self.assertEqual(points, [10, 15, 17, 18, 20]) - - def test_core_beats_auxiliary(self) -> None: - base = scored(foundations()).depth - auxiliary = report("static-analysis", PASS, place(PASS, "ruff", "mypy", "x", "y", auxiliary=("scripts",))) - self.assertEqual(scored(foundations(), auxiliary).depth - base, 5 + 2 + 1) + (step,) = scored(reports).next_steps + self.assertEqual(step.describe(), "coverage (C++ in lib): +50 points; run gcovr in CI") - def test_a_covered_cell_earns_its_first_rank_without_a_named_tool(self) -> None: - base = scored(foundations()).depth - self.assertEqual(scored(foundations(), report("coverage", PASS, place(PASS))).depth - base, 10) + def test_a_project_wide_step_names_no_place(self) -> None: + (step,) = scored([report("tests-run", PASS, place(PASS)), project_wide("license", FAIL)]).next_steps + self.assertTrue(step.describe().startswith("license: +50 points")) - def test_a_project_wide_pass_earns_a_flat_5(self) -> None: - self.assertEqual(scored(project_wide("security-policy", PASS)).locked_depth, 5) - - def test_a_warning_earns_half_and_a_failure_nothing(self) -> None: - base = scored(foundations()).depth - self.assertEqual(scored(foundations(), report("coverage", WARN, place(WARN, "gcovr"))).depth - base, 5) - self.assertEqual(scored(foundations(), report("coverage", FAIL, place(FAIL, "gcovr"))).depth - base, 0) - - def test_depth_counts_only_once_the_levels_below_are_complete(self) -> None: - hardening = report("sanitizers", PASS, place(PASS, "ASan", "UBSan")) - result = scored(foundations(), report("static-analysis", FAIL, place(FAIL)), hardening) - self.assertEqual(result.level, 1) - self.assertEqual(result.locked_depth, 15) - self.assertNotIn("sanitizers", [cell.check for cell in result.cells if cell.counted]) - - def test_foundations_always_count(self) -> None: + def test_the_step_that_completes_a_level_says_so(self) -> None: reports = foundations() reports[0] = report(reports[0].check.name, FAIL, place(FAIL)) - self.assertEqual(scored(reports).depth, 5 * 10 + 5) # five core foundations and the licence + (step,) = scored(reports).next_steps + self.assertIn("completes Level 1 (Foundations)", step.describe()) -class OpportunityTests(unittest.TestCase): - def test_the_next_level_s_blockers_come_first(self) -> None: - reports = foundations() - reports[2] = report(reports[2].check.name, FAIL, place(FAIL)) - reports.append(report("static-analysis", FAIL, place(FAIL))) - first = scored(reports).opportunities[0] - self.assertEqual((first.check, first.unlocks, first.blocks), (reports[2].check.name, 1, 1)) - self.assertIn("unlocks Level 1", first.describe()) - - def test_an_opportunity_says_what_it_is_worth(self) -> None: - reports = [*foundations(), report("static-analysis", FAIL, place(PASS), place(FAIL, ecosystem="Python"))] - (opportunity,) = scored(reports).opportunities - self.assertEqual((opportunity.ecosystem, opportunity.unit, opportunity.tier), ("Python", ".", "core")) - self.assertAlmostEqual(opportunity.completeness, 1 / 7 / 2) # one of unit "."'s 7 cells; 2 units - self.assertEqual(opportunity.depth, 10) - self.assertIsNone(opportunity.unlocks) # the rest of level 2's checks did not run - - def test_a_locked_level_s_opportunity_earns_no_depth_yet(self) -> None: - (opportunity,) = scored(report("sanitizers", FAIL, place(FAIL))).opportunities - self.assertEqual(opportunity.depth, 0) - - def test_every_blocker_of_the_next_level_ranks_above_other_cells(self) -> None: - reports = foundations() - reports[1] = report(reports[1].check.name, FAIL, place(FAIL), place(FAIL, ecosystem="Shell")) - reports.append(report("security-policy", FAIL)) - reports.append(report("static-analysis", FAIL, *(place(FAIL, unit=str(n)) for n in range(3)))) - ranked = scored(reports).opportunities - self.assertEqual([(o.check, o.blocks) for o in ranked[:2]], [(reports[1].check.name, 1)] * 2) - self.assertEqual({o.unlocks for o in ranked}, {None}) - self.assertIn("toward Level 1", ranked[0].describe()) - self.assertEqual(ranked[-1].check, "security-policy") - - def test_core_opportunities_rank_above_auxiliary_ones(self) -> None: +class SummaryTests(unittest.TestCase): + def test_the_summary_is_the_percent_the_level_and_the_gates(self) -> None: + reports = [*foundations(), report("coverage", FAIL, place(FAIL))] + self.assertEqual(scored(reports).summary(), "87% · Level 1 Foundations · 7 of 8 gates in place") + + def test_past_100_the_summary_shows_the_extra_credit(self) -> None: + reports = [*foundations(), report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck"))] + expected = "103% · Level 1 Foundations · all 8 gates in place, +3 extra credit" + self.assertEqual(scored(reports).summary(), expected) + + def test_held_extra_credit_is_mentioned(self) -> None: reports = [ - report("coverage", FAIL, place(FAIL, ecosystem="Python", auxiliary=("scripts",))), - report("type-checking", FAIL, place(FAIL)), + report("static-analysis", PASS, place(PASS, "clang-tidy", "cppcheck")), + report("coverage", FAIL, place(FAIL)), ] - self.assertEqual([o.check for o in scored(reports).opportunities], ["type-checking", "coverage"]) + self.assertIn("+12 extra credit held until every gate is in place", scored(reports).summary()) - def test_how_an_opportunity_is_described(self) -> None: + def test_the_breakdown_is_by_language(self) -> None: reports = [ - report("sanitizers", FAIL, place(FAIL, unit="lib")), - project_wide("security-policy", WARN), - report("fuzz-testing", FAIL, place(SKIP), place(FAIL)), + report("tests-run", PASS, place(PASS), place(FAIL, ecosystem="Python")), + project_wide("license", PASS), ] - described = sorted(o.describe() for o in scored(reports).opportunities) - self.assertEqual( - described, - [ - "fuzz-testing (C/C++ in the root): +33.3% completeness", - "sanitizers (C/C++ in unit lib): +33.3% completeness", # one of three units - "security-policy: +16.7% completeness", - ], - ) - - def test_a_covered_project_has_none(self) -> None: - self.assertEqual(scored(foundations()).opportunities, ()) - - -class ScoreOutputTests(unittest.TestCase): - def test_the_summary_line(self) -> None: - result = scored(foundations(), report("static-analysis", FAIL, place(FAIL))) - self.assertEqual(result.summary(), "Level 1 · 91% complete · 60 depth") - - def test_completeness_is_shown_rounded_down(self) -> None: - reports = [report("tests-run", FAIL, *(place(PASS, unit=str(n)) for n in range(199)), place(FAIL, unit="x"))] - self.assertIn("99% complete", scored(reports).summary()) - - def test_as_dict_carries_the_version_and_every_part(self) -> None: - reports = foundations() - reports.append(report("coverage", FAIL, place(FAIL))) - as_dict = json.loads(json.dumps(scored(reports).as_dict())) - self.assertEqual(as_dict["version"], SCORE_VERSION) - self.assertTrue(as_dict["preview"]) - self.assertEqual( - set(as_dict), - {"version", "preview", "level", "completeness", "depth", "locked_depth", "cells", "opportunities"}, - ) - cell = next(cell for cell in as_dict["cells"] if cell["check"] == "coverage") - self.assertEqual( - cell, - { - "check": "coverage", - "level": 2, - "ecosystem": "C/C++", - "unit": ".", - "tier": "core", - "status": "FAIL", - "tools": [], - "points": 0, - "counted": True, - }, - ) - (opportunity,) = as_dict["opportunities"] - self.assertEqual(opportunity["check"], "coverage") - self.assertIsNone(opportunity["unlocks"]) # the rest of level 2's checks did not run - - -def _run(*arguments: str) -> tuple[int, str]: - out = io.StringIO() - with contextlib.redirect_stdout(out), contextlib.redirect_stderr(io.StringIO()): - code = main(list(arguments)) - return code, out.getvalue() - - -class ScoreOptionTests(unittest.TestCase): - PROJECT = str(FIXTURES / "well_configured_python") - BARE = str(FIXTURES / "bare_python") - - def test_text_ends_with_the_score_and_the_top_opportunities(self) -> None: - code, output = _run(self.BARE, "--score", "--color", "never") + self.assertEqual(scored(reports).breakdown(), {"C++": (1, 1), "Python": (0, 1), "": (1, 1)}) + + def test_as_json(self) -> None: + data = scored(foundations()).as_dict() + self.assertEqual(data["version"], SCORE_VERSION) + self.assertEqual(SCORE_VERSION, "1") + self.assertEqual(data["percent"], 100) + self.assertEqual((data["level"], data["level_name"]), (1, "Foundations")) + self.assertEqual((data["filled"], data["slots"], data["extra"], data["held"]), (7, 7, 0, 0)) + cells = data["cells"] + self.assertIsInstance(cells, list) + self.assertEqual(len(cells) if isinstance(cells, list) else 0, 7) + json.dumps(data) + + +class CliTests(unittest.TestCase): + def _run(self, *arguments: str) -> tuple[int, str]: + output = io.StringIO() + with contextlib.redirect_stdout(output), contextlib.redirect_stderr(io.StringIO()): + code = main([*arguments]) + return code, output.getvalue() + + def test_the_score_is_appended_to_the_text_report(self) -> None: + code, output = self._run("--score", "--color", "never", str(FIXTURES / "well_configured_python")) + self.assertEqual(code, EXIT_SUCCESS) + self.assertRegex(output, r"Score: 1\d\d% · Level 4 Complete · all \d+ gates in place") + + def test_json_holds_the_results_and_the_score(self) -> None: + code, output = self._run("--score", "--format", "json", str(FIXTURES / "bare_python")) self.assertEqual(code, EXIT_FAILURE) - tail = output.split("\n\nScore (preview v0): ", 1)[1] - self.assertRegex(tail, r"^Level 0 · \d+% complete · \d+ depth\nNext:\n - ") - self.assertLessEqual(tail.count("\n - "), 5) - - def test_a_complete_project_has_no_next_steps(self) -> None: - _, output = _run(self.PROJECT, "--score", "--color", "never", "--only", "license") - self.assertTrue(output.endswith("Score (preview v0): Level 0 · 100% complete · 5 depth\n"), output) - - def test_json_puts_the_results_beside_the_score(self) -> None: - code, output = _run(self.PROJECT, "--score", "--format", "json") - plain_code, plain = _run(self.PROJECT, "--format", "json") - loaded = json.loads(output) - self.assertEqual(set(loaded), {"results", "score"}) - self.assertEqual(loaded["results"], json.loads(plain)) - self.assertEqual((code, plain_code), (EXIT_SUCCESS, EXIT_SUCCESS)) - self.assertEqual(loaded["score"]["version"], SCORE_VERSION) - self.assertGreaterEqual(loaded["score"]["level"], 1) - - def test_markdown_ends_with_the_score(self) -> None: - _, output = _run(self.BARE, "--score", "--format", "markdown") - self.assertIn("\n\n**Score (preview v0):** Level 0 · ", output) - - def test_the_score_does_not_change_the_exit_code(self) -> None: - for project in (self.PROJECT, self.BARE): - with self.subTest(project=project): - self.assertEqual(_run(project, "--score")[0], _run(project)[0]) + data = json.loads(output) + self.assertEqual(set(data), {"results", "score"}) + self.assertLess(data["score"]["percent"], 100) + + def test_the_next_steps_are_listed(self) -> None: + _, output = self._run("--score", "--color", "never", str(FIXTURES / "bare_python")) + self.assertIn("Next steps:", output) if __name__ == "__main__": diff --git a/tests/test_structure.py b/tests/test_structure.py index bcba7e31..00574ad7 100644 --- a/tests/test_structure.py +++ b/tests/test_structure.py @@ -38,7 +38,7 @@ def _check(name: str, languages: frozenset[str] = frozenset()) -> Check: class ProjectStructureTests(unittest.TestCase): def test_a_cmake_project_builds_the_languages_it_enables(self) -> None: - structure = make_context(FIXTURES / "well_configured_c_cpp").structure + structure = make_context(FIXTURES / "well_configured_cpp").structure self.assertEqual(structure.languages, frozenset({"C++"})) self.assertEqual(structure.build_systems, frozenset({"CMake"})) self.assertEqual(structure.ci_providers, ("GitHub Actions",)) @@ -117,7 +117,7 @@ def test_every_layout_map_is_serialisable(self) -> None: self.assertEqual(mapped["ci"], {"providers": [], "files": [], "jobs": []}) def test_map_is_serialisable(self) -> None: - mapped = make_context(FIXTURES / "well_configured_c_cpp").structure.as_dict() + mapped = make_context(FIXTURES / "well_configured_cpp").structure.as_dict() self.assertEqual(mapped["languages"], ["C++"]) self.assertEqual(mapped["build_systems"], ["CMake"]) ci = cast(dict[str, Any], mapped["ci"]) @@ -184,7 +184,7 @@ def test_builtin_checks_are_skipped_only_outside_their_languages(self) -> None: self.assertEqual(run_check(found, context).status == Status.SKIP, skipped, found.name) def test_matching_checks_run(self) -> None: - context = make_context(FIXTURES / "well_configured_c_cpp") + context = make_context(FIXTURES / "well_configured_cpp") self.assertEqual(run_check(_check("cpp", frozenset({"C++"})), context).status, Status.PASS) def test_a_check_of_a_format_runs_in_a_project_of_data_files_alone(self) -> None: diff --git a/tests/test_support_matrix.py b/tests/test_support_matrix.py index e83175d4..fb20bb6f 100644 --- a/tests/test_support_matrix.py +++ b/tests/test_support_matrix.py @@ -50,7 +50,7 @@ def test_a_check_without_an_aspect_applies_without_tools(self) -> None: def test_a_check_that_does_not_apply_has_no_cell(self) -> None: self.assertIsNone(self._cell("ci-build-types", "Python")) - self.assertEqual(self._cell("ci-build-types", "C/C++"), ()) + self.assertEqual(self._cell("ci-build-types", "C++"), ()) def test_checks_of_every_project_are_listed_apart(self) -> None: self.assertIn("ci-present", self.matrix.everywhere) diff --git a/tests/test_units.py b/tests/test_units.py index fedcda3b..28510f1c 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -58,7 +58,7 @@ def _coverage(files: dict[str, str]) -> Result: class UnitTests(unittest.TestCase): def test_a_project_built_from_its_root_is_one_unit(self) -> None: nested = {"CMakeLists.txt": "", "src/CMakeLists.txt": "", "src/main.cpp": "", "test/CMakeLists.txt": ""} - self.assertEqual(_units(nested), [(".", ("CMake",), ["C", "C++"])]) + self.assertEqual(_units(nested), [(".", ("CMake",), ["C++"])]) def test_workspace_members_are_units_of_their_own(self) -> None: self.assertEqual( @@ -101,7 +101,7 @@ def test_each_unit_needs_coverage_and_findings_name_the_unit(self) -> None: def test_a_run_outside_the_project_covers_none_of_it(self) -> None: result = _coverage({**MIXED, **_workflow(("cd /tmp/other && gcovr --xml x", None))}) - self.assertIn("C/C++: no branch coverage measurement found in what CI runs", result.message) + self.assertIn("C++: no branch coverage measurement found in what CI runs", result.message) def test_a_run_from_the_root_covers_every_unit(self) -> None: result = _coverage({**WORKSPACES, **_workflow(("npx c8 node --test", None))}) @@ -305,7 +305,7 @@ def test_every_practice_warns_about_code_named_auxiliary_by_its_role(self) -> No self.assertIn(f"Python (auxiliary: tooling): {ADVISORY}", result.details) def test_code_is_named_by_its_language_or_ecosystem_or_a_directory_as_given(self) -> None: - for named, ecosystem in (("Python", "Python"), ("scripts/", "Python"), ("c/c++", "C/C++")): + for named, ecosystem in (("Python", "Python"), ("scripts/", "Python"), ("c++", "C++")): with self.subTest(named): result = _check("static-analysis", HELPER_SCRIPTS, (named,)) place = _place(result, ecosystem) @@ -364,7 +364,7 @@ def test_test_helpers_can_be_named_without_losing_the_tests(self) -> None: del files["scripts/release.py"] self.assertEqual(_place(_check("static-analysis", files), "Python").result.status, Status.FAIL) named = _check("tests-run", files, ("test",)) - self.assertEqual(_place(named, "C/C++").result.status, Status.PASS, named.message) + self.assertEqual(_place(named, "C++").result.status, Status.PASS, named.message) python = _place(named, "Python") self.assertEqual((python.result.status, python.auxiliary), (Status.WARN, ("test",))) @@ -384,7 +384,7 @@ def test_the_json_report_and_the_grid_mark_auxiliary_code(self) -> None: [report] = json.loads(output) self.assertEqual(report["status"], "FAIL") places = {(place["ecosystem"], place["unit"]): place for place in report["places"]} - self.assertEqual(set(places), {("C/C++", "."), ("Python", ".")}) + self.assertEqual(set(places), {("C++", "."), ("Python", ".")}) python = places[("Python", ".")] self.assertEqual((python["status"], python["auxiliary"], python["tools"]), ("FAIL", [], [])) self.assertEqual(python["message"], "no static analyzer runs") @@ -414,9 +414,10 @@ class SelectorTests(unittest.TestCase): """What `--auxiliary` names, and which code it matches.""" def test_an_ecosystem_names_every_language_of_it_whatever_the_case(self) -> None: - named = Selectors.parse(("C/C++", "PYTHON")) - self.assertEqual(named.matching("src/a.c", "C"), "C/C++") - self.assertEqual(named.matching("src/a.cpp", "C++"), "C/C++") + named = Selectors.parse(("jvm", "PYTHON")) + self.assertEqual(named.matching("src/A.java", "Java"), "jvm") + self.assertEqual(named.matching("src/B.kt", "Kotlin"), "jvm") + self.assertEqual(named.matching("src/a.c", "C"), "") self.assertEqual(named.matching("a.py", "Python"), "PYTHON") self.assertEqual(named.matching("a.rs", "Rust"), "") diff --git a/tests/test_views.py b/tests/test_views.py new file mode 100644 index 00000000..f208132f --- /dev/null +++ b/tests/test_views.py @@ -0,0 +1,438 @@ +"""The views of an analysis: plain text, the console, the HTML report, the progress shown while working, and the TUI. +Each says what was detected and how the project was read, every result, and the score.""" + +from __future__ import annotations + +import asyncio +import dataclasses +import io +import json +import re +import tempfile +import unittest +from html.parser import HTMLParser +from pathlib import Path +from typing import ClassVar +from unittest import mock + +from project_validator.analysis import Analysis, analyse +from project_validator.cli import EXIT_FAILURE, EXIT_USAGE +from project_validator.core import ExtractionError, Progress, Result, Status +from project_validator.plugins import discover +from project_validator.views import common, html, text, tui +from project_validator.views import console as console_view +from project_validator.views.progress import ProgressView +from tests.support import FIXTURES, make_context, requires_rich, temp_project +from tests.test_cli import run_cli + +requires_textual = unittest.skipUnless(tui.available(), "textual is not installed") + +MIXED = { + "CMakeLists.txt": "project(app CXX)\n", + "src/main.cpp": "", + "tests/test_main.cpp": "", + "scripts/release.py": "", + "third_party/lib/lib.c": "", + "README.md": "", +} + + +def _analysis(files: dict[str, str] | None = None, *, fixture: str | None = None) -> Analysis: + if fixture is not None: + return analyse(make_context(FIXTURES / fixture), discover().checks) + with temp_project(files or MIXED) as root: + return analyse(make_context(root), discover().checks) + + +class _Tags(HTMLParser): + """The tags of an HTML document, and the external resources it loads.""" + + def __init__(self) -> None: + super().__init__() + self.ids: set[str] = set() + self.external: list[str] = [] + self.open: list[str] = [] + self.unbalanced: list[str] = [] + + VOID = frozenset({"meta", "link", "br", "input", "img", "circle", "hr"}) + + def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: + found = dict(attrs) + if found.get("id"): + self.ids.add(str(found["id"])) + for name in ("src", "href"): + value = found.get(name) or "" + if tag in ("script", "link", "img") and value.startswith(("http:", "https:", "//")): + self.external.append(value) + if tag not in self.VOID: + self.open.append(tag) + + def handle_endtag(self, tag: str) -> None: + if tag in self.VOID: + return + if self.open and self.open[-1] == tag: + self.open.pop() + else: + self.unbalanced.append(tag) + + +class CommonTests(unittest.TestCase): + def test_a_place_is_named_by_language_unit_and_what_named_it_auxiliary(self) -> None: + from project_validator.core import Placed + + self.assertEqual(common.place_label(Placed(ecosystem="C++", unit=".", result=Result.passed(""))), "C++") + place = Placed(ecosystem="Python", unit="tools", result=Result.passed(""), auxiliary=("tooling",)) + self.assertEqual(common.place_label(place), "Python in tools (auxiliary: tooling)") + + def test_the_checks_are_grouped_by_category_worst_first_without_the_skipped(self) -> None: + groups = common.grouped(_analysis().reports) + self.assertEqual([group.category for group in groups][:2], ["Build", "Tests"]) + for group in groups: + statuses = [common.STATUS_ORDER.index(report.result.status) for report in group.reports] + self.assertEqual(statuses, sorted(statuses)) + self.assertNotIn(Status.SKIP, {report.result.status for report in group.reports}) + + def test_extra_credit_is_shown_in_tenths_below_a_point(self) -> None: + self.assertEqual((common.credit(0.42), common.credit(3.9)), ("0.4", "3")) + + def test_a_detached_checkout_says_so(self) -> None: + from project_validator.analysis import Git + + self.assertEqual(common.branch_label(Git(branch="HEAD")), "detached") + self.assertEqual(common.branch_label(Git(branch="main")), "main") + + def test_a_project_that_could_not_be_read_has_no_languages_or_units(self) -> None: + unread = dataclasses.replace(_analysis(), structure=None) + self.assertEqual((common.ecosystems(unread), common.units(unread)), ([], [])) + + def test_code_named_auxiliary_is_judged_so(self) -> None: + from project_validator.analysis import RoleSummary + + found = RoleSummary(role="test", directories=("tests",), files=1, languages=("C++",), auxiliary=True) + self.assertEqual(common.role_judgement(found), "judged as auxiliary code (--auxiliary)") + + +class TextTests(unittest.TestCase): + def test_the_report_says_what_was_detected_before_the_results(self) -> None: + report = text.render(_analysis()) + detected, _, results = report.partition("\n\n") + self.assertIn(" C++: build file CMakeLists.txt", detected) + self.assertIn(" Unit the root (product): built with CMake;", detected) + self.assertIn("Code of tests: tests/ (1 file, C++): judged as the product; --auxiliary test", detected) + self.assertIn("Code of vendored code: third_party/ (1 file, C): other projects' code: never judged", detected) + self.assertIn(" CI: none found", detected) + self.assertRegex(detected, r" Read: [\d,]+ facts in \d+\.\d\d s") + self.assertIn("[FAIL] ci-present:", results) + self.assertRegex(report, r"\n\d+ checks: \d+ passed") + + def test_the_score_is_appended_when_asked(self) -> None: + analysis = _analysis() + self.assertNotIn("Score:", text.render(analysis)) + self.assertIn("Score: ", text.render(analysis, scored=True)) + self.assertIn("Next steps:", text.render(analysis, scored=True)) + + def test_repeated_details_are_said_once(self) -> None: + from project_validator.core import Check + from project_validator.runner import Report + + report = Report( + check=Check(name="c", description="", run=lambda _: Result.passed("")), + result=Result.warned("m", "same", "same", "other"), + ) + self.assertEqual(text.report_lines([report]), ["[WARN] c: m", " same", " other"]) + + def test_a_project_that_could_not_be_read_says_why(self) -> None: + with temp_project(MIXED) as root: + context = make_context(root) + context._extracted = ExtractionError("the CI configuration", ValueError("broken")) + analysis = analyse(context, discover().checks) + self.assertRegex(text.render(analysis), r"could not be read: .*the CI configuration raised ValueError") + + +@requires_rich +class ConsoleTests(unittest.TestCase): + def _render(self, analysis: Analysis, **options: bool) -> str: + stream = io.StringIO() + console_view.render(analysis, stream, width=120, **options) + return re.sub(r"\x1b\[[0-9;]*m", "", stream.getvalue()) + + def test_the_report_has_a_header_detection_results_and_score(self) -> None: + output = self._render(_analysis()) + for expected in ("project_validator", "What was detected", "Recognised by", "Code: tests", "Build", "Score"): + with self.subTest(expected=expected): + self.assertIn(expected, output) + self.assertRegex(output, r"\d+% +Level \d") + + def test_the_skipped_checks_are_counted_unless_verbose(self) -> None: + analysis = _analysis() + self.assertIn("checks do not apply here", self._render(analysis)) + verbose = self._render(analysis, verbose=True) + self.assertIn("Not applicable", verbose) + self.assertIn("the project's structure:", verbose) + + def test_a_result_of_several_places_has_a_line_for_each(self) -> None: + output = self._render(_analysis()) + self.assertRegex(output, r"✘ +Python +no static analyzer runs") + + def test_long_details_are_cut_unless_verbose(self) -> None: + analysis = _analysis(fixture="well_configured_cpp") + self.assertIn("more (--verbose shows them)", self._render(analysis)) + self.assertNotIn("more (--verbose shows them)", self._render(analysis, verbose=True)) + + def test_a_project_that_could_not_be_read_says_why(self) -> None: + with temp_project(MIXED) as root: + context = make_context(root) + context._extracted = ExtractionError("the CI configuration", ValueError("broken")) + output = self._render(analyse(context, discover().checks)) + self.assertIn("could not be read", output) + + def test_the_score_is_coloured_by_how_much_is_in_place(self) -> None: + styles = [console_view.score_style(percent) for percent in (100, 80, 60, 10)] + self.assertEqual(styles, ["bold green", "green", "yellow", "red"]) + + def test_a_checkout_shows_its_branch_and_commit_and_unknown_suffixes_are_listed(self) -> None: + from project_validator.analysis import Git + + analysis = _analysis({**MIXED, "data/a.zyx": "", "data/b.zyx": ""}) + output = self._render(dataclasses.replace(analysis, git=Git(commit="c" * 40, branch="main"))) + self.assertIn(f"main @ {'c' * 10}", output) + self.assertRegex(output, r"Not recognised +\.zyx \(2\)") + + def test_without_rich_installed_nothing_is_imported(self) -> None: + with mock.patch("importlib.import_module", side_effect=ImportError("rich")): + self.assertIsNone(console_view._import_rich()) + + def test_without_rich_it_is_an_error(self) -> None: + with mock.patch.object(console_view, "_rich", None): + self.assertFalse(console_view.available()) + with self.assertRaisesRegex(console_view.ConsoleError, "rich is not available"): + console_view.render(_analysis(), io.StringIO()) + + +class HtmlTests(unittest.TestCase): + analysis: ClassVar[Analysis] + document: ClassVar[str] + tags: ClassVar[_Tags] + + @classmethod + def setUpClass(cls) -> None: + cls.analysis = _analysis() + cls.document = html.render(cls.analysis) + cls.tags = _Tags() + cls.tags.feed(cls.document) + + def test_it_is_one_self_contained_document(self) -> None: + self.assertTrue(self.document.startswith("")) + self.assertEqual(self.tags.external, []) + self.assertIn("