From 841dddac013590d1d1e3bc054f5c206b4075fa64 Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Wed, 17 Jul 2024 23:39:05 +0800 Subject: [PATCH] Update deprecated autoflake hook As stated in https://github.com/humitos/mirrors-autoflake/blob/master/README.md, DO NOT USE THIS REPOSITORY. There is an official version now at https://github.com/PyCQA/autoflake/blob/master/.pre-commit-hooks.yaml. There are some errors when using this deprecated hook under Python 3.12, such as Traceback (most recent call last): File "/home/fanta/.cache/pre-commit/repoo2mq6vmn/py_env-python3.12/bin/autoflake", line 5, in from autoflake import main File "/home/fanta/.cache/pre-commit/repoo2mq6vmn/py_env-python3.12/lib/python3.12/site-packages/autoflake.py", line 32, in import distutils.sysconfig ModuleNotFoundError: No module named 'distutils' --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0971e859..4c746bd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - - repo: https://github.com/humitos/mirrors-autoflake - rev: v1.1 + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 hooks: - id: autoflake args: ["-i", "--remove-all-unused-imports"]