Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/ijson-jcs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: MPL-2.0
# Local dogfood gate for 3-practice/JSON-POLICY.adoc (owner ruling D306):
# every .json / .jsonl is I-JSON (RFC 7493) + JCS (RFC 8785) canonical.
# REPORT-ONLY: the scan lists non-canonical files and exits 0. The test step
# is what can fail, and it proves the scan can tell the three verdicts apart.
# The repo-wide scan is REPORT-ONLY: it lists non-canonical files and exits 0.
# Its test step can fail, and proves the scan can tell the three verdicts apart.
# The converted-stay-canonical job BLOCKS, but only on files already converted.
name: ijson-jcs conformance

on:
Expand Down Expand Up @@ -30,3 +31,19 @@ jobs:
- run: cargo install --git https://github.com/hyperpolymath/ijson-jcs --rev 0fdeea716fd558e9807362acf6f8202d56d8d88f --locked ijson-jcs
- run: bash scripts/tests/check-ijson-jcs-test.sh
- run: scripts/check-ijson-jcs.sh .

# BLOCKING, for converted files only (JSON-POLICY §6). A file listed here was
# canonicalised under an owner ruling and must not drift back to an indented
# layout on its next jq edit. The report-only scan above cannot catch that.
# Fix a failure with `ijson-jcs fix <file>`.
converted-stay-canonical:
Comment on lines +35 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Route the canonicality check through a required gate

This job can report red but cannot block a merge as claimed: the repository derives required status contexts exclusively from the workflow files listed in config/rulesets/gates.json, and ijson-jcs.yml is not among them. Consequently, a PR that rewrites .hypatia-baseline.json non-canonically can still merge. Put this enforcement in an already-required workflow or add this workflow to the gate configuration and apply the updated ruleset.

Useful? React with 👍 / 👎.

name: Converted JSON stays canonical
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Pinned to a commit: ijson-jcs has no releases yet.
- run: cargo install --git https://github.com/hyperpolymath/ijson-jcs --rev 0fdeea716fd558e9807362acf6f8202d56d8d88f --locked ijson-jcs
- run: scripts/check-ijson-jcs.sh --enforce .hypatia-baseline.json
Loading
Loading