Skip to content

Commit 6c5a738

Browse files
committed
dev: add coding tooling
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 9d360c9 commit 6c5a738

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.git-blame-ignore-revs

Whitespace-only changes.

justfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use `just <recipe>` to run a recipe
2+
# https://just.systems/man/en/
3+
4+
# By default, run the `--list` command
5+
default:
6+
@just --list
7+
8+
# Aliases
9+
10+
alias fmt := format
11+
12+
# Format all files
13+
[group('linter')]
14+
format:
15+
nix-shell -p treefmt libclang nodePackages.prettier shfmt nixfmt-rfc-style taplo --run treefmt
16+
17+
# Add git commit hashes to the .git-blame-ignore-revs file
18+
[group('linter')]
19+
add-git-blame-ignore-revs:
20+
git log --pretty=format:"%H" --grep="^lint" >> .git-blame-ignore-revs
21+
sort .git-blame-ignore-revs | uniq > .git-blame-ignore-revs.tmp
22+
mv .git-blame-ignore-revs.tmp .git-blame-ignore-revs

treefmt.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# https://github.com/numtide/treefmt
2+
# https://github.com/numtide/treefmt-nix
3+
4+
on-unmatched = "info"
5+
6+
[formatter.clang-format]
7+
command = "clang-format"
8+
9+
# Only target the exact directories we want
10+
includes = [
11+
"*.cpp",
12+
"*.h",
13+
]
14+
15+
[formatter.prettier]
16+
command = "prettier"
17+
options = ["--write"]
18+
includes = ["*.md", "*.yaml", "*.yml"]
19+
20+
[formatter.shfmt]
21+
command = "shfmt"
22+
excludes = []
23+
includes = ["*.sh", "*.bash", "*.envrc", "*.envrc.*"]
24+
options = ["-s", "-w", "-i", "2"]
25+
26+
[formatter.just]
27+
command = "just"
28+
includes = ["*.just"]
29+
30+
[formatter.taplo]
31+
command = "taplo"
32+
includes = ["*.toml"]
33+
options = ["format"]
34+
35+
[formatter.nixfmt-rfc-style]
36+
command = "nixfmt"
37+
excludes = []
38+
includes = ["*.nix"]
39+
options = []

0 commit comments

Comments
 (0)