From c296d77cebd89bda362cf0f7bfb9221c91e96faf Mon Sep 17 00:00:00 2001 From: odrling Date: Sun, 27 Feb 2022 06:02:51 +0100 Subject: [PATCH] pre-commit setup --- .envrc | 2 ++ .gitignore | 2 ++ .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ dev_requirements.txt | 3 +++ stubs/pyperclip/__init__.pyi | 1 + stubs/setuptools/__init__.pyi | 4 ++++ 6 files changed, 45 insertions(+) create mode 100644 .envrc create mode 100644 .pre-commit-config.yaml create mode 100644 dev_requirements.txt create mode 100644 stubs/pyperclip/__init__.pyi create mode 100644 stubs/setuptools/__init__.pyi diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..92be718 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +layout_python3 +export MYPYPATH=stubs diff --git a/.gitignore b/.gitignore index 9aa6056..67ba515 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.egg-info __pycache__/ build/ + +.direnv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3dd3b43 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/dev_requirements.txt b/dev_requirements.txt new file mode 100644 index 0000000..e227fd8 --- /dev/null +++ b/dev_requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +types-orjson +types-requests diff --git a/stubs/pyperclip/__init__.pyi b/stubs/pyperclip/__init__.pyi new file mode 100644 index 0000000..86dc588 --- /dev/null +++ b/stubs/pyperclip/__init__.pyi @@ -0,0 +1 @@ +def copy(text: str) -> None: ... diff --git a/stubs/setuptools/__init__.pyi b/stubs/setuptools/__init__.pyi new file mode 100644 index 0000000..d3f6862 --- /dev/null +++ b/stubs/setuptools/__init__.pyi @@ -0,0 +1,4 @@ + +def setup(**attrs): ... + +def find_packages(): ...