diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 621e643b..424fb255 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,6 +32,8 @@ ci: - vulture-docs - shellcheck - shellcheck-docs + - shfmt + - shfmt-docs default_install_hook_types: [pre-commit, pre-push, commit-msg] repos: @@ -77,6 +79,19 @@ repos: language: system types_or: [markdown, rst] + - id: shfmt + name: shfmt + entry: shfmt --write + language: system + pass_filenames: false + types_or: [shell] + + - id: shfmt-docs + name: shfmt-docs + entry: doccmd --language=shell --language=console --no-pad-file --command="shfmt --write" + language: system + types_or: [markdown, rst] + - id: mypy name: mypy stages: [push] diff --git a/pyproject.toml b/pyproject.toml index f5aa17b7..72d010d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ optional-dependencies.dev = [ # but also because having it installed means that ``actionlint-py`` will # use it to lint shell commands in GitHub workflow files. "shellcheck-py==0.10.0.1", + "shfmt-py==3.7.0.1", "sphinx==8.0.2", "sphinx-copybutton==0.5.2", "sphinx-substitution-extensions==2024.8.6",