pre-commit setup

This commit is contained in:
odrling 2022-02-27 06:02:51 +01:00
parent 64d07ba380
commit c296d77ceb
No known key found for this signature in database
GPG Key ID: A0145F975F9F8B75
6 changed files with 45 additions and 0 deletions

2
.envrc Normal file
View File

@ -0,0 +1,2 @@
layout_python3
export MYPYPATH=stubs

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
*.egg-info
__pycache__/
build/
.direnv/

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

@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-ast
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: check-shebang-scripts-are-executable
- id: check-executables-have-shebangs
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: '886e1c39f0dcddeee1cd260418372cf5f3932391'
hooks:
- id: mypy
args: []
additional_dependencies: [types-orjson, types-requests, typer]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.0'
hooks:
- id: bandit

3
dev_requirements.txt Normal file
View File

@ -0,0 +1,3 @@
-r requirements.txt
types-orjson
types-requests

View File

@ -0,0 +1 @@
def copy(text: str) -> None: ...

View File

@ -0,0 +1,4 @@
def setup(**attrs): ...
def find_packages(): ...