Skip to content

Linter rules should be disabled by message name not message code #32

@cfournie

Description

@cfournie

To help code reviewers understand why a linter rule should be disabled for a line of code, the message name (e.g. unused-import) should be disabled as opposed to the code (e.g. W0611) so that reviewers don't need to look up each rule, e.g.

import typing  # pylint: disable=unused-import

For the above import a reviewer could guess that it was likely disabled because it is used in a Python2-style type annotation comment and then they can look for its inclusion in a comment, whereas the following doesn't afford a reviewer much of a clue unless they've memorized the message code format/categories/look up the message code:

import typing  # pylint: disable=W0611

Metadata

Metadata

Assignees

No one assigned

    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