Skip to content

chore: add treefmt config for nix files #1653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

yvan-sraka
Copy link
Collaborator

  • add a ci job that run treefmt
  • make it nix fmt default formatter
  • add dumb simple pre-commit and editorconfig

@yvan-sraka yvan-sraka self-assigned this Jun 19, 2025
@yvan-sraka yvan-sraka marked this pull request as ready for review June 19, 2025 09:38
@yvan-sraka yvan-sraka requested review from a team as code owners June 19, 2025 09:38
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: treefmt
run: nix-shell -p treefmt nixpkgs-fmt --run "treefmt --ci"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IIRC nix fmt doesn't have a "check" mode, so here I call treefmt --ci directly.

Copy link
Collaborator

@samrose samrose left a comment

Choose a reason for hiding this comment

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

@yvan-sraka this looks great. Can you please add a bit in the nix/docs section to give some clues to people who are not as deeply embedded in Nix tooling etc how to use what was added here (maybe they need to add a plugin for their editor, anything else to know once this is merged and added)

* add a ci job that run `treefmt`
* make it `nix fmt` default formatter
* add dumb simple `pre-commit` and `editorconfig`
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.

2 participants