Skip to content

Commit 7517ee2

Browse files
authored
Merge pull request #27 from payjoin/more-fmt
more treefmt formatters & cargo sort
2 parents e85270b + 83e9cad commit 7517ee2

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/cargo.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: Cargo
2-
32
on:
43
push:
54
branches: [main]
65
pull_request:
7-
86
jobs:
97
test:
108
runs-on: ubuntu-latest

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: CI
2-
32
on:
43
push:
54
branches: [main]
65
pull_request:
7-
86
jobs:
97
scrub:
108
runs-on: ubuntu-latest

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ check-all:
1313
# Lint checks (formatting + source invariants)
1414
lint:
1515
{{ nix_cmd }} build --no-update-lock-file '.#checks.{{ system }}.lint'
16-
16+
1717
# Auto-format all files
1818
fmt:
1919
nix fmt

nix/checks.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@
8989
}
9090
);
9191

92+
cargo-sort =
93+
pkgs.runCommand "cargo-sort-${rev}"
94+
{
95+
inherit src;
96+
nativeBuildInputs = [ pkgs.cargo-sort ];
97+
}
98+
''
99+
cargo-sort --check --workspace "$src"
100+
mkdir -p $out
101+
'';
102+
92103
no-todo-comments = pkgs.runCommand "no-todo-comments-${rev}" { inherit src; } ''
93104
if grep -rn --exclude-dir=contrib 'TO[D]O\|FIX[M]E' $src/ 2>/dev/null; then
94105
echo "FAIL: unresolved work-item markers found"
@@ -110,6 +121,7 @@
110121
lint = pkgs.symlinkJoin {
111122
name = "lint-checks-${rev}";
112123
paths = [
124+
checks.cargo-sort
113125
checks.clippy
114126
checks.doc
115127
checks.no-todo-comments

nix/treefmt.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
programs.rustfmt.enable = true;
1111
programs.shellcheck.enable = true;
1212
programs.shfmt.enable = true;
13+
programs.just.enable = true;
14+
programs.mdformat.enable = true;
15+
programs.taplo.enable = true;
16+
programs.yamlfmt.enable = true;
1317

1418
settings.global.excludes = [ ".envrc" ];
1519
};

0 commit comments

Comments
 (0)