forked from pool/python-pytest-flake8
- Update to 1.3.0
* Compatible for Flake8 from version flake8>=4. (#4) * Pin to flake8<6 as it's incompatible. (#2) * Remove reference to py.builtin in tests. (#2) * Disabled the 'enabler' plugin when running tests. (#2) * Declare minimum flake8 as v5. (#1) * Adopted jaraco/skeleton for packaging. - Add patch support-pytest-9.patch: * Support pytest 9 changes. - Drop patch support-flake8-5.patch, no longer required. - Use pyproject macros. - Update URL to its new home and License.
This commit is contained in:
42
support-pytest-9.patch
Normal file
42
support-pytest-9.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
Sourced from https://github.com/OpenIndiana/oi-userland/pull/19860/commits/0d06abedf17256d1f2c89086acc05cfa53dbc647
|
||||
|
||||
https://github.com/coherent-oss/pytest-flake8/issues/5
|
||||
|
||||
--- pytest_flake8-1.3.0/pytest_flake8.py.orig
|
||||
+++ pytest_flake8-1.3.0/pytest_flake8.py
|
||||
@@ -4,6 +4,7 @@
|
||||
import re
|
||||
from contextlib import redirect_stdout, redirect_stderr
|
||||
from io import BytesIO, TextIOWrapper
|
||||
+from fnmatch import fnmatch
|
||||
|
||||
from flake8.main import application
|
||||
|
||||
@@ -59,11 +60,11 @@
|
||||
config._flake8mtimes = config.cache.get(HISTKEY, {})
|
||||
|
||||
|
||||
-def pytest_collect_file(file_path, path, parent):
|
||||
+def pytest_collect_file(file_path, parent):
|
||||
"""Filter files down to which ones should be checked."""
|
||||
config = parent.config
|
||||
if config.option.flake8 and file_path.suffix in config._flake8exts:
|
||||
- flake8ignore = config._flake8ignore(path)
|
||||
+ flake8ignore = config._flake8ignore(file_path)
|
||||
if flake8ignore is not None:
|
||||
item = Flake8File.from_parent(
|
||||
parent,
|
||||
@@ -203,7 +204,12 @@
|
||||
def __call__(self, path):
|
||||
l = [] # noqa: E741
|
||||
for glob, ignlist in self.ignores:
|
||||
- if not glob or path.fnmatch(glob):
|
||||
+ mpath = path
|
||||
+ if glob and '/' in glob:
|
||||
+ glob = "*" + glob
|
||||
+ else:
|
||||
+ mpath = str(path).split("/")[-1]
|
||||
+ if not glob or fnmatch(mpath, glob):
|
||||
if ignlist is None:
|
||||
return None
|
||||
l.extend(ignlist)
|
||||
Reference in New Issue
Block a user