Skip to content

Commit e55d2d6

Browse files
Merge pull request #2392 from VWS-Python/shfmt-pre-commit
Add shfmt to pre-commit
2 parents edff4d6 + e8462d5 commit e55d2d6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ ci:
3232
- vulture-docs
3333
- shellcheck
3434
- shellcheck-docs
35+
- shfmt
36+
- shfmt-docs
3537

3638
default_install_hook_types: [pre-commit, pre-push, commit-msg]
3739
repos:
@@ -77,6 +79,19 @@ repos:
7779
language: system
7880
types_or: [markdown, rst]
7981

82+
- id: shfmt
83+
name: shfmt
84+
entry: shfmt --write
85+
language: system
86+
pass_filenames: false
87+
types_or: [shell]
88+
89+
- id: shfmt-docs
90+
name: shfmt-docs
91+
entry: doccmd --language=shell --language=console --no-pad-file --command="shfmt --write"
92+
language: system
93+
types_or: [markdown, rst]
94+
8095
- id: mypy
8196
name: mypy
8297
stages: [push]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ optional-dependencies.dev = [
6565
# but also because having it installed means that ``actionlint-py`` will
6666
# use it to lint shell commands in GitHub workflow files.
6767
"shellcheck-py==0.10.0.1",
68+
"shfmt-py==3.7.0.1",
6869
"sphinx==8.0.2",
6970
"sphinx-copybutton==0.5.2",
7071
"sphinx-substitution-extensions==2024.8.6",

0 commit comments

Comments
 (0)