Skip to content

Commit 623af3b

Browse files
authored
Merge branch 'main' into eph/jl-version
2 parents e750927 + e70b313 commit 623af3b

8 files changed

Lines changed: 34 additions & 9 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -37,7 +37,7 @@ repos:
3737
hooks:
3838
- id: flake8
3939
- repo: https://github.com/pre-commit/mirrors-mypy
40-
rev: v1.16.1
40+
rev: v1.17.1
4141
hooks:
4242
- id: mypy
4343
additional_dependencies: [types-pyyaml]

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
4.3.0 - 2025-08-09
2+
==================
3+
4+
### Features
5+
- `language: docker` / `language: docker_image`: detect rootless docker.
6+
- #3446 PR by @matthewhughes934.
7+
- #1243 issue by @dkolepp.
8+
- `language: julia`: avoid `startup.jl` when executing hooks.
9+
- #3496 PR by @ericphanson.
10+
- `language: dart`: support latest dart versions which require a higher sdk
11+
lower bound.
12+
- #3507 PR by @bc-lee.
13+
114
4.2.0 - 2025-03-18
215
==================
316

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,
@@ -132,6 +132,7 @@ def install_environment(
132132
end
133133
"""
134134
cmd_output_b(
135-
'julia', '-e', julia_code, '--', envdir, *additional_dependencies,
135+
'julia', '--startup-file=no', '-e', julia_code, '--', envdir,
136+
*additional_dependencies,
136137
cwd=prefix.prefix_dir,
137138
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: pre_commit_empty_pubspec
22
environment:
3-
sdk: '>=2.10.0'
3+
sdk: '>=2.12.0'
44
executables: {}

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pre_commit
3-
version = 4.2.0
3+
version = 4.3.0
44
description = A framework for managing and maintaining multi-language pre-commit hooks.
55
long_description = file: README.md
66
long_description_content_type = text/markdown

testing/get-dart.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
VERSION=2.13.4
4+
VERSION=2.19.6
55

66
if [ "$OSTYPE" = msys ]; then
77
URL="https://storage.googleapis.com/dart-archive/channels/stable/release/${VERSION}/sdk/dartsdk-windows-x64-release.zip"

tests/languages/dart_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def test_dart(tmp_path):
1111
pubspec_yaml = '''\
1212
environment:
13-
sdk: '>=2.10.0 <3.0.0'
13+
sdk: '>=2.12.0 <4.0.0'
1414
1515
name: hello_world_dart
1616

tests/languages/julia_test.py

Lines changed: 12 additions & 1 deletion
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
@@ -27,7 +30,6 @@ def test_julia_hook(tmp_path):
2730
expected = (0, b'Hello, world!\n')
2831
assert run_language(tmp_path, julia, 'src/main.jl') == expected
2932

30-
3133
def test_julia_hook_version(tmp_path):
3234
code = """
3335
using Example
@@ -43,6 +45,15 @@ def test_julia_hook_version(tmp_path):
4345
version='1.10.10',
4446
) == expected
4547

48+
def test_julia_hook_with_startup(tmp_path):
49+
depot_path = tmp_path.joinpath('depot')
50+
depot_path.joinpath('config').mkdir(parents=True)
51+
startup = depot_path.joinpath('config', 'startup.jl')
52+
startup.write_text('error("Startup file used!")\n')
53+
54+
depo_path_var = f'{depot_path}{os.pathsep}'
55+
with mock.patch.dict(os.environ, {'JULIA_DEPOT_PATH': depo_path_var}):
56+
test_julia_hook(tmp_path)
4657

4758
def test_julia_hook_manifest(tmp_path):
4859
code = """

0 commit comments

Comments
 (0)