From 18cd32e85e003857caaf0769dd9f5ed4ccb9136e Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 22 Feb 2022 16:10:55 +0100 Subject: [PATCH 1/2] disable ufmt pre-commit hook --- .pre-commit-config.yaml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d4e9d2e337a..f216bf20473 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,20 +10,14 @@ repos: args: [--fix=lf] - id: end-of-file-fixer - # - repo: https://github.com/asottile/pyupgrade - # rev: v2.29.0 - # hooks: - # - id: pyupgrade - # args: [--py37-plus] - # name: Upgrade code - - - repo: https://github.com/omnilib/ufmt - rev: v1.3.0 - hooks: - - id: ufmt - additional_dependencies: - - black == 21.9b0 - - usort == 0.6.4 +# TODO: re-enable after https://github.com/omnilib/ufmt/issues/56 is resolved +# - repo: https://github.com/omnilib/ufmt +# rev: v1.3.0 +# hooks: +# - id: ufmt +# additional_dependencies: +# - black == 21.9b0 +# - usort == 0.6.4 - repo: https://gitlab.com/pycqa/flake8 rev: 3.9.2 From 6c41e4beaf08647b6fa17e5429b6ba8ba894b0f4 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 22 Feb 2022 16:31:39 +0100 Subject: [PATCH 2/2] run ufmt outside of pre-commit --- .circleci/config.yml | 6 ++++-- .circleci/config.yml.in | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69d9764ab78..b7700610196 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,14 +260,16 @@ jobs: steps: - checkout - pip_install: - args: pre-commit + args: pre-commit ufmt==1.3.0 black==21.9b0 usort==0.6.4 descr: Install lint utilities - run: name: Install pre-commit hooks command: pre-commit install-hooks - run: name: Lint Python code and config files - command: pre-commit run --all-files + command: | + ufmt format . + pre-commit run --all-files - run: name: Required lint modifications when: on_fail diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 4bd2e14147a..b37fcaa1e55 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -260,14 +260,16 @@ jobs: steps: - checkout - pip_install: - args: pre-commit + args: pre-commit ufmt==1.3.0 black==21.9b0 usort==0.6.4 descr: Install lint utilities - run: name: Install pre-commit hooks command: pre-commit install-hooks - run: name: Lint Python code and config files - command: pre-commit run --all-files + command: | + ufmt format . + pre-commit run --all-files - run: name: Required lint modifications when: on_fail