Skip to content

Commit

Permalink
Merge pull request #2128 from IFRCGo/feature/pre-commit-hooks
Browse files Browse the repository at this point in the history
Add pre-commit-hooks
  • Loading branch information
szabozoltan69 authored Jun 12, 2024
2 parents 2e74006 + 657a24b commit 576f03c
Show file tree
Hide file tree
Showing 944 changed files with 30,544 additions and 25,423 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = C901, W504
extend-ignore = C901, E203, E701
max-line-length = 130
exclude = .git,__pycache__,old,build,dist,*migrations*,*snapshots*
max-complexity = 10
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
Loading

0 comments on commit 576f03c

Please sign in to comment.