Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False Positives | Markdown in block strings #215

Open
RayOconnor opened this issue Jun 28, 2021 · 5 comments
Open

False Positives | Markdown in block strings #215

RayOconnor opened this issue Jun 28, 2021 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@RayOconnor
Copy link

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...
"""
@sobolevn
Copy link
Member

@RayOconnor please, feel free to submit a fix!

@sobolevn sobolevn added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Jun 28, 2021
@webknjaz
Copy link

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.

@sobolevn
Copy link
Member

Does this happen with raw eradicate? Or is it specific to flake8-eradicate?

@webknjaz
Copy link

No idea, I haven't had a chance to check but wanted to comment here so that it's not totally forgotten.

@sobolevn
Copy link
Member

Sorry, I cannot reproduce.

Both eradicate and flake8-eradicate are fine with both examples.
Снимок экрана 2021-10-21 в 10 56 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants