-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shell formatting to pre-commit (#60)
Add shfmt to pre-commit to format our shell scripts, and run it on the existing scripts. This is an additional Go-based dependency.
- Loading branch information
1 parent
121a1c9
commit 562ea57
Showing
2 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,15 +24,26 @@ repos: | |
# Run the linter. | ||
- id: ruff | ||
args: [--fix] | ||
name: auto-fix Python lint errors | ||
# Run the formatter. | ||
- id: ruff-format | ||
name: format Python source | ||
- repo: local | ||
hooks: | ||
- id: format-toml-files | ||
name: toml-format | ||
name: format toml files | ||
entry: taplo | ||
args: ["format"] | ||
files: \.toml$ | ||
language: node | ||
additional_dependencies: | ||
- "@taplo/cli" | ||
# shfmt support, adapted from https://github.com/mvdan/sh/issues/818 | ||
- id: format-shell-scripts | ||
name: format shell scripts | ||
language: golang | ||
require_serial: true | ||
additional_dependencies: [mvdan.cc/sh/v3/cmd/[email protected]] | ||
entry: shfmt | ||
args: ["-l", "-w", "-i", "4"] | ||
types: [shell] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters