Skip to content

Commit

Permalink
replace beautysh with shell-fmt-go
Browse files Browse the repository at this point in the history
- beautysh hasn't been updated for a few years and doesn't work with Python 3.12
- shfmt tool is widely used & actively maintained: https://pkg.go.dev/mvdan.cc/sh/v3#readme-shfmt
- add `shell` tag as identify doesn't check shebang if it can guess the tag from the extension, so bash scripts with .sh extension are always tagged `shell` and not `bash`
- add requests to optional test dependencies
  • Loading branch information
lkeegan committed May 3, 2024
1 parent 8839484 commit 5896d58
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ repos:
hooks:
- id: validate-cff # Validate CFF format

- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
rev: v2.2.0
hooks:
- id: beautysh # Beautify Bash scripts
- id: shell-fmt-go # Format Bash scripts

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
Expand Down
6 changes: 3 additions & 3 deletions precommend/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ repos:
hooks:
- id: validate-cff # Validate CFF format

- repo: https://github.com/lovesegfault/beautysh
rev: v6.2.1
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
rev: v2.2.0
hooks:
- id: beautysh # Beautify Bash scripts
- id: shell-fmt-go # Format Bash scripts

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
Expand Down
6 changes: 3 additions & 3 deletions precommend/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def actionlint(ctx):


@rule
def beautysh(ctx):
if ctx.tag_exists("bash"):
return "beautysh"
def shell_fmt_go(ctx):
if ctx.tag_exists("shell") or ctx.tag_exists("bash"):
return "shell-fmt-go"


@rule
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies = [
[project.optional-dependencies]
tests = [
"pytest",
"requests",
]

# Command line scripts installed as part of the installation
Expand Down

0 comments on commit 5896d58

Please sign in to comment.