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
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Reformat JS, CSS, JSON and YAML with oxfmt (#357)
8ae38e5ba6b5339fbd25f64dd22ce85a1e91cec7
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,12 @@ jobs:
- name: Lint the templates' JavaScript (primary only)
if: matrix.is-primary
run: uv run --group js python scripts/lint_js.py

- name: Check JS, CSS, JSON and YAML formatting (primary only)
if: matrix.is-primary
# Both checks run, so every file that needs formatting is listed
run: |
status=0
uv run --group js oxfmt --check || status=1
uv run --group js python scripts/fmt_templates.py --check || status=1
exit $status
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ back verbatim. Each construct must sit on lines of its own; the script
refuses anything else. Such files are found by their content, but they must
also be listed in `ignorePatterns`, which a unit test checks.

`just fmt-check` is part of `just ci`, and CI runs it once (on the primary
job), so a change that isn't formatted fails; run `just fmt-js` before
committing. The commit that first formatted the tree is listed in
`.git-blame-ignore-revs`; to have `git blame` look past it, run once:

```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs
```

GitHub's blame view reads the file by itself.

When upgrading oxfmt, look at what a run *covers* as well as whether it
passes: a release can start formatting a new language (Markdown arrived
after 0.69), and then a bare run rewrites files nobody chose to format.
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fmt-check:
exit $status

# Fail-fast order: format and lint take seconds, ty is faster than pyright, the full test suite runs last
ci: format lint lint-js ty typecheck test-all
ci: format lint lint-js fmt-check ty typecheck test-all

# Regenerate the auto-generated TUI docs assets (screenshots) into docs/assets/tui
docs-gen:
Expand Down
Loading