Skip to content

Instantly share code, notes, and snippets.

@lucidfrontier45
Last active May 12, 2022 00:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucidfrontier45/38641f497240e77d622c879509f907a3 to your computer and use it in GitHub Desktop.
Save lucidfrontier45/38641f497240e77d622c879509f907a3 to your computer and use it in GitHub Desktop.
python linter and vscode settings
all: check
format:
black .
isort .
lint: format
flake8 --exit-zero .
mypy --show-column-numbers .
test: lint
pytest tests --cov=demoapp --cov-report=term --cov-report=xml
check: test
[tool.poe.tasks]
black = "black ."
isort = "isort ."
flake8 = "flake8 --exit-zero ."
mypy = "mypy --show-column-numbers ."
test = "pytest tests --cov=demoapp --cov-report=term --cov-report=xml"
format = ["black", "isort"]
lint = ["flake8", "mypy"]
check = ["format", "lint", "test"]
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.ignorePatterns": [
"tests/**/*.py"
],
"python.linting.mypyArgs": [
"--show-column-numbers"
],
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": false,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}
[isort]
profile = black
[flake8]
max-line-length = 88
extend-ignore = E203
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,.venv,venv,.tox
per-file-ignores =
*/__init__.py: F401
[pylint]
max-line-length = 88
[pylint.messages_control]
disable = C0330, C0326
[mypy]
check_untyped_defs = True
warn_return_any = True
warn_unused_ignores = True
no_implicit_optional = True
show_error_codes = True
exclude = tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment