Skip to content

[Merged by Bors] - chore: avoid redundant error message in differential geometry elaborators#34527

Closed
grunweg wants to merge 3 commits intoleanprover-community:masterfrom
grunweg:better-errors
Closed

[Merged by Bors] - chore: avoid redundant error message in differential geometry elaborators#34527
grunweg wants to merge 3 commits intoleanprover-community:masterfrom
grunweg:better-errors

Conversation

@grunweg
Copy link
Copy Markdown
Contributor

@grunweg grunweg commented Jan 28, 2026

When a tracing option is already set, we don't need to tell the user about it. Follow-up to #30744.


My main question is if there's a better way to do this, e.g. doing only one check instead of two.

Open in Gitpod

@grunweg grunweg added WIP Work in progress t-meta Tactics, attributes or user commands and removed WIP Work in progress labels Jan 28, 2026
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jan 28, 2026

@adomani @Vierkantor This is a linter API question; perhaps you know a nice trick here. (Perhaps there already is some API for "check if this option is already enabled, and only add a hint about it if not enabled" that I can use.)

@github-actions github-actions bot added the t-differential-geometry Manifolds etc label Jan 28, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 28, 2026

PR summary 7cccd8a4ca

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Jan 28, 2026
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

This PR/issue depends on:

@adomani
Copy link
Copy Markdown
Contributor

adomani commented Jan 28, 2026

I am not sure whether the issue is that you are using get twice? I think that NameMaps (on which Options should be based) have a filter operation, but I don't think that they have another Bool-valued predicate. I honestly think that this is fairly well optimised and probably the cost of the two gets might even be less than filtering the whole Options.

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jan 28, 2026

I guess my question was "is there an incantation which checks both options at once" --- given that these are tracing options, so set_option trace.Elab.DiffGeo true implies trace.Elab.DiffGeo.MDiff. I think I found the right API, and just pushed a commit to this effect.

Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thanks!

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 29, 2026

✌️ grunweg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jan 29, 2026
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jan 29, 2026

Thanks for the quick review!
bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jan 29, 2026
mathlib-bors bot pushed a commit that referenced this pull request Jan 29, 2026
…tors (#34527)

When a tracing option is already set, we don't need to tell the user about it. Follow-up to #30744.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 29, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore: avoid redundant error message in differential geometry elaborators [Merged by Bors] - chore: avoid redundant error message in differential geometry elaborators Jan 29, 2026
@mathlib-bors mathlib-bors bot closed this Jan 29, 2026
YellPika pushed a commit to YellPika/mathlib4 that referenced this pull request Feb 3, 2026
…tors (leanprover-community#34527)

When a tracing option is already set, we don't need to tell the user about it. Follow-up to leanprover-community#30744.
Maldooor pushed a commit to Maldooor/mathlib4 that referenced this pull request Feb 25, 2026
…tors (leanprover-community#34527)

When a tracing option is already set, we don't need to tell the user about it. Follow-up to leanprover-community#30744.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-differential-geometry Manifolds etc t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants