Skip to content

Commit

Permalink
install jq as treefmt formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodachi94 committed Jul 27, 2024
1 parent 2fa90e8 commit f3d1444
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/just/formatter-wrappers.just
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ _format-wrapper-statix *files:
statix fix --config lib/tooling-config/statix.toml "$file"
done
_format-wrapper-jq *files:
#!/usr/bin/env sh
set -euxo pipefail
for file in {{files}}; do
echo "$file" | jq -S > "$file"
done
5 changes: 5 additions & 0 deletions lib/tooling-config/treefmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ command = "taplo"
options = ["format"]
includes = ["*.toml"]

[formatter.jq]
command = "just"
options = ["_format-wrapper-jq"]
includes = ["*.json", "*.jsonc"]

[formatter.mdformat]
command = "mdformat"
includes = ["*.md"]
Expand Down

0 comments on commit f3d1444

Please sign in to comment.