Skip to content

feat: improve error message for unknown attributes#14213

Open
0rca wants to merge 1 commit into
leanprover:masterfrom
0rca:av/4011-improve-error-message-1
Open

feat: improve error message for unknown attributes#14213
0rca wants to merge 1 commit into
leanprover:masterfrom
0rca:av/4011-improve-error-message-1

Conversation

@0rca

@0rca 0rca commented Jun 29, 2026

Copy link
Copy Markdown

This PR improves error message for unknown attributes, including labels. Instead of "unknown attribute", the message how instructs the user to define/import their attributes/labels in/from a separate file.

Closes #4011


ScreenFloat Shot of Ghostty on 2026-06-29 at 14-11-08

@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 Jun 29, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Jun 29, 2026

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 de5b7f235a71d301bffbb2dbe607ec36dd58cce7 --onto 84b251f7390c20a0a00a221050ab4a6e6c46a191. You can force Mathlib CI using the force-mathlib-ci label. (2026-06-29 06:44:33)
  • ✅ Mathlib branch lean-pr-testing-14213 has successfully built against this PR. (2026-07-05 09:40:30) View Log

@leanprover-bot

leanprover-bot commented Jun 29, 2026

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 de5b7f235a71d301bffbb2dbe607ec36dd58cce7 --onto 84b251f7390c20a0a00a221050ab4a6e6c46a191. You can force reference manual CI using the force-manual-ci label. (2026-06-29 06:44:35)
  • ✅ Reference manual branch lean-pr-testing-14213 has successfully built against this PR. (2026-07-05 08:45:24) View Log
  • 🟡 Reference manual branch lean-pr-testing-14213 build against this PR didn't complete normally. (2026-07-05 08:46:32) View Log

@0rca 0rca force-pushed the av/4011-improve-error-message-1 branch from dd050ee to 094f0cd Compare June 29, 2026 07:02
@0rca 0rca marked this pull request as ready for review June 29, 2026 07:48
@0rca 0rca changed the title feat: improve error message for unknown attributes doc: improve error message for unknown attributes Jun 29, 2026
This PR improves error message for unknown attributes, including labels.
Instead of "unknown attribute", the message how instructs the user to
import their attributes/labels from a separate file.

Closes leanprover#4011
@0rca 0rca force-pushed the av/4011-improve-error-message-1 branch from 094f0cd to 7ddf6d5 Compare July 5, 2026 08:03
@0rca 0rca changed the title doc: improve error message for unknown attributes feat: improve error message for unknown attributes Jul 5, 2026

@nomeata nomeata left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if the attribute isn't usable in the file they are defined in, can we at least recognize that an attribute has been declared, to give that message only when it actually applies? Maybe with a new non persistent newly-declared-attribute env extension?

@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 Jul 5, 2026
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Jul 5, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jul 5, 2026
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR builds-mathlib CI has verified that Mathlib builds against this PR mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN P-medium We may work on this issue if we find the time 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.

error message of register_label_attr

3 participants