From b952fc624648702e04bdd7fb49662345724ebe7a Mon Sep 17 00:00:00 2001 From: Filip Ratajczak <90644163+Tesla2000@users.noreply.github.com> Date: Sun, 27 Apr 2025 14:04:47 +0200 Subject: [PATCH] Update .pre-commit-config.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello, I saw that you raised an issue regarding reorder-python-imports not being compatible with the current version of Black (https://github.com/asottile/reorder-python-imports/issues/388). Since the author has been unwilling to accept changes, I decided to publish a compatible version in the spirit of open source. To ensure full compatibility, you’ll need to set the --retain-pre-import flag. Otherwise, it works exactly the same as the original implementation. --- .pre-commit-config.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee9e95d..d806f41 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,10 +15,15 @@ repos: - id: requirements-txt-fixer - id: mixed-line-ending args: [ '--fix=auto' ] - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.9.0 + - repo: https://github.com/Tesla2000/black-compatible-reorder-python-imports + rev: v0.0.1 hooks: - id: reorder-python-imports + args: + [ + --retain-pre-import, + 'True', + ] - repo: https://github.com/myint/autoflake rev: v2.0.0 hooks: