From 4f0a00620c05e15bb3c532585473b694442102e5 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 14:31:45 +0000 Subject: [PATCH 1/7] pre-commit: add docformatter --- .pre-commit-config.yaml | 7 +++++++ pyproject.toml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6789ede9..7adea3a8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,5 +38,12 @@ repos: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version additional_dependencies: ["tox>=4.9"] + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.5 + hooks: + - id: docformatter + additional_dependencies: [tomli] + args: [--in-place --config ./pyproject.toml] + ci: autoupdate_schedule: monthly diff --git a/pyproject.toml b/pyproject.toml index 4ceac2e51..39d65806f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,3 +80,7 @@ skip_covered = true exclude = ["**/__pycache__"] ignore = ["**/*_pb2.py*","**/*_pb2_grpc.py*"] pythonVersion = "3.8" + +[tool.docformatter] +blank = true +style = "google" From 398fb3eea8ce5125461a2c1599a4dbbe8384fa44 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 14:35:48 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 39d65806f..7abd95f5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,10 @@ extend-exclude = '''( (_pb2.pyi?|_pb2_grpc.pyi?)$ )''' +[tool.docformatter] +blank = true +style = "google" + [tool.pytest.ini_options] asyncio_mode = "auto" log_auto_indent = true @@ -80,7 +84,3 @@ skip_covered = true exclude = ["**/__pycache__"] ignore = ["**/*_pb2.py*","**/*_pb2_grpc.py*"] pythonVersion = "3.8" - -[tool.docformatter] -blank = true -style = "google" From 1e2cdef866d5deab6c4987b96006a1b2edee4155 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 14:49:23 +0000 Subject: [PATCH 3/7] pre-commit: temporary mask flake8 --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7adea3a8d..4836f62e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,14 +24,14 @@ repos: rev: 5.13.2 hooks: - id: isort - - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - additional_dependencies: - - flake8-bugbear==24.2.6 - - flake8-comprehensions - - flake8-simplify + # - repo: https://github.com/pycqa/flake8 + # rev: 7.0.0 + # hooks: + # - id: flake8 + # additional_dependencies: + # - flake8-bugbear==24.2.6 + # - flake8-comprehensions + # - flake8-simplify - repo: https://github.com/tox-dev/pyproject-fmt rev: "1.8.0" hooks: From 792154fa14aa316792be10bf9a3bac76777b4083 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 14:52:02 +0000 Subject: [PATCH 4/7] pre-commit: mask everything except black --- .pre-commit-config.yaml | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4836f62e8..4d92dbcc8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,11 @@ repos: - id: detect-private-key - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.10.0 - hooks: - - id: python-check-mock-methods - - id: python-use-type-annotations + # - repo: https://github.com/pre-commit/pygrep-hooks + # rev: v1.10.0 + # hooks: + # - id: python-check-mock-methods + # - id: python-use-type-annotations # Using this mirror lets us use mypyc-compiled black, which is about 2x faster - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.4.2 @@ -20,10 +20,10 @@ repos: # pre-commit's default_language_version, see # https://pre-commit.com/#top_level-default_language_version language_version: python3.11 - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort + # - repo: https://github.com/pycqa/isort + # rev: 5.13.2 + # hooks: + # - id: isort # - repo: https://github.com/pycqa/flake8 # rev: 7.0.0 # hooks: @@ -32,18 +32,18 @@ repos: # - flake8-bugbear==24.2.6 # - flake8-comprehensions # - flake8-simplify - - repo: https://github.com/tox-dev/pyproject-fmt - rev: "1.8.0" - hooks: - - id: pyproject-fmt - # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version - additional_dependencies: ["tox>=4.9"] - - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 - hooks: - - id: docformatter - additional_dependencies: [tomli] - args: [--in-place --config ./pyproject.toml] + # - repo: https://github.com/tox-dev/pyproject-fmt + # rev: "1.8.0" + # hooks: + # - id: pyproject-fmt + # # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version + # additional_dependencies: ["tox>=4.9"] + # - repo: https://github.com/PyCQA/docformatter + # rev: v1.7.5 + # hooks: + # - id: docformatter + # additional_dependencies: [tomli] + # args: [--in-place --config ./pyproject.toml] ci: autoupdate_schedule: monthly From 6fa2db4b366aa62a3c3996366a7ce1a68fc21c77 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 14:54:05 +0000 Subject: [PATCH 5/7] pre-commit: try only use isort and black --- .pre-commit-config.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d92dbcc8..b984aed8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,6 @@ repos: - id: detect-private-key - id: end-of-file-fixer - id: trailing-whitespace - # - repo: https://github.com/pre-commit/pygrep-hooks - # rev: v1.10.0 - # hooks: - # - id: python-check-mock-methods - # - id: python-use-type-annotations # Using this mirror lets us use mypyc-compiled black, which is about 2x faster - repo: https://github.com/psf/black-pre-commit-mirror rev: 24.4.2 @@ -20,10 +15,10 @@ repos: # pre-commit's default_language_version, see # https://pre-commit.com/#top_level-default_language_version language_version: python3.11 - # - repo: https://github.com/pycqa/isort - # rev: 5.13.2 - # hooks: - # - id: isort + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort # - repo: https://github.com/pycqa/flake8 # rev: 7.0.0 # hooks: From 5a3c196a38b72d3f3f2844eef7b3800a75595030 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 14:56:00 +0000 Subject: [PATCH 6/7] pre-commit: only isort --- .pre-commit-config.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b984aed8b..0bb9b4be2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,16 +5,16 @@ repos: - id: detect-private-key - id: end-of-file-fixer - id: trailing-whitespace - # Using this mirror lets us use mypyc-compiled black, which is about 2x faster - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 - hooks: - - id: black - # It is recommended to specify the latest version of Python - # supported by your project here, or alternatively use - # pre-commit's default_language_version, see - # https://pre-commit.com/#top_level-default_language_version - language_version: python3.11 + # # Using this mirror lets us use mypyc-compiled black, which is about 2x faster + # - repo: https://github.com/psf/black-pre-commit-mirror + # rev: 24.4.2 + # hooks: + # - id: black + # # It is recommended to specify the latest version of Python + # # supported by your project here, or alternatively use + # # pre-commit's default_language_version, see + # # https://pre-commit.com/#top_level-default_language_version + # language_version: python3.11 - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: From 75f216cf1718e3b5ac7954b4c09c91f7c01536a7 Mon Sep 17 00:00:00 2001 From: Bodong Yang Date: Thu, 9 May 2024 15:02:25 +0000 Subject: [PATCH 7/7] enable flake8 --- .pre-commit-config.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0bb9b4be2..d79d84e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,26 +19,26 @@ repos: rev: 5.13.2 hooks: - id: isort - # - repo: https://github.com/pycqa/flake8 - # rev: 7.0.0 - # hooks: - # - id: flake8 - # additional_dependencies: - # - flake8-bugbear==24.2.6 - # - flake8-comprehensions - # - flake8-simplify + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + additional_dependencies: + - flake8-bugbear==24.2.6 + - flake8-comprehensions + - flake8-simplify # - repo: https://github.com/tox-dev/pyproject-fmt # rev: "1.8.0" # hooks: # - id: pyproject-fmt # # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version # additional_dependencies: ["tox>=4.9"] - # - repo: https://github.com/PyCQA/docformatter - # rev: v1.7.5 - # hooks: - # - id: docformatter - # additional_dependencies: [tomli] - # args: [--in-place --config ./pyproject.toml] + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.5 + hooks: + - id: docformatter + additional_dependencies: [tomli] + args: [--in-place --config ./pyproject.toml] ci: autoupdate_schedule: monthly