Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 23, 2025

Summary

  • Replace prettier with oxfmt (faster Rust-based formatter from oxc project)
  • Simplify justfile and CI by leveraging treefmt's unified toolchain

What Changed

flake.nix:

  • Replace prettier with oxfmt as custom formatter
  • Extended file type support: md, yml, yaml, json, ts, tsx, js, jsx, html, css

justfile:

  • lint: now just runs nix fmt --fail-on-change (includes ruff-check, typos, nixfmt, oxfmt)
  • format: now just runs nix fmt
  • Remove redundant typos and typos-fix commands (already in treefmt)

ci.yaml:

  • Remove separate typos job (now covered by lint)

Why

  1. oxfmt is faster than prettier (native Rust implementation)
  2. treefmt already orchestrates all formatters (ruff, typos, nixfmt, oxfmt), so no need for separate commands
  3. Simpler CI with fewer jobs

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.
Copilot AI review requested due to automatic review settings December 23, 2025 10:47
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-fix command to format and adds format checking to the lint command
  • 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";
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
command = "${pkgs.oxfmt}/bin/oxfmt";
command = "${pkgs.oxc}/bin/oxfmt";

Copilot uses AI. Check for mistakes.
@ryoppippi ryoppippi changed the title build(treefmt): replace prettier with oxfmt chore(treefmt): replace prettier with oxfmt Dec 23, 2025
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)
@ryoppippi ryoppippi changed the title chore(treefmt): replace prettier with oxfmt chore(treefmt): replace prettier with oxfmt and simplify CI Dec 23, 2025
@ryoppippi ryoppippi enabled auto-merge (squash) December 23, 2025 11:03
Copy link
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

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

LGTM

@ryoppippi ryoppippi merged commit a755764 into main Dec 23, 2025
15 checks passed
@ryoppippi ryoppippi deleted the chore/replace-prettier-with-oxfmt branch December 23, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants