Skip to content

Commit

Permalink
[ci] use shfmt-py in pre-commit to run shfmt (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored May 30, 2024
1 parent f180591 commit a136858
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,4 @@ jobs:
requests \
types-requests \
yamllint
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
shfmt
make lint
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- types-requests
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.5
rev: v0.4.6
hooks:
# Run the linter.
- id: ruff
Expand All @@ -31,6 +31,11 @@ repos:
- id: ruff-format
args: ["--config", "pyproject.toml"]
types_or: [python, jupyter]
- repo: https://github.com/maxwinterstein/shfmt-py
rev: v3.7.0.1
hooks:
- id: shfmt
args: ["--indent=4", "--space-redirects", "--write"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
Expand Down
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,13 @@ clean:
rm -rf ./tests/data/baseballmetrics/baseballmetrics.egg-info
rm -rf ./tests/data/baseballmetrics/_skbuild

.PHONY: format
format:
shfmt \
--write \
--indent 4 \
--space-redirects \
./bin

.PHONY: install
install:
pipx install --force '.[conda]'

.PHONY: lint
lint:
pre-commit run --all-files
shfmt \
-d \
-i 4 \
-sr \
./bin
yamllint \
--strict \
-d '{extends: default, rules: {braces: {max-spaces-inside: 1}, truthy: {check-keys: false}, line-length: {max: 120}}}' \
Expand Down

0 comments on commit a136858

Please sign in to comment.