Skip to content

Commit

Permalink
Add pre-commit-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
k9845 committed May 2, 2024
1 parent 6a3e433 commit 2221f30
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Python check

on:
push:
branches:
- develop
pull_request:


jobs:
pre_commit_checks:
name: 🚴 Pre-Commit checks 🚴
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@main
with:
cache: 'poetry'
- run: poetry install
- uses: pre-commit/action@main
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
default_language_version:
python: python3

# NOTE: Update in .flake8 pyproject.toml as well
exclude: |
(?x)^(
\.git|
__pycache__|
.*snap_test_.*\.py|
.+\/.+\/migrations\/.*|
legacy|
\.venv
)
repos:
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
# args: ["--check"]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
# args: ["--check"]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8

0 comments on commit 2221f30

Please sign in to comment.