Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Diagnostics should respect # noqa and similar comments #264

Description

ptvsd uses # noqa to disable linting for specific lines, for example:

try:
    unicode  # noqa

    def needs_unicode(value):
        return isinstance(value, unicode)  # noqa
except Exception:
    def needs_unicode(value):
        return False

Any diagnostics we output should respect comments like these. I believe there are other ones out there depending on the linter, like #pylint: disable and # NOQA.

Activity

  1. jfthuong commented on Mar 26, 2019

    @jfthuong

    Linting could be also disabled for a particular warning.

    For example, pylint has the following way of locally disabling a warning:

    4.1 Is it possible to locally disable a particular message?
        Yes, this feature has been added in Pylint 0.11. 
        This may be done by adding “#pylint: disable=some-message,another-one”
        at the desired block level or at the end of the desired line of code.
    
  2. janosh commented on Jul 1, 2019

    @janosh

    This feature would be great to have!

    For the record, # noqa also supports disabling specific warnings with # noqa: E731. python-language-server could support that as well.

  3. jakebailey commented on Jul 12, 2019

    @jakebailey
    MemberAuthor

    Partial support for this will come in #1272 (catch-all noqa), but we'll need mappings from other tools' codes in order to go further.

  4. MikhailArkhipov commented on Jul 23, 2019

    @MikhailArkhipov

    #1272 adds basic support. New issue will be opened for more advanced cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions