Skip to content

chore: unexpose public sections with no defs#41564

Open
felixpernegger wants to merge 1 commit into
leanprover-community:masterfrom
felixpernegger:unusedexposed
Open

chore: unexpose public sections with no defs#41564
felixpernegger wants to merge 1 commit into
leanprover-community:masterfrom
felixpernegger:unusedexposed

Conversation

@felixpernegger

Copy link
Copy Markdown
Contributor

This PR remove @[expose] from public sections when there are no (irredcible_)def's inside the section anyways, so there is no reason to expose the section (does not make a difference).


Open in Gitpod

@github-actions github-actions Bot added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

PR summary 676f0a2078

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

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

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 676f0a2).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.

Decrease in weak tech debt: (relative, absolute) = (147.00, 0.03)
Current number Change Type (weak)
4860 -147 exposed public sections

Current commit 676f0a2078
Reference commit a33a5ccd63

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@themathqueen

Copy link
Copy Markdown
Collaborator

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

@felixpernegger

Copy link
Copy Markdown
Contributor Author

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

I thought its discouraged since its tracked as weak tech debt?

@grunweg

grunweg commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

I don't think there's consensus on whether we should make things @[expose] public section or not (regardless whether there may be definitions or not). I think it's just author's choice for now?

For files with definitions, I agree it's author's choice. I'm not so convinced for files without definitions...
but then files without definitions may gain some in the future. Hm.

@themathqueen

themathqueen commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

To be fair, most files with @[expose] public section were added when we transferred to the module system. So the authors didn't really have a say in it

So, I guess removing them is just as fair play? Maybe?

@felixpernegger

Copy link
Copy Markdown
Contributor Author

I guess the larger issue at hand why we have so many exposed public sections, is because in 95% of definitions in math you want to know whats underneath.

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

Labels

tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants