Skip to content
This repository was archived by the owner on Oct 30, 2026. It is now read-only.

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

Closed

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

Activity

  1. erikwright commented on Mar 13, 2017

    @erikwright
    Contributor

    Agreed. If we put a linter rule in place for this can we make that rule output the keyword?

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

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