[7.0.x] Add autoflake to pre-commit configuration

This commit is contained in:
Bruno Oliveira 2022-02-11 14:34:02 -03:00 committed by pytest bot
parent 591d476f14
commit 057a057d4a
4 changed files with 8 additions and 6 deletions

View File

@ -20,6 +20,14 @@ repos:
- id: debug-statements - id: debug-statements
exclude: _pytest/(debugging|hookspec).py exclude: _pytest/(debugging|hookspec).py
language_version: python3 language_version: python3
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
name: autoflake
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
language: python
files: \.py$
- repo: https://github.com/PyCQA/flake8 - repo: https://github.com/PyCQA/flake8
rev: 4.0.1 rev: 4.0.1
hooks: hooks:

View File

@ -896,8 +896,6 @@ class InstanceDummy:
only to ignore it; this dummy class keeps them working. This will be removed only to ignore it; this dummy class keeps them working. This will be removed
in pytest 8.""" in pytest 8."""
pass
# Note: module __getattr__ only works on Python>=3.7. Unfortunately # Note: module __getattr__ only works on Python>=3.7. Unfortunately
# we can't provide this deprecation warning on Python 3.6. # we can't provide this deprecation warning on Python 3.6.

View File

@ -131,7 +131,6 @@ class ApproxBase:
# a numeric type. For this reason, the default is to do nothing. The # a numeric type. For this reason, the default is to do nothing. The
# classes that deal with sequences should reimplement this method to # classes that deal with sequences should reimplement this method to
# raise if there are any non-numeric elements in the sequence. # raise if there are any non-numeric elements in the sequence.
pass
def _recursive_list_map(f, x): def _recursive_list_map(f, x):

View File

@ -1,16 +1,13 @@
# flake8: noqa # flake8: noqa
# disable flake check on this file because some constructs are strange # disable flake check on this file because some constructs are strange
# or redundant on purpose and can't be disable on a line-by-line basis # or redundant on purpose and can't be disable on a line-by-line basis
import ast
import inspect import inspect
import linecache import linecache
import sys import sys
import textwrap import textwrap
from pathlib import Path from pathlib import Path
from types import CodeType
from typing import Any from typing import Any
from typing import Dict from typing import Dict
from typing import Optional
import pytest import pytest
from _pytest._code import Code from _pytest._code import Code