lean4-htt/src/Lean/Meta/Constructions
Sebastian Ullrich 2b8c273687
feat: add linter.redundantVisibility for redundant private/public modifiers (#13132)
This PR adds a `linter.redundantVisibility` option (default `true`) that
warns
when a visibility modifier has no effect because it matches the default
for the
current context:

- `private` outside a `public section` in a `module` file, where
declarations
  are already module-scoped by default
- `public` in a non-`module` file or inside a `public section`, where
  declarations are already public by default

The check is integrated directly into `elabModifiers` so it covers all
declaration types uniformly.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 08:34:20 +00:00
..
BRecOn.lean feat: add linter.redundantVisibility for redundant private/public modifiers (#13132) 2026-04-13 08:34:20 +00:00
CasesOn.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
CasesOnSameCtor.lean perf: handle match_same_ctor.het similar to matchers in compiler (#12850) 2026-03-09 22:02:06 +00:00
CtorElim.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
CtorIdx.lean feat: stricter meta check for temporary programs in native_decide etc (#13005) 2026-03-20 15:51:18 +00:00
NoConfusion.lean chore: shake core (#12276) 2026-02-05 09:10:32 +00:00
RecOn.lean chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
SparseCasesOn.lean feat: add linter.redundantVisibility for redundant private/public modifiers (#13132) 2026-04-13 08:34:20 +00:00
SparseCasesOnEq.lean feat: add linter.redundantVisibility for redundant private/public modifiers (#13132) 2026-04-13 08:34:20 +00:00