Skip to content

PYLINT_FLAGS loads a plugin that does not exist, so compare-to-empty-string never runs #767

Description

@JarryShaw

Describe the bug

PYLINT_FLAGS loads pylint.extensions.emptystring, which does not exist in the installed pylint.
The --load-plugins= entry fails, and --enable=compare-to-empty-string — the check that plugin
exists to provide — is therefore inert. It has never run.

Reproduction

$ python -c "import importlib.util as u, pylint; print(pylint.__version__); \
print(u.find_spec('pylint.extensions.emptystring'))"
4.0.8
None

pylint reports it every run, as a non-file message:

Command line or configuration file:1:0: E0013: Plugin 'pylint.extensions.emptystring' is impossible
to load, is it installed ? ('No module named 'pylint.extensions.emptystring'') (bad-plugin-value)

The other three plugins (check_elif, docstyle, overlapping_exceptions) are present.

Expected behavior

Either compare-to-empty-string runs, or the flags stop asking for it. A silently inert check is
worse than an absent one, because the flag list reads as though the project enforces it.

Additional context

Two consequences beyond the dead check. It is a fifth stale PYLINT_FLAGS entry alongside the
four already known (eq-without-hash → W0012, and old-division / no-absolute-import /
input-builtin → R0022). And it is class E, so it inflates the error count by one: file-scoped
E is 90, while the raw count is 91. pylint's own messageTypeCount agrees at
error: 90, warning: 4765, refactor: 642, convention: 542.

That last part matters for #753 — any pinned E figure has to state whether it includes this message.
Found in the cross-review of #761.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    ciPull requests that change CI or workflow configuration (ci: subject prefix)
    on Sep 25, 2026
  2. JarryShaw commented on Sep 25, 2026

    @JarryShaw
    OwnerAuthor

    Correcting this issue: its central claim is wrong, and it is my error. The check has not "never run".

    --enable=compare-to-empty-string resolves through an old_names alias to use-implicit-booleaness-not-comparison-to-string (C1804) in pylint's core refactoring checker, which loads regardless of the failed plugin. Measured under the old, unmodified flag set:

    $ pylint <OLD PYLINT_FLAGS, broken plugin included> --list-msgs-enabled | grep C1804
      use-implicit-booleaness-not-comparison-to-string (C1804)

    A full --list-msgs-enabled diff between the old and new flag sets is identical — 399 lines each, diff exit 0. So dropping the dead plugin is a pure no-op on message selection. The check was enabled and running the whole time; it simply fires zero times across pcapkit/.

    What is actually true here, and worth keeping:

    • pylint.extensions.emptystring is genuinely absent from pylint 4.0.8, so --load-plugins= fails every run and emits E0013 bad-plugin-value. That is real but narrow: one non-file message, inflating the raw error count by one (91 vs the file-scoped 90).
    • The flag list carries four more entries that resolve to nothing: old-division, no-absolute-import and input-builtin were deleted from pylint (R0022), and eq-without-hash emits W0012.

    One more of my characterisations was wrong. I called eq-without-hash stale alongside the three deleted ones. It is not — the check is live as W1641, merely moved to an extension:

    $ python -c "import importlib.util as u; print(u.find_spec('pylint.extensions.eq_without_hash'))"
    <ModuleSpec name='pylint.extensions.eq_without_hash' ...>     # PRESENT
    $ python -c "import importlib.util as u; print(u.find_spec('pylint.extensions.emptystring'))"
    None                                                          # MISSING

    So eq-without-hash is inert only because that extension is not loaded — exactly the distinction that applies to emptystring, and the opposite of "removed". Its impact today is nil (W1641 count over pcapkit/ is 0), but whether to load that extension is now an open question rather than a settled cleanup.

    So the issue stands as flag hygiene plus one E0013, not as a check that never ran. #773 fixes the hygiene correctly; only the rationale needs restating.

  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Sep 25, 2026
  4. added 5 commits that reference this issue on Sep 25, 2026
    f31e511
    f29df2c
    4976665
    67035d9
    ce21ace
  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Sep 25, 2026
  6. added this to the 1.5 milestone on Oct 6, 2026
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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)ciPull requests that change CI or workflow configuration (ci: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions