From 270eb495ab1438d138ab84b3a28a9b3488c6f782 Mon Sep 17 00:00:00 2001 From: Lukas Bockstaller Date: Thu, 12 Nov 2020 15:05:24 +0100 Subject: [PATCH] pins pre-commit-tool versions I've run precommit-autoupdate to update black to a current version with an explicit version number. See this issue for reference https://github.com/psf/black/issues/420#issuecomment-413916998 This allows us to pin the github-actions tool versions as well. This commit applies the new formatting style directly. --- .github/workflows/development_workflow.yml | 2 +- .isort.cfg | 3 ++- .pre-commit-config.yaml | 9 +++++---- src/main.py | 3 ++- tests/sample_test.py | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/development_workflow.yml b/.github/workflows/development_workflow.yml index 3f9ff32..7f8fa70 100644 --- a/.github/workflows/development_workflow.yml +++ b/.github/workflows/development_workflow.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - uses: psf/black@stable + - uses: psf/black@20.8b1 flake8: runs-on: ubuntu-latest diff --git a/.isort.cfg b/.isort.cfg index 04a3e1f..e3e003f 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,2 +1,3 @@ [settings] -line_length=88 \ No newline at end of file +line_length=88 +known_third_party = utils diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c737f6..7c6cd44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,18 @@ # isort +repos: - repo: https://github.com/asottile/seed-isort-config - rev: v1.9.3 + rev: v2.2.0 hooks: - id: seed-isort-config - repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 + rev: v5.6.4 hooks: - id: isort # black - repo: https://github.com/ambv/black - rev: stable + rev: 20.8b1 hooks: - id: black args: @@ -33,7 +34,7 @@ # flake8 - repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 + rev: 3.8.4 hooks: - id: flake8 args: diff --git a/src/main.py b/src/main.py index 140ad9d..27681e2 100644 --- a/src/main.py +++ b/src/main.py @@ -13,7 +13,8 @@ # run example function hello_world_success = hello_world() print("Hello World completed successfully!") if hello_world_success else print( - "Hello Wold failed!") + "Hello Wold failed!" + ) # exemplify how to access environment variables print("\nEnvironment variable: {}".format(os.environ["TEST_PW"])) diff --git a/tests/sample_test.py b/tests/sample_test.py index d349796..871793c 100644 --- a/tests/sample_test.py +++ b/tests/sample_test.py @@ -12,5 +12,5 @@ def test_sample(self): self.assertTrue(True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main()