Skip to content

Update the git hooks: one Julia process per hook - #38

Merged
michakraus merged 4 commits into
mainfrom
githooks/one-julia-process
Nov 1, 2026
Merged

michakraus merged 4 commits into
mainfrom
githooks/one-julia-process

Conversation

@michakraus

@michakraus michakraus commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

The git hooks of this repository start Julia once per hook, where they started it three or four times.

.githooks/pre-commit and .githooks/pre-push become short launchers. pre-commit.jl runs the test-layout check, the format check, fatou lint and the NFC check in one Julia process, and the load test in a child process with --project=., so the load test still sees the package's own environment, as using Pkg does in CI. pre-push.jl does the same for the push checks.

Without julia on the PATH, a commit with no staged .jl file and no change below test/ passes, and so does a push that updates no main or master, as with the old hooks; any other commit or push is refused. A renamed .jl file, a .jl file that becomes a symlink, a path with non-ASCII characters and a file that does not parse are checked too. The formatting stage needs JuliaFormatter 2.14 or later, which supports Julia 1.10 and later, and refuses an older release with one line that names its version. A fatou that cannot start skips the advisory lint stage, as a missing fatou does.

The files are byte-identical to githooks/ (and scripts/test-layout.jl) of the ResearchHarness at commit bcda496, as harness githooks --apply installs them. Only pre-commit and pre-push are executable.

Nothing else changes. After the merge, harness githooks reports nothing to do for this repository.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 74d0a763-5651-468a-8490-247938ee9dc8
Commits

Reviewing files that changed from the base of the PR and between 4a191d3 and 8897f89.

Files selected for processing: 2
  • .githooks/pre-commit
  • .githooks/pre-commit.jl

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Summary

Summary by CodeRabbit

  • Chores
    • Pre-commit checks now validate test layout, format staged Julia files, check text normalization, and verify package loading when applicable. Linting is advisory.
    • When Julia is unavailable, commits affecting staged Julia files or test/ are blocked; commits with neither can proceed.
    • Pre-push checks run tests for pushes to main or master; pushes to other branches skip the test suite.
    • If Julia is unavailable, pushes to main or master are blocked; pushes to other branches proceed without running tests.

The shell hooks now delegate to adjacent Julia scripts. The pre-commit script checks staged files. The pre-push script runs the applicable test target only for pushes to main or master.

Changes: Julia Git Hooks

Layer / File(s) Summary
Pre-commit checks
.githooks/pre-commit.jl
The script checks test layout, formatting, Unicode NFC, and package loading. Fatou lint is advisory. Timed subprocesses are stopped when they exceed their limits.
Pre-commit orchestration
.githooks/pre-commit, .githooks/pre-commit.jl
The shell hook launches the Julia script when Julia is available. Without Julia, it blocks commits when staged Julia or test paths are present. The Julia script selects checks based on staged paths and fails on blocking errors.
Pre-push test suite
.githooks/pre-push.jl
The script runs Pkg.test or test/runtests.jl with bounds checking. It handles interruption of the test process.
Pre-push ref gating and launch
.githooks/pre-push, .githooks/pre-push.jl
The Julia script runs tests only when pushed refs include refs/heads/main or refs/heads/master. Without Julia, the shell hook rejects those refs and skips other refs.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant Git
  participant PrePushShell as pre-push
  participant PrePushJulia as pre-push.jl
  participant TestProcess
  Git->>PrePushShell: pushed-ref lines and hook arguments
  PrePushShell->>PrePushJulia: launch when Julia is available
  PrePushJulia->>PrePushJulia: check for main or master refs
  PrePushJulia->>TestProcess: run selected test target when a ref matches
Loading
Merge Risk: Minimal · up to 8897f

No merge-blocking issues were identified in the hook changes.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly states the main change: each Git hook now uses one Julia process.
Description check Passed The description directly explains the launcher changes, consolidated Julia hook behavior, fallback behavior, and validation stages.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1428417d-a05d-4f5d-8f03-873f9aae283c
Commits

Reviewing files that changed from the base of the PR and between 782ed35 and 0cb7e83.

Files selected for processing: 4
  • .githooks/pre-commit
  • .githooks/pre-commit.jl
  • .githooks/pre-push
  • .githooks/pre-push.jl

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread .githooks/pre-commit.jl Resolved
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.20%. Comparing base (782ed35) to head (8897f89).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage   77.20%   77.20%           
=======================================
  Files          18       18           
  Lines         443      443           
=======================================
  Hits          342      342           
  Misses        101      101           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…hooks)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 812fcd95-af39-4e18-a806-c27302c38bb5
Commits

Reviewing files that changed from the base of the PR and between 0cb7e83 and 4a191d3.

Files selected for processing: 3
  • .githooks/pre-commit
  • .githooks/pre-commit.jl
  • .githooks/pre-push

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread .githooks/pre-commit Resolved
michakraus and others added 2 commits October 31, 2026 23:05
…arness githooks)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rness githooks)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michakraus
michakraus merged commit 8070cd7 into main Nov 1, 2026
14 checks passed
@michakraus
michakraus deleted the githooks/one-julia-process branch November 1, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant