Skip to content

Commit 9e8ac01

Browse files
chore: bump to 2026-01-20 (#755)
1 parent a3820fe commit 9e8ac01

4 files changed

Lines changed: 113 additions & 11 deletions

File tree

Manual/BuildTools/Lake/CLI.lean

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ COMMANDS:
4141
lint lint the package using the configured lint driver
4242
check-lint check if there is a properly configured lint driver
4343
clean remove build outputs
44+
shake minimize imports in source files
4445
env <cmd> <args>... execute a command in Lake's environment
4546
lean <file> elaborate a Lean file in Lake's context
4647
update update dependencies and save them to the manifest
@@ -707,6 +708,106 @@ Builds the imports of the given {lakeMeta}`file` and then runs `lean` on it usin
707708
The `lean` process is executed in {ref "lake-environment"}[Lake's environment].
708709
:::
709710

711+
# Module Imports
712+
713+
```lakeHelp shake
714+
Minimize imports in Lean source files
715+
716+
USAGE:
717+
lake shake [OPTIONS] [<MODULE>...]
718+
719+
Checks the current project for unused imports by analyzing generated `.olean`
720+
files to deduce required imports and ensuring that every import contributes
721+
some constant or other elaboration dependency.
722+
723+
ARGUMENTS:
724+
<MODULE> A module path like `Mathlib`. All files transitively
725+
reachable from the provided module(s) will be checked.
726+
If not specified, uses the package's default targets.
727+
728+
OPTIONS:
729+
--force Skip the `lake build --no-build` sanity check
730+
--keep-implied Preserve imports implied by other imports
731+
--keep-prefix Prefer parent module imports over specific submodules
732+
--keep-public Preserve all `public` imports for API stability
733+
--add-public Add new imports as `public` if they were in the
734+
original public closure
735+
--explain Show which constants require each import
736+
--fix Apply suggested fixes directly to source files
737+
--gh-style Output in GitHub problem matcher format
738+
739+
ANNOTATIONS:
740+
Source files can contain special comments to control shake behavior:
741+
742+
* `module -- shake: keep-downstream`
743+
Preserves this module in all downstream modules
744+
745+
* `module -- shake: keep-all`
746+
Preserves all existing imports in this module
747+
748+
* `import X -- shake: keep`
749+
Preserves this specific import
750+
```
751+
752+
::::lake shake "[options...] [module ...]"
753+
754+
Checks the current project for unused imports by analyzing generated {tech}[`.olean` files] to deduce required imports, ensuring that every import contributes some constant or other elaboration dependency.
755+
756+
If a {lakeMeta}`module` is specified, then it and all files that are transitively reachable from it are checked. Otherwise, the package's {tech}[default targets] are checked.
757+
758+
:::paragraph
759+
Source files can contain special comments to control the behavior of {lake}`shake`:
760+
761+
: `module -- shake: keep-downstream`
762+
763+
Preserves this module in all downstream modules.
764+
765+
: `module -- shake: keep-all`
766+
767+
Preserves all existing imports in this module.
768+
769+
: `import X -- shake: keep`
770+
771+
Preserves this specific import.
772+
:::
773+
774+
:::paragraph
775+
The {lakeMeta}`options` may be:
776+
777+
: `--force`
778+
779+
Skip the `lake build --no-build` sanity check
780+
781+
: `--keep-implied`
782+
783+
Preserve imports implied by other imports
784+
785+
: `--keep-prefix`
786+
787+
Prefer parent module imports over specific submodules
788+
789+
: `--keep-public`
790+
791+
Preserve all `public` imports for API stability
792+
793+
: `--add-public`
794+
795+
Add new imports as `public` if they were in the original public closure
796+
797+
: `--explain`
798+
799+
Show which constants require each import
800+
801+
: `--fix`
802+
803+
Apply suggested fixes directly to source files
804+
805+
: `--gh-style`
806+
807+
Output in GitHub problem matcher format
808+
:::
809+
810+
::::
710811

711812
# Development Tools
712813

lake-manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
"inputRev": "main",
1212
"inherited": false,
1313
"configFile": "lakefile.lean"},
14-
{"url": "https://github.com/leanprover/verso.git",
14+
{"url": "https://github.com/leanprover/subverso",
1515
"type": "git",
1616
"subDir": null,
1717
"scope": "",
18-
"rev": "fc796974205ec2c188b8d17bdd4f95f35197f72b",
19-
"name": "verso",
18+
"rev": "2aa08940ec078fdf3d4c168bf60091d07ccccbfb",
19+
"name": "subverso",
2020
"manifestFile": "lake-manifest.json",
21-
"inputRev": "nightly-testing",
21+
"inputRev": "main",
2222
"inherited": false,
2323
"configFile": "lakefile.lean"},
24-
{"url": "https://github.com/leanprover/subverso",
24+
{"url": "https://github.com/leanprover/verso",
2525
"type": "git",
2626
"subDir": null,
2727
"scope": "",
28-
"rev": "7ada0eebb41eefab7c27aeaba0587cc44e0de194",
29-
"name": "subverso",
28+
"rev": "9b93b87b9301b780ab9f349f5d57586825ef48bb",
29+
"name": "verso",
3030
"manifestFile": "lake-manifest.json",
31-
"inputRev": "main",
32-
"inherited": true,
31+
"inputRev": "nightly-testing",
32+
"inherited": false,
3333
"configFile": "lakefile.lean"},
3434
{"url": "https://github.com/leanprover-community/plausible",
3535
"type": "git",

lakefile.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import Lake
88
open Lake DSL
99
open System (FilePath)
1010

11-
require verso from git "https://github.com/leanprover/verso.git"@"nightly-testing"
11+
require verso from git "https://github.com/leanprover/verso"@"nightly-testing"
12+
require subverso from git "https://github.com/leanprover/subverso"@"main"
1213
require versowebcomponents from git "https://github.com/leanprover/verso-web-components"@"main"
1314

1415
package "verso-manual" where

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:nightly-2026-01-16
1+
leanprover/lean4:nightly-2026-01-20

0 commit comments

Comments
 (0)