Skip to content

Commit

Permalink
Add autoflake to pre-commit configuration (#9666)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Feb 11, 2022
1 parent b79eff0 commit 8afec9a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Expand Up @@ -20,6 +20,14 @@ repos:
- id: debug-statements
exclude: _pytest/(debugging|hookspec).py
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
rev: 4.0.1
hooks:
Expand Down
2 changes: 0 additions & 2 deletions src/_pytest/python.py
Expand Up @@ -905,8 +905,6 @@ class InstanceDummy:
only to ignore it; this dummy class keeps them working. This will be removed
in pytest 8."""

pass


def __getattr__(name: str) -> object:
if name == "Instance":
Expand Down
1 change: 0 additions & 1 deletion src/_pytest/python_api.py
Expand Up @@ -131,7 +131,6 @@ def _check_type(self) -> None:
# a numeric type. For this reason, the default is to do nothing. The
# classes that deal with sequences should reimplement this method to
# raise if there are any non-numeric elements in the sequence.
pass


def _recursive_list_map(f, x):
Expand Down
3 changes: 0 additions & 3 deletions testing/code/test_source.py
@@ -1,16 +1,13 @@
# flake8: noqa
# 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
import ast
import inspect
import linecache
import sys
import textwrap
from pathlib import Path
from types import CodeType
from typing import Any
from typing import Dict
from typing import Optional

import pytest
from _pytest._code import Code
Expand Down

0 comments on commit 8afec9a

Please sign in to comment.