Skip to content

Conversation

@JovanGerb
Copy link
Collaborator

This PR defines a linter for overlapping instances in declarations. We want to warn users about this, because it leads to local instance diamonds.

TODO

  • expand documentation
  • Ideally, the linter would be active at all times, included in the standard linter set, and it should also be able to fire on partial declarations, since it only works with the type of the declaration.

Open in Gitpod

@JovanGerb JovanGerb marked this pull request as draft January 6, 2026 18:38
@github-actions github-actions bot added the t-linter Linter label Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

PR summary 959c85291a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Tactic 1
Mathlib.Tactic.Linter.OverlappingInstances (new file) 28

Declarations diff

+ findDuplicateDataInstances
+ overlappingInstances

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).


public meta section

/-- Given an instance `e`, conpute return all data carrying classes that are
Copy link
Collaborator

Choose a reason for hiding this comment

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

"conpute return" should be "compute and return"?

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

Labels

t-linter Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants