flake8-eradicate
flake8-eradicate copied to clipboard
False Positives | Markdown in block strings
Hello the following code is now getting flagged as E800 Found commented out code
This has only just started getting flagged with the upgrade from 1.0.0
-> 1.1.0
Example code:
MARKDOWN = """
# {variable_containing_header_one}
Lots of content here...
"""
@RayOconnor please, feel free to submit a fix!
I was just about to submit a similar false-positive but with docstrings (that is essentially the same I suppose). In my case, it's not Markdown but an example TOML config as a part of the docstring: https://github.com/ansible/pylibssh/blob/devel/bin/pep517_backend/_backend.py#L79.
def get_config():
"""Grab optional build dependencies from pyproject.toml config.
:returns: config section from ``pyproject.toml``
:rtype: dict
This basically reads entries from::
[tool.local.cythonize]
# Env vars provisioned during cythonize call
src = ["src/**/*.pyx"]
[tool.local.cythonize.env]
# Env vars provisioned during cythonize call
LDFLAGS = "-lssh"
[tool.local.cythonize.flags]
# This section can contain the following booleans:
# * annotate — generate annotated HTML page for source files
# * build — build extension modules using distutils
# * inplace — build extension modules in place using distutils (implies -b)
# * force — force recompilation
# * quiet — be less verbose during compilation
# * lenient — increase Python compat by ignoring some compile time errors
# * keep-going — compile as much as possible, ignore compilation failures
annotate = false
build = false
inplace = true
force = true
quiet = false
lenient = false
keep-going = false
[tool.local.cythonize.kwargs]
# This section can contain args tha have values:
# * exclude=PATTERN exclude certain file patterns from the compilation
# * parallel=N run builds in N parallel jobs (default: calculated per system)
exclude = "**.py"
parallel = 12
[tool.local.cythonize.kwargs.directives]
# This section can contain compiler directives
# NAME = "VALUE"
"""
# NAME = "VALUE"
is what eradicate complains about but shouldn't.
Does this happen with raw eradicate
? Or is it specific to flake8-eradicate
?
No idea, I haven't had a chance to check but wanted to comment here so that it's not totally forgotten.
Sorry, I cannot reproduce.
Both eradicate
and flake8-eradicate
are fine with both examples.