mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-03 05:13:36 +09:00
flake: format the tree with one treefmt
The pre-commit hooks kept their own list of formatters, so nixpkgs-fmt in a hook and nixfmt in the check disagreed the moment flake-checks moved. `nix fmt` is now built from the same treefmt module the formatting check is, and the hook and the Makefile both call it.
This commit is contained in:
+7
-13
@@ -32,21 +32,15 @@ repos:
|
||||
# Local hooks for project-specific tooling
|
||||
- repo: local
|
||||
hooks:
|
||||
# nixfmt for Nix files; the same formatter the flake's treefmt check
|
||||
# runs, so the hook and the check cannot disagree.
|
||||
- id: nixfmt
|
||||
name: nixfmt
|
||||
entry: nixfmt
|
||||
language: system
|
||||
files: \.nix$
|
||||
|
||||
# Prettier for formatting
|
||||
- id: prettier
|
||||
name: prettier
|
||||
entry: prettier --write --list-different
|
||||
# One formatter for Nix and markup, built from the same treefmt module as
|
||||
# the flake's formatting check, so the hook and the check cannot disagree.
|
||||
# Go is absent on purpose: golangci-lint owns it, below.
|
||||
- id: treefmt
|
||||
name: treefmt
|
||||
entry: nix fmt --
|
||||
language: system
|
||||
exclude: ^docs/
|
||||
types_or: [javascript, jsx, ts, tsx, yaml, json, html, css, scss, sass, markdown]
|
||||
types_or: [javascript, jsx, ts, tsx, yaml, json, html, css, scss, sass, markdown, nix]
|
||||
|
||||
# mdformat for docs
|
||||
- id: mdformat
|
||||
|
||||
Reference in New Issue
Block a user