Skip to content

Widen perfectionist::bare_identifier_reference scope (pacquet/pnpr) #35

Open

Description

@KSXGitHub

Context

The perfectionist dylint library was upgraded to 0.0.0-rc.21 (branch claude/perfectionist-rc21-upgrade-9rfgpq). That release ships a new active-by-default rule, perfectionist::bare_identifier_reference, which flags a backticked identifier in a doc comment that resolves in scope and suggests turning it into an intra-doc link (`Foo` → [`Foo`]).

At the default reference_scope = "crate" and min_words = 1 it fired ~416 times across the workspace — a large, churny set of doc-comment edits.

Decision

For the upgrade PR the rule is narrowed in dylint.toml to the highest-signal cases, and the residual flagged links are fixed:

["perfectionist::bare_identifier_reference"]
reference_scope = "own_module"   # only names resolving in the documenting item's own module
min_words = 2                    # skip single-word names like `Config`, `Host`

Follow-up (this issue)

Widen the scope back toward the rule's defaults as a separate pass:

  1. Relax reference_scope (e.g. to module_tree or crate) and/or lower min_words back to 1 in dylint.toml.
  2. Add the resulting intra-doc links (cargo dylint --fix applies the MachineApplicable suggestions; review the diff).
  3. Watch the interaction with clap_help_markdown: in clap-derived doc comments an intra-doc link leaks into --help, so those comments want the backticks removed, not linked. Keep the widening to non-clap doc comments, or fix the clap ones by stripping instead.

Written by an agent (Claude Code).

Activity

  1. added theissue type on Jun 29, 2026
  2. self-assigned this
    on Jun 29, 2026
  3. KSXGitHub commented on Jun 29, 2026

    @KSXGitHub
    Author
  4. KSXGitHub commented on Jun 29, 2026

    @KSXGitHub
    Author
  5. transferred this issue frompnpm/pnpmon Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions