From 6593a2d7eada38ea4ae624caf945fc55a6e4939f Mon Sep 17 00:00:00 2001 From: Jason Barnett Date: Tue, 27 Dec 2022 13:15:28 -0500 Subject: [PATCH] add autoflake to .pre-commit-config.yaml to automatically remove unused imports (#1637) * add autoflake to .pre-commit-config.yaml to automatically remove unused imports * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 ++++++ kombu/utils/text.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b928a4b0..c4b21f44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,12 @@ repos: - id: pyupgrade args: ["--py37-plus"] + - repo: https://github.com/PyCQA/autoflake + rev: v2.0.0 + hooks: + - id: autoflake + args: ["--in-place", "--ignore-pass-after-docstring", "--imports"] + - repo: https://github.com/PyCQA/flake8 rev: 6.0.0 hooks: diff --git a/kombu/utils/text.py b/kombu/utils/text.py index db260b52..fea53347 100644 --- a/kombu/utils/text.py +++ b/kombu/utils/text.py @@ -5,7 +5,7 @@ from __future__ import annotations from difflib import SequenceMatcher -from typing import Iterable, Iterator, Optional, Tuple, Union +from typing import Iterable, Iterator from kombu import version_info_t