-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2128 from IFRCGo/feature/pre-commit-hooks
Add pre-commit-hooks
- Loading branch information
Showing
944 changed files
with
30,544 additions
and
25,423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.