Skip to content

refactor: turn dupNamespace into a Lean.Linter#13708

Merged
wkrozowski merged 1 commit into
leanprover:masterfrom
wkrozowski:dupNamespace-linter
May 12, 2026
Merged

refactor: turn dupNamespace into a Lean.Linter#13708
wkrozowski merged 1 commit into
leanprover:masterfrom
wkrozowski:dupNamespace-linter

Conversation

@wkrozowski
Copy link
Copy Markdown
Contributor

@wkrozowski wkrozowski commented May 11, 2026

This PR moves the dupNamespace linter from the EnvLinter framework to the Lean.Linter (text linter) framework, upstreaming the code from mathlib.

This PR moves the `dupNamespace` linter from the `EnvLinter` framework to
the `Lean.Linter` (text linter) framework, matching how it is implemented
in mathlib and batteries. The linter remains off-by-default and fires under
`linter.extra` (or when explicitly enabled), so user-facing behavior is
unchanged: namespaces duplicated consecutively in a declaration name still
trigger a warning under `--extra`/`--lint-all`/`--lint-only dupNamespace`.

The new implementation lives under `Lean.Linter.Extra.DupNamespace` and
inspects declaration names harvested from `declRangeExt`, plus the alias
names introduced by `export` statements.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wkrozowski wkrozowski added changelog-other changelog-no Do not include this PR in the release changelog lake-ci Run all Lake tests and removed changelog-other labels May 11, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 11, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 48ad8401cd5624c944890893a38057ae4920e8ef --onto a71f158f7bd96ff9ea846f7ff4cc658de3c8b0f9. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-11 16:51:34)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 48ad8401cd5624c944890893a38057ae4920e8ef --onto a71f158f7bd96ff9ea846f7ff4cc658de3c8b0f9. You can force reference manual CI using the force-manual-ci label. (2026-05-11 16:51:36)

@wkrozowski wkrozowski added this pull request to the merge queue May 12, 2026
Merged via the queue into leanprover:master with commit c04a83a May 12, 2026
45 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-no Do not include this PR in the release changelog lake-ci Run all Lake tests toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants