From 70b1122c4edd2479f49d79a7e2f76275cc2848f4 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 24 Apr 2021 09:08:23 -0400 Subject: [PATCH] precommit --- .github/workflows/test_and_deploy.yml | 4 ++-- .pre-commit-config.yaml | 28 +++++++++++++++++++++++++++ qrangeslider/_tests/test_slider.py | 0 setup.cfg | 3 +++ setup.py | 2 +- tox.ini | 4 ++-- 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 qrangeslider/_tests/test_slider.py diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 6258f88..7dea8b2 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,6 +1,6 @@ name: Test -on: +on: push: branches: - master @@ -53,7 +53,7 @@ jobs: deploy: # this will run when you have tagged a commit, starting with "v*" - # and requires that you have put your twine API key in your + # and requires that you have put your twine API key in your # github secrets (see readme for details) needs: [test] runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9e435d5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + args: ["--in-place", "--remove-all-unused-imports"] + - repo: https://github.com/PyCQA/isort + rev: 5.8.0 + hooks: + - id: isort + - repo: https://github.com/asottile/pyupgrade + rev: v2.12.0 + hooks: + - id: pyupgrade + - repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + - repo: https://github.com/PyCQA/flake8 + rev: 3.9.0 + hooks: + - id: flake8 + pass_filenames: true diff --git a/qrangeslider/_tests/test_slider.py b/qrangeslider/_tests/test_slider.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg index c6eda50..1be57b2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,3 +61,6 @@ exclude = _version.py,.eggs,examples max-line-length = 79 docstring-convention = numpy ignore = E203,W503,E501,C901 + +[isort] +profile=black diff --git a/setup.py b/setup.py index 1163027..edbabce 100644 --- a/setup.py +++ b/setup.py @@ -7,4 +7,4 @@ from setuptools import setup setup( use_scm_version={"write_to": "qrangeslider/_version.py"}, setup_requires=["setuptools_scm"], -) \ No newline at end of file +) diff --git a/tox.ini b/tox.ini index 1ad9162..feaf473 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ python = 3.7: py37 3.8: py38 3.9: py39 - + [gh-actions:env] PLATFORM = ubuntu-latest: linux @@ -22,7 +22,7 @@ BACKEND = pyside: pyside [testenv] -platform = +platform = macos: darwin linux: linux windows: win32