chore(treefmt): replace prettier with oxfmt and simplify CI#73
chore(treefmt): replace prettier with oxfmt and simplify CI#73
Conversation
Migrate from prettier to oxfmt for formatting non-Python files. oxfmt is part of the oxc project and provides faster formatting with native Rust implementation. Changes: - Remove prettier configuration from treefmt programs - Add oxfmt as custom formatter with explicit includes - Extend supported file types: md, yml, yaml, json, ts, tsx, js, jsx, html, css - Update flake.lock with latest nixpkgs containing oxfmt
Simplify justfile by combining related operations: - lint: now includes format check (nix fmt --fail-on-change) - format: replaces lint-fix, runs ruff fix and nix fmt together This makes the CI workflow simpler as format checking is now part of the lint command.
There was a problem hiding this comment.
Pull request overview
This PR replaces prettier with oxfmt for formatting non-Python files and consolidates the justfile commands to streamline the development workflow.
- Swaps prettier for oxfmt as the formatter for markdown, YAML, JSON, and additional file types
- Renames
lint-fixcommand toformatand adds format checking to thelintcommand - Updates dependency locks for git-hooks, nixpkgs, and treefmt-nix
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| flake.nix | Removes prettier configuration and adds oxfmt as a custom formatter with expanded file type support (md, yml, yaml, json, ts, tsx, js, jsx, html, css) |
| justfile | Updates lint command to include format checking via nix fmt -- --fail-on-change, and renames lint-fix to format which runs both ruff fix and nix fmt |
| flake.lock | Updates lock hashes and timestamps for git-hooks.nix, nixpkgs, and treefmt-nix dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| typos.enable = true; | ||
| }; | ||
| settings.formatter.oxfmt = { | ||
| command = "${pkgs.oxfmt}/bin/oxfmt"; |
There was a problem hiding this comment.
The package reference pkgs.oxfmt may not exist in nixpkgs. The oxfmt formatter is part of the oxc project, but it's unclear if it's available as a standalone package named oxfmt in nixpkgs. You should verify that this package exists in the nixpkgs version being used (nixpkgs-unstable). If the package doesn't exist or has a different name, the build will fail. Common alternatives might be pkgs.oxc (if oxfmt is included) or it may need to be added as a separate input or built from source.
| command = "${pkgs.oxfmt}/bin/oxfmt"; | |
| command = "${pkgs.oxc}/bin/oxfmt"; |
treefmt already includes ruff-check and typos, so remove redundant commands from justfile and CI workflow. Changes: - Remove separate `uv run ruff check` from lint (treefmt runs ruff-check) - Remove `typos` and `typos-fix` commands (treefmt runs typos) - Remove typos CI job (covered by lint via treefmt)
Summary
What Changed
flake.nix:
justfile:
lint: now just runsnix fmt --fail-on-change(includes ruff-check, typos, nixfmt, oxfmt)format: now just runsnix fmttyposandtypos-fixcommands (already in treefmt)ci.yaml:
typosjob (now covered bylint)Why