Add tooling configs

This commit is contained in:
Odd Stråbø 2021-10-31 17:03:18 +01:00
parent 630b3eaa56
commit d8f3a16a45
4 changed files with 78 additions and 0 deletions

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{py,yaml,yml}]
indent_style = space
[*.{yaml,yml}]
indent_size = 2

48
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,48 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
args:
- "--fix=lf"
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: detect-private-key
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.3.54
hooks:
- id: editorconfig-checker
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- id: mypy
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"python.linting.flake8Enabled": true
}

6
tox.ini Normal file
View File

@ -0,0 +1,6 @@
[flake8]
max-line-length = 88
extend-ignore = E203, I201
[tool.isort]
profile = "black"