From acb0f5fd544c71718351f7665e9663896ac3694e Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Sun, 8 Dec 2019 13:01:17 +0100 Subject: [PATCH] Add a pre-commit hook to remove unneeded noqas --- .pre-commit-config.yaml | 4 ++++ scripts/commit_classifier.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b02b7c3..54fee5c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,6 +42,10 @@ repos: rev: v0.0.3 hooks: - id: taskcluster_yml +- repo: https://github.com/asottile/yesqa + rev: v0.0.11 + hooks: + - id: yesqa - repo: meta hooks: - id: check-useless-excludes diff --git a/scripts/commit_classifier.py b/scripts/commit_classifier.py index 6b26b98b..c2908b1b 100644 --- a/scripts/commit_classifier.py +++ b/scripts/commit_classifier.py @@ -52,7 +52,7 @@ LIST = r"[;,\/\\]\s*" IRC_NICK = r"[a-zA-Z0-9\-\_]+" # fmt: off -REVIEWERS_RE = re.compile( # noqa: E131 +REVIEWERS_RE = re.compile( r"([\s\(\.\[;,])" # before "r" delimiter + r"(" + SPECIFIER + r")" # flag + r"(" # capture all reviewers