Skip to content

feat: add linter.redundantExpose for redundant @[expose]/@[no_expose] attributes#13359

Draft
Kha wants to merge 1 commit intoleanprover:masterfrom
Kha:push-otktnsnmrruv
Draft

feat: add linter.redundantExpose for redundant @[expose]/@[no_expose] attributes#13359
Kha wants to merge 1 commit intoleanprover:masterfrom
Kha:push-otktnsnmrruv

Conversation

@Kha
Copy link
Copy Markdown
Member

@Kha Kha commented Apr 10, 2026

This PR adds a linter.redundantExpose option (default true) that warns when @[expose] or @[no_expose] attributes have no effect:

  • @[expose] on abbrev (always exposed) or non-Prop instance (always exposed)
  • @[expose] on a def inside an @[expose] section (already exposed by the section)
  • @[expose]/@[no_expose] in a non-module file (no module system)
  • @[no_expose] on a declaration that wouldn't be exposed by default

…pose]` attributes

This PR adds a `linter.redundantExpose` option (default `true`) that warns
when `@[expose]` or `@[no_expose]` attributes have no effect:

- `@[expose]` on `abbrev` (always exposed) or non-Prop `instance` (always
  exposed)
- `@[expose]` on a `def` inside an `@[expose] section` (already exposed by
  the section)
- `@[expose]`/`@[no_expose]` in a non-`module` file (no module system)
- `@[no_expose]` on a declaration that wouldn't be exposed by default

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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 Apr 10, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-07 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-10 14:56:41)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 10, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 10, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 10, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Apr 10, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN 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