Repository navigation
chore: add newline between public and private imports - #42063
felixpernegger wants to merge 8 commits into
Conversation
PR summary 933477989a
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.Tactic.PNatToNat | 612 | 613 | +1 (+0.16%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.Tactic.PNatToNat |
1 |
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
9334779).
- +0 new declarations
- −0 removed declarations
No declaration differences.
No changes to strong technical debt.
No changes to weak technical debt.
Current commit 933477989a
Reference commit bb1587137f
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.py pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
This pull request is now in draft mode. No active bors state needed cleanup. While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like |
|
Please no slowdown |
|
Benchmark results for dd2637b against 0434c03 are in. No significant results found. @felixpernegger
No significant changes detected. |
Similar (motivation) to #42063. This PR removes all newlines between public imports. This is not important as standalone PR, but makes diffs of later PRs nicer and thus help reviewing. This includes space between ordinary public and `public meta` imports (and imports from Lean core). Maybe there should be a convention on there to be a newline for those cases, but this is not currently done in the vast majority of cases and not the scope of this PR. Also some import orders of affected files are not ordered alphabetically still, which I did not fix as this is again not the goal of this PR. Co-authored-by: Batixx <s59fpern@uni-bonn.de>
|
This pull request has conflicts, please merge |
I'm not sure having a new line between imports is a rule we have. But I'm for having |
I think this has been mentioned on Zulip here and there, originally here #mathlib4 > Mathlib has moved to the new module system @ 💬. It is also a bit more common to have an emptyline (Regex public import.+\n\nimport gives 198 occurences vs public import.+\nimport giving 138) and has recently been discussed here #mathlib4 > Technical Debt Counters @ 💬. (Though I cant find the PR Yael is refering to) |
Similar (motivation) to leanprover-community#42063. This PR removes all newlines between public imports. This is not important as standalone PR, but makes diffs of later PRs nicer and thus help reviewing. This includes space between ordinary public and `public meta` imports (and imports from Lean core). Maybe there should be a convention on there to be a newline for those cases, but this is not currently done in the vast majority of cases and not the scope of this PR. Also some import orders of affected files are not ordered alphabetically still, which I did not fix as this is again not the goal of this PR. Co-authored-by: Batixx <s59fpern@uni-bonn.de>
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
# Conflicts: # Mathlib/Control/Monad/Cont.lean # Mathlib/Data/Fintype/Parity.lean # Mathlib/Data/List/Lookmap.lean # Mathlib/Data/List/ModifyLast.lean # Mathlib/Data/List/Sort.lean # Mathlib/Lean/Meta/RefinedDiscrTree/Encode.lean # Mathlib/LinearAlgebra/QuadraticForm/Complex.lean # Mathlib/Tactic/FieldSimp/Discharger.lean
|
This pull request has conflicts, please merge |
|
This pull request has conflicts, please merge |
|
Superseded by #44512, which groups public and private imports in 2,076 Mathlib files and has passed a full local Mathlib build. |
Group public imports before private imports, with a blank line between the groups, in 2,076 Mathlib files. Preserve the order within each group, import modifiers, and comments. No imports are removed or have their visibility changed. Generated using the formatter in #44503. This is a source-only cleanup and can merge independently of the linter implementation. Supersedes #42063.
It is (or at least seems to be) convention to make a new line between public imports and private import (and public imports should come first). This PR adds those missing newlines.
Sometimes public imports were (mistakenly?) added after private imports. This PR fixes this as well and orders the imports of affected lines alphabetically.
As a standalone PR, this is pretty unimportant, but ought to make the diffs (and thus reviewing) of later PRs sorting imports etc prettier