chore: Simplify formatting toolchain
Remove treefmt and djlint from pre-commit hooks. djlint corrupted Askama template syntax on first run. Use individual formatters (cargo fmt, shfmt, oxfmt) directly instead. Update prek hooks to use fmt-rs and fmt-sh separately.
This commit is contained in:
parent
527358b695
commit
197f0f541b
4 changed files with 19 additions and 41 deletions
11
.mise.toml
11
.mise.toml
|
|
@ -8,8 +8,7 @@ prek = "latest"
|
|||
"github:watchexec/cargo-watch" = "latest"
|
||||
shellcheck = "latest"
|
||||
flyctl = "latest"
|
||||
"aqua:numtide/treefmt" = "latest"
|
||||
"npm:oxfmt" = "latest"
|
||||
"aqua:mvdan/sh" = "latest"
|
||||
|
||||
[env]
|
||||
SQLX_OFFLINE = "false"
|
||||
|
|
@ -19,12 +18,10 @@ install-deps = "sudo apt-get update && sudo apt-get install -y --no-install-reco
|
|||
|
||||
install-py-deps = "uv tool install djlint"
|
||||
|
||||
fmt = { depends = ["fmt:rs", "fmt:sh", "fmt:templates"] }
|
||||
fmt = { depends = ["fmt:rs", "fmt:sh", "fmt:assets"] }
|
||||
"fmt:rs" = "cargo fmt"
|
||||
"fmt:sh" = "treefmt --filter shfmt"
|
||||
"fmt:templates" = { depends = ["fmt:html", "fmt:assets"] }
|
||||
"fmt:html" = "uvx djlint templates/ --reformat"
|
||||
"fmt:assets" = "treefmt --filter oxfmt"
|
||||
"fmt:sh" = "shfmt -i 2 -s -w $(find . -name '*.sh' -not -path './target/*')"
|
||||
"fmt:assets" = "oxfmt --write $(find . \\( -name '*.css' -o -name '*.json' -o -name '*.yaml' -o -name '*.yml' -o -name '*.md' \\) -not -path './target/*' -not -path './.git/*')"
|
||||
|
||||
lint = { depends = ["lint:rs", "lint:sh"] }
|
||||
"lint:rs" = "cargo clippy -- -D warnings"
|
||||
|
|
|
|||
16
prek.toml
16
prek.toml
|
|
@ -14,14 +14,24 @@ hooks = [
|
|||
repo = "local"
|
||||
hooks = [
|
||||
{
|
||||
id = "fmt-check",
|
||||
name = "fmt-check",
|
||||
entry = "treefmt --fail-on-change --no-cache",
|
||||
id = "fmt-rs",
|
||||
name = "fmt-rs",
|
||||
entry = "cargo fmt -- --check",
|
||||
language = "system",
|
||||
files = "\\.rs$",
|
||||
pass_filenames = false,
|
||||
fail_fast = true,
|
||||
stages = ["pre-commit"],
|
||||
},
|
||||
{
|
||||
id = "fmt-sh",
|
||||
name = "fmt-sh",
|
||||
entry = "shfmt -i 2 -d",
|
||||
language = "system",
|
||||
types = ["shell"],
|
||||
fail_fast = true,
|
||||
stages = ["pre-commit"],
|
||||
},
|
||||
{
|
||||
id = "clippy",
|
||||
name = "clippy",
|
||||
|
|
|
|||
|
|
@ -236,9 +236,7 @@ input.input-field[type="number"] {
|
|||
|
||||
@media (max-width: 767px) {
|
||||
:root {
|
||||
--fixed-nav-h: calc(
|
||||
max(1rem, env(safe-area-inset-top, 0px) * 0.9) + 3.25rem
|
||||
);
|
||||
--fixed-nav-h: calc(max(1rem, env(safe-area-inset-top, 0px) * 0.9) + 3.25rem);
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
|
|
@ -557,9 +555,7 @@ input.input-field[type="number"] {
|
|||
/* ── Data page ─────────────────────────────────────────────────── */
|
||||
|
||||
/* Hide duplicate search inside data page - search is in the tab bar */
|
||||
.data-page-content
|
||||
section:has(.responsive-table)
|
||||
> div:first-child:has(input[type="search"]) {
|
||||
.data-page-content section:has(.responsive-table) > div:first-child:has(input[type="search"]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
|||
25
treefmt.toml
25
treefmt.toml
|
|
@ -1,25 +0,0 @@
|
|||
[formatter.rust]
|
||||
command = "rustfmt"
|
||||
options = ["--edition", "2024"]
|
||||
include = ["*.rs"]
|
||||
|
||||
[formatter.shell]
|
||||
command = "shfmt"
|
||||
options = ["-i", "2", "-s", "-w"]
|
||||
include = ["*.sh"]
|
||||
|
||||
[formatter.oxfmt]
|
||||
command = "oxfmt"
|
||||
options = ["--write"]
|
||||
include = [
|
||||
"*.css",
|
||||
"*.json",
|
||||
"*.yaml",
|
||||
"*.yml",
|
||||
"*.md",
|
||||
]
|
||||
|
||||
[formatter.djlint]
|
||||
command = "djlint"
|
||||
options = ["--reformat", "--quiet"]
|
||||
include = ["*.html"]
|
||||
Loading…
Reference in a new issue