From 899a6cf2cef5f74e7f85fb22ec3449fbd57a5aae Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 29 Jan 2024 21:54:52 -0300 Subject: [PATCH] Replace reorder-python-imports by isort due to black incompatibility Unfortunately black and reorder-python-imports are no longer compatible, and from the looks of it probably will not be compatible anytime soon: https://github.com/asottile/reorder-python-imports/issues/367 https://github.com/asottile/reorder-python-imports/issues/366 https://github.com/psf/black/issues/4175 This replaces `reorder-python-imports` by `isort` configured in a way to yield roughtly the same results. Closes #11885 --- .pre-commit-config.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26ca339b961..244fe48e052 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black args: [--safe, --quiet] @@ -36,11 +36,12 @@ repos: additional_dependencies: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 -- repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 +- repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports - args: ['--application-directories=.:src', --py38-plus] + - id: isort + name: isort + args: [--force-single-line, --profile=black] - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: