Skip to content

Instantly share code, notes, and snippets.

@piotrgredowski
Last active June 24, 2021 18:05
Show Gist options
  • Save piotrgredowski/c30afc43c23c6787b09a4bd9641d4a92 to your computer and use it in GitHub Desktop.
Save piotrgredowski/c30afc43c23c6787b09a4bd9641d4a92 to your computer and use it in GitHub Desktop.
My default setup for python tools
[run]
omit = **/test_*.py
[flake8]
max-line-length = 120
; Creating issue with black and E203 and E712 not compatible
; TODO: remove C901 from ignored when we have time for refactoring
ignore = D203,W503,E203,E712,C901,E231
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,venv
max-complexity = 10
repos:
- repo: local
hooks:
- id: isort
name: isort
entry: isort
require_serial: true
language: python
language_version: python3
types_or: [cython, pyi, python]
args: ['--filter-files']
minimum_pre_commit_version: '2.9.0'
- id: black
name: black
language: system
entry: black
require_serial: true
types: [python]
- id: flake8
name: flake8
language: system
entry: flake8
require_serial: true
types: [python]
- id: pyright
name: pyright
language: system
entry: pyright
require_serial: true
types: [python]
[tool.black]
line-length = 120
target-version = ['py38']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \venv
| \.venv
| _build
| buck-out
| build
| dist
)/
)
'''
[tool.isort]
line_length = 120
multi_line_output = 3
include_trailing_comma = true
{
"exclude": [
"**/test*.py",
"venv",
".venv"
],
"pythonVersion": "3.9",
"pythonPlatform": "Linux"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment