Skip to content

Commit f8eda3b

Browse files
committed
Documentation for julia hooks
See pre-commit PR: pre-commit/pre-commit#3348
1 parent 0b60971 commit f8eda3b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

sections/new-hooks.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,45 @@ This language supports `additional_dependencies` so it can be used as a
330330
__Support:__ haskell hooks are known to work on any system which has `cabal`
331331
installed. It has been tested on linux, macOS, and windows.
332332
333+
### julia
334+
335+
_new in 4.1.0_
336+
337+
For configuring julia hooks, your [`entry`](#hooks-entry) should be a path to a julia source
338+
file relative to the hook repository (optionally with arguments).
339+
340+
Hooks run in an isolated package environment defined by a `Project.toml` file (optionally
341+
with a `Manifest.toml` file) in the hook repository. If no `Project.toml` file is found the
342+
hook is run in an empty environment.
343+
344+
Julia hooks support [`additional_dependencies`](#config-additional_dependencies) which can
345+
be used to augment, or override, the existing environment in the hooks repository. This also
346+
means that julia can be used as a `repo: local` hook. `additional_dependencies` are passed
347+
to `pkg> add` and should be specified using
348+
[Pkg REPL mode syntax](https://pkgdocs.julialang.org/v1/repl/#repl-add).
349+
350+
Examples:
351+
352+
```yaml
353+
- id: foo-without-args
354+
name: ...
355+
language: julia
356+
entry: bin/foo.jl
357+
- id: bar-with-args
358+
name: ...
359+
language: julia
360+
entry: bin/bar.jl --arg1 --arg2
361+
- id: baz-with-extra-deps
362+
name: ...
363+
language: julia
364+
entry: bin/baz.jl
365+
additional_dependencies:
366+
- 'ExtraDepA@1'
367+
368+
```
369+
370+
__Support:__ julia hooks are known to work on any system which has `julia` installed.
371+
333372
### lua
334373

335374
Lua hooks are installed with the version of Lua that is used by Luarocks.

0 commit comments

Comments
 (0)