Skip to content

Commit

Permalink
Move comment within pre-commit record (helps if sorted) + check yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Mar 4, 2024
1 parent 7a669ca commit 1e7399a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion codespellit
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ if [ -e .pre-commit-config.yaml ]; then
# add pre-commit configuration there
cat >> .pre-commit-config.yaml <<EOF
# Configuration for codespell is in $config
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in $config
rev: v${codespell_version}
hooks:
- id: codespell
Expand All @@ -172,6 +172,11 @@ EOF
fi
git add .pre-commit-config.yaml
git commit -m 'Add pre-commit definition for codespell'

if ! python -c 'import yaml; yaml.safe_load(open(".pre-commit-config.yaml"))'; then
echo "ERROR: added pre-commit definition ruined the yaml format, fix and rerun '!0 list'"
exit 1
fi
fi

list "$@"

0 comments on commit 1e7399a

Please sign in to comment.