Skip to content

chore: 🔨 add commit linting via pre-commit #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ group:
# General
- source: .github/CODEOWNERS
dest: .github/CODEOWNERS
- source: .pre-commit-config.yaml
dest: .pre-commit-config.yaml
- source: .dockerignore
dest: .dockerignore
- source: .editorconfig
Expand Down
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_commit_msg: "chore(pre-commit): :pencil2: automatic fixes"
autoupdate_commit_msg: "ci(pre-commit): :construction_worker: update pre-commit CI version"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.30.0
hooks:
- id: commitizen
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ poetry init
Search for `NAME` and `REPO` and replace them with the name of your project and the repository name. Then look for any `TODO` items.

You will need to set up Fly manually for now.

## Setting things up

Use the commands found in [`spaid`](https://github.com/seedcase-project/spaid) repo to run the next setup steps.
10 changes: 6 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ build-website:
export QUARTO_PYTHON=.venv/bin/python3
poetry run quarto render --execute

# Add files for a new function (function file and test file)
add-function app part name:
touch ./{{app}}/{{part}}/{{name}}.py
touch ./tests/{{part}}/test_{{name}}.py
check-commit:
#!/bin/zsh
if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]
then
poetry run cz check --rev-range main..HEAD
fi