diff --git a/.mise.toml b/.mise.toml index ee07204..bcbb312 100644 --- a/.mise.toml +++ b/.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" diff --git a/prek.toml b/prek.toml index e9303d8..13903ba 100644 --- a/prek.toml +++ b/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", diff --git a/static/css/input.css b/static/css/input.css index 121cd6b..68ea7ba 100644 --- a/static/css/input.css +++ b/static/css/input.css @@ -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; } diff --git a/treefmt.toml b/treefmt.toml deleted file mode 100644 index 6d363c0..0000000 --- a/treefmt.toml +++ /dev/null @@ -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"]