ExplicitImports.jl icon indicating copy to clipboard operation
ExplicitImports.jl copied to clipboard

Update pre-commit hooks to native-julia

Open ericphanson opened this issue 10 months ago • 1 comments

using https://github.com/pre-commit/pre-commit/pull/3348 available with pre-commit v4.1

ericphanson avatar Feb 05 '25 22:02 ericphanson

I'm facing some issues with this:

  1. startup files are included both at install time and runtime and there doesn't seem anyway to disable it. I think we need to PR pre-commit itself to add --startup-file=no flags. xref https://github.com/fredrikekre/runic-pre-commit/issues/3. In general pre-commit's julia implementation does not seem to allow passing any args to julia itself, only the script.
  2. it seems like julia precommit hooks need to be in a different repo? like @fredrikekre's https://github.com/fredrikekre/runic-pre-commit. If I keep the hook in the repo and use additional_dependencies = ["ExplicitImports"], I get ERROR: package ExplicitImports [7d51a73a] has same name or UUID as the active project at install time. If I remove additional_dependencies, I get
 ERROR: LoadError: ArgumentError: Package ExplicitImports [7d51a73a-1435-4ff3-83d9-f097790105c7] is required but does not seem to be installed:
  - Run `Pkg.instantiate()` to install all recorded dependencies.

I think this could be addressed by pre-commit instantiating the env?

ericphanson avatar Jul 21 '25 13:07 ericphanson