From 85bc9ca9541e83ba6f171edc60daec9503054633 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 28 Apr 2024 17:03:52 +0300 Subject: [PATCH 1/3] pre-commit: remove deprecated `fix-encoding-pragma` hook Deprecated by pre-commit. --- .pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a80edd28c..d54c08136 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,8 +10,6 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer - - id: fix-encoding-pragma - args: [--remove] - id: check-yaml - id: debug-statements exclude: _pytest/(debugging|hookspec).py From e847b2a5a99d8d9af77c23c625cdb6121c04ad31 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 28 Apr 2024 17:04:27 +0300 Subject: [PATCH 2/3] pre-commit: replace `debug-statements` hook with ruff Ruff supports this functionality so we can use it. --- .pre-commit-config.yaml | 3 --- pyproject.toml | 1 + src/_pytest/debugging.py | 1 + src/_pytest/hookspec.py | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d54c08136..0225a6a22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,9 +11,6 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - - id: debug-statements - exclude: _pytest/(debugging|hookspec).py - language_version: python3 - repo: https://github.com/adamchainz/blacken-docs rev: 1.16.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 43efacf09..2be02ee7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,7 @@ select = [ "PLE", # pylint error "PLW", # pylint warning "PLR1714", # Consider merging multiple comparisons + "T100", # flake8-debugger ] ignore = [ # bugbear ignore diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 6ed0c5c7a..7beab563e 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -1,4 +1,5 @@ # mypy: allow-untyped-defs +# ruff: noqa: T100 """Interactive debugging with PDB, the Python Debugger.""" import argparse diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index acfe7eb95..01d3b6640 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -1,4 +1,5 @@ # mypy: allow-untyped-defs +# ruff: noqa: T100 """Hook specifications for pytest plugins which are invoked by pytest itself and by builtin plugins.""" From 940b78232e48c34501cfe6e0bfd0ea6d64f4521b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 28 Apr 2024 17:11:11 +0300 Subject: [PATCH 3/3] pre-commit: fix misleading indentation --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0225a6a22..6cebeeb46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,13 +45,13 @@ repos: additional_dependencies: ["tox>=4.9"] - repo: local hooks: - - id: pylint - name: pylint - entry: pylint - language: system - types: [python] - args: ["-rn", "-sn", "--fail-on=I"] - stages: [manual] + - id: pylint + name: pylint + entry: pylint + language: system + types: [python] + args: ["-rn", "-sn", "--fail-on=I"] + stages: [manual] - id: rst name: rst entry: rst-lint --encoding utf-8