Skip to content

Commit

Permalink
feat: improve + standardize configs across projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ahgraber committed May 13, 2024
1 parent 141a690 commit 72aaf4a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
max_line_length = 120
# max_line_length = 120
trim_trailing_whitespace = true

[*.{bat,cmd,ps1}]
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,23 @@ repos:
name: Lint and Format with Ruff
args: [--fix]
stages: [commit]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: "v0.10.0"
- repo: local
hooks:
- id: shellcheck
name: Lint shell scripts
# ignore '*.zsh" scripts'
exclude: "^.*zsh$"
language: system
entry: shellcheck
types: ["shell"]
exclude: "^.*zsh$" # ignore '*.zsh" scripts'
stages: [commit]
- repo: https://github.com/scop/pre-commit-shfmt
rev: "v3.8.0-1"
hooks:
- id: shfmt
name: Format shell scripts
args:
- -i 2
- -i
- "2"
- -ci
- -bn
stages: [commit]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on answers to a survey during the setup phase.
We will use [pipx](https://pipx.pypa.io/stable/) to install and run applications from isolated globally-available
python environments.

Some pre-commit hooks (`hadolint`, `prettier`), expect to find the tool available in your path.
Some pre-commit hooks (`hadolint`, `prettier`, `shellcheck`), expect to find the tool available in your path. You may
need to install them.

### Install `copier` and `pre-commit`

Expand Down
12 changes: 7 additions & 5 deletions template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ repos:
args: [--fix]
stages: [commit]
{%- endif %}{% if shellcheck %}
- repo: https://github.com/koalaman/shellcheck-precommit
rev: "v0.10.0"
- repo: local
hooks:
- id: shellcheck
name: Lint shell scripts
# ignore '*.zsh" scripts'
exclude: "^.*zsh$"
language: system
entry: shellcheck
types: ["shell"]
exclude: "^.*zsh$" # ignore '*.zsh" scripts'
stages: [commit]
{%- endif %}{% if shfmt %}
- repo: https://github.com/scop/pre-commit-shfmt
Expand All @@ -137,7 +138,8 @@ repos:
- id: shfmt
name: Format shell scripts
args:
- -i 2
- -i
- "2"
- -ci
- -bn
stages: [commit]
Expand Down

0 comments on commit 72aaf4a

Please sign in to comment.