-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: detect default target on runLinter #811
base: main
Are you sure you want to change the base?
feat: detect default target on runLinter #811
Conversation
128dc05
to
05c6ecd
Compare
Previously, the default behavior for `runLinter` was to lint `Batteries`. Now `runLinter` will try to detect the either the first lean_exe or first lean_lib in Lake's environment which is also a default_target
05c6ecd
to
a9fd06a
Compare
awaiting-review |
I'm a bit worried about adding a Lake import after seeing the troubles described at leanprover-community/import-graph#20 |
Hmm, this does seem like it could cause the same issue. Is there an example of a safe way to access Lake's internal API? I based this PR on this zulip thread about accessing Lake dependencies in for Mathlibs Another thought, does the fact that |
Related to this, I created a Zulip thread asking about a Lake command that would provide module and dependency information so we wouldn't have to use Lake's internals in cases such as these. (link) |
@semorrison
The problem there just appears to be that a shared library for Lake is not included in the currently Lean distro. That seems like it could be remedied relatively easily if necessary. |
@tydeu, yes please. |
FYI, a Lake shared library is now part of the standard Lean 4 release (since leanprover/lean4#5143, which is in |
@austinletson, given @tydeu's comment above, I'm now happy to proceed with this. Would you mind sorting out the merge conflict? After that we can merge. |
Mathlib CI status (docs):
|
@kim-em I have fixed the merge conflict and improved the proposed changes' readability by moving the main linting code into a new Let me know if there is anything else needed to get this merged. |
Now
runLinter
will try to detect all root modules of the default build targets of typelean_exe
orlean_lib
in Lake's environment using the sameresolveDefaultPackageTarget
function aslake build
.Closes #795