pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/pre-commit/pre-commit/commit/6f1f433a9cea94a70828ade95931a703c9a9c82b

ef="https://github.githubassets.com/assets/global-d18f184ea1a06a2c.css" /> Julia language: skip startup.jl file · pre-commit/pre-commit@6f1f433 · GitHub
Skip to content

Commit 6f1f433

Browse files
ericphansonasottile
authored andcommitted
Julia language: skip startup.jl file
1 parent c681721 commit 6f1f433

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

pre_commit/languages/julia.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run_hook(
3737

3838
cmd = lang_base.hook_cmd(entry, args)
3939
script = cmd[0] if is_local else prefix.path(cmd[0])
40-
cmd = ('julia', script, *cmd[1:])
40+
cmd = ('julia', '--startup-file=no', script, *cmd[1:])
4141
return lang_base.run_xargs(
4242
cmd,
4343
file_args,
@@ -127,6 +127,7 @@ def install_environment(
127127
end
128128
"""
129129
cmd_output_b(
130-
'julia', '-e', julia_code, '--', envdir, *additional_dependencies,
130+
'julia', '--startup-file=no', '-e', julia_code, '--', envdir,
131+
*additional_dependencies,
131132
cwd=prefix.prefix_dir,
132133
)

tests/languages/julia_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from __future__ import annotations
22

3+
import os
4+
from unittest import mock
5+
36
from pre_commit.languages import julia
47
from testing.language_helpers import run_language
58
from testing.util import cwd
@@ -28,6 +31,17 @@ def test_julia_hook(tmp_path):
2831
assert run_language(tmp_path, julia, 'src/main.jl') == expected
2932

3033

34+
def test_julia_hook_with_startup(tmp_path):
35+
depot_path = tmp_path.joinpath('depot')
36+
depot_path.joinpath('config').mkdir(parents=True)
37+
startup = depot_path.joinpath('config', 'startup.jl')
38+
startup.write_text('error("Startup file used!")\n')
39+
40+
depo_path_var = f'{depot_path}{os.pathsep}'
41+
with mock.patch.dict(os.environ, {'JULIA_DEPOT_PATH': depo_path_var}):
42+
test_julia_hook(tmp_path)
43+
44+
3145
def test_julia_hook_manifest(tmp_path):
3246
code = """
3347
using Example

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy