From 0e459e79ea5c4f3ea9d627173e913563bed0d5d2 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 1 Nov 2024 15:36:18 +0100 Subject: [PATCH] Documentation for julia hooks See pre-commit PR: https://github.com/pre-commit/pre-commit/pull/3348 --- sections/new-hooks.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index a1f5604e..64700932 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -330,6 +330,37 @@ This language supports `additional_dependencies` so it can be used as a __Support:__ haskell hooks are known to work on any system which has `cabal` installed. It has been tested on linux, macOS, and windows. +### julia + +_new in 4.x.0_ + +The hook repository must contain a `Project.toml` file and optionally a `Manifest.toml` +file. Hooks will run in this environment. + +For configuring julia hooks, your [`entry`](#hooks-entry) should be a path to a julia source +file relative to the hook repository (optionally with arguments). + +For example: + +```yaml +- id: foo-without-args + name: ... + language: julia + entry: bin/foo.jl +- id: bar-with-args + name: ... + language: julia + entry: bin/bar.jl --arg1 --arg2 +``` + +This language supports `additional_dependencies` so it can be used as a `repo: local` hook. +`additional_dependencies` are passed to `pkg> add` and should be specified using +[Pkg REPL mode syntax](https://pkgdocs.julialang.org/v1/repl/#repl-add). +Note that `additional_dependencies` can be used to override package versions in the +`Project.toml` file of the hook repository. + +__Support:__ julia hooks are known to work on any system which has `julia` installed. + ### lua Lua hooks are installed with the version of Lua that is used by Luarocks.