From 543a59f8e13b2d55773798e426b9c231cdee1275 Mon Sep 17 00:00:00 2001 From: Damon Bayer Date: Tue, 12 May 2026 15:35:45 -0500 Subject: [PATCH 1/2] add julia --- Dockerfile | 15 +++++++++++++++ bin/_info | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/Dockerfile b/Dockerfile index be5a049..d0425a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -202,6 +202,21 @@ RUN : \ && rm /tmp/dart.zip \ && : +ARG JULIA=1.12.6 +ARG JULIA_SHA256=bbabf3bef19421a9dbd24a767d807606ab85e444323b5a1c73ffe293fa3d079a +ENV \ + PATH=/opt/julia/bin:$PATH \ + JULIA_DEPOT_PATH=/pc/julia_depot +RUN : \ + && echo 'lang: julia' \ + && julia_minor="${JULIA%.*}" \ + && curl --silent --location --output /tmp/julia.tgz "https://julialang-s3.julialang.org/bin/linux/x64/${julia_minor}/julia-${JULIA}-linux-x86_64.tar.gz" \ + && echo "${JULIA_SHA256} /tmp/julia.tgz" | sha256sum --check \ + && mkdir /opt/julia \ + && tar --strip-components=1 --directory /opt/julia -xf /tmp/julia.tgz \ + && rm /tmp/julia.tgz \ + && : + ENV \ PATH=/opt/r/bin/:$PATH \ RENV_CONFIG_CACHE_ENABLED=false \ diff --git a/bin/_info b/bin/_info index 1bb5d50..a426512 100755 --- a/bin/_info +++ b/bin/_info @@ -89,6 +89,12 @@ def main() -> int: _call('go', 'version') print() + print('## julia') + print() + with _console(): + _call('julia', '--version') + print() + print('## lua') print() with _console(): From 9ec5dbd56e2c8b6a05f846083d5e19241ed18697 Mon Sep 17 00:00:00 2001 From: Damon Bayer Date: Mon, 18 May 2026 11:59:30 -0500 Subject: [PATCH 2/2] Update test --- bin/test | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/bin/test b/bin/test index 3d79362..fd49ff5 100755 --- a/bin/test +++ b/bin/test @@ -292,6 +292,40 @@ def test_can_run_dart_hook(tag: str, pc: str, podman: bool) -> None: _build_and_run(tag, tmpdir, pc, podman=podman) +JULIA_HOOK = '''\ +repos: +- repo: local + hooks: + - id: julia-format + name: julia-format + language: julia + entry: formatter.jl + additional_dependencies: [JuliaFormatter@2] + files: ^t\\.jl$ + types: [julia] +''' + +JULIA_FORMATTER = '''\ +using JuliaFormatter + +exit(all(path -> format_file(path; overwrite=false), ARGS) ? 0 : 1) +''' + + +def test_can_run_julia_hook(tag: str, pc: str, podman: bool) -> None: + with tempfile.TemporaryDirectory() as tmpdir: + subprocess.check_call(('git', 'init', tmpdir)) + with open(os.path.join(tmpdir, '.pre-commit-config.yaml'), 'w') as f: + f.write(JULIA_HOOK) + with open(os.path.join(tmpdir, 'formatter.jl'), 'w') as f: + f.write(JULIA_FORMATTER) + with open(os.path.join(tmpdir, 't.jl'), 'w') as f: + f.write('f(x) = 2x + 3\n') + subprocess.check_call(('git', '-C', tmpdir, 'add', '.')) + + _build_and_run(tag, tmpdir, pc, podman=podman) + + R_HOOK = '''\ repos: - repo: local @@ -430,6 +464,8 @@ def main() -> int: test_can_run_conda_hook(full_tag, pc, podman=args.podman) print(' can run dart tools '.center(79, '='), flush=True) test_can_run_dart_hook(full_tag, pc, podman=args.podman) + print(' can run julia hooks '.center(79, '='), flush=True) + test_can_run_julia_hook(full_tag, pc, podman=args.podman) print(' can run R hooks '.center(79, '='), flush=True) test_can_run_r_hook(full_tag, pc, podman=args.podman) print(' can run lua hooks '.center(79, '='), flush=True)