diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..d3837af --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +ignore = E203, E266, E501, W503, F403, F401, F841 +max-line-length = 89 +max-complexity = 10 +select = B,C,E,F,W,T4,B9 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..13d6995 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + + - repo: https://github.com/ambv/black + rev: 22.10.0 + hooks: + - id: black + language_version: python3.8 + + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + args: ["--profile", "black"] + + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + exclude: "setup.py" + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + # - id: end-of-file-fixer + # - id: check-yaml + # - id: check-added-large-files diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..93fb419 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.black] +py38 = true +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + + # The following are specific to Black, you probably don't want those. + | blib2to3 + | tests/data +)/ +''' diff --git a/requirements-test.txt b/requirements-test.txt index c138fc7..f35da27 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,5 @@ codecov coverage +pre-commit == 2.20.0 psycopg2 tox