Skip to content

Review pylint plugins and their notes. #1354

Description

@jenstroeger

Currently there are only a handful of pylint plugins enabled

macaron/pyproject.toml

Lines 220 to 226 in f71d152

load-plugins = [
"pylint.extensions.check_elif",
"pylint.extensions.for_any_all",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.set_membership",
"pylint.extensions.typing",
]
which is a smaller subset of all available plugins.

After enabling most of these plugins (except those that are too noisy/disagreeable/not useful right now):

load-plugins = [
    "pylint.extensions.bad_builtin",
    "pylint.extensions.broad_try_clause",
    "pylint.extensions.check_elif",
    "pylint.extensions.code_style",
    "pylint.extensions.comparison_placement",
    "pylint.extensions.confusing_elif",
    "pylint.extensions.consider_refactoring_into_while_condition",
    "pylint.extensions.consider_ternary_expression",
    "pylint.extensions.dict_init_mutate",
    # "pylint.extensions.docparams",
    # "pylint.extensions.docstyle",
    "pylint.extensions.dunder",
    "pylint.extensions.empty_comment",
    "pylint.extensions.for_any_all",
    # "pylint.extensions.magic_value",
    # "pylint.extensions.mccabe",
    "pylint.extensions.no_self_use",
    "pylint.extensions.overlapping_exceptions",
    "pylint.extensions.private_import",
    "pylint.extensions.redefined_loop_name",
    "pylint.extensions.redefined_variable_type",
    "pylint.extensions.set_membership",
    "pylint.extensions.typing",
    "pylint.extensions.while_used",
]

pylint reports a long list of notes (wouldn’t want to call them “issues”) and most of which I disabled right away:

Then there is the rest, which may be worthwhile reviewing and discussing:

In addition to these standard pylint plugins, I also installed perflint and, after disabling loop-invariant-statement and dotted-import-in-loop, got the following notes regarding performance:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions