-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and configure pre-commit for ruff, flake8 and yapf
- Loading branch information
Jens-Erik Weber
authored and
Jens-Erik Weber
committed
Sep 19, 2023
1 parent
be735be
commit 94da9e8
Showing
2 changed files
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
extend-ignore = | ||
# closing bracket does not match visual indentation, caused by yapf | ||
E124 | ||
# continuation line missing indentation or outdented | ||
# doesn’t look wrong, formatted like this by yapf | ||
E122 | ||
# E251 unexpected spaces around keyword / parameter equals, caused by yapf wrapping lines after “=” | ||
E251 | ||
|
||
per-file-ignores = | ||
# E501 line too long | ||
*/migrations/*: E501 | ||
|
||
# F403 e. g. 'from .base_settings import *' used; unable to detect undefined names | ||
# F405 x may be undefined, or defined from star imports | ||
phi/*settings*: F403, F405 | ||
|
||
exclude = | ||
local |
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,24 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.0.290 | ||
hooks: | ||
- id: ruff | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: '6.1.0' # pick a git hash / tag to point to | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/google/yapf | ||
rev: 'v0.40.0' | ||
hooks: | ||
- id: yapf | ||
name: yapf | ||
description: "A formatter for Python files." | ||
entry: yapf | ||
args: [ -i ] # inplace | ||
language: python | ||
types: [ python ] |