Skip to content

Ignore config error if the directory is skipped#860

Merged
j178 merged 2 commits intomasterfrom
exit
Oct 9, 2025
Merged

Ignore config error if the directory is skipped#860
j178 merged 2 commits intomasterfrom
exit

Conversation

@j178
Copy link
Owner

@j178 j178 commented Oct 9, 2025

No description provided.

@j178 j178 added the enhancement New feature or request label Oct 9, 2025
@codecov
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.36%. Comparing base (7edf287) to head (774710d).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/workspace.rs 94.73% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #860   +/-   ##
=======================================
  Coverage   89.35%   89.36%           
=======================================
  Files          59       59           
  Lines       10967    10982   +15     
=======================================
+ Hits         9800     9814   +14     
- Misses       1167     1168    +1     

☔ View full report in Codecov by Sentry.
📢 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.

@j178 j178 merged commit 9a4fb2b into master Oct 9, 2025
18 checks passed
@j178 j178 deleted the exit branch October 9, 2025 11:58
@m-aciek
Copy link

m-aciek commented Oct 15, 2025

It doesn't seem to work, if I don't miss anything 🤔

% prek --version
prek 0.2.8 (e924c4ba5 2025-10-14)
% prek install --skip taa
prek installed at `.git/hooks/pre-commit`
% git commit
error: Failed to parse `taa/.pre-commit-config.yaml`
  caused by: invalid type: string "../javelin/.pre-commit-config.yaml", expected struct Config

hook script:

#!/usr/bin/env bash
# File generated by prek: https://github.com/j178/prek
# ID: 182c10f181da4464a3eec51b83331688

# Unset GIT_DIR to avoid git taking current directory as the git dir.
# See:
# https://github.com/pre-commit/pre-commit/issues/2295
# https://www.spinics.net/lists/git/msg374197.html
unset GIT_DIR

ARGS=(hook-impl --skip=taa --hook-type=pre-commit --script-version=3)

HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
PREK="/Users/maciej.olko/.local/bin/prek"

# Check if the full path to prek is executable, otherwise fallback to PATH
if [ ! -x "$PREK" ]; then
    PREK="prek"
fi

exec "$PREK" "${ARGS[@]}"

@j178
Copy link
Owner Author

j178 commented Oct 15, 2025

@m-aciek You need to use prek install --skip taa/ - the trailing slash is important because it makes it a path selector. Without the slash, it gets recognized as a hook id selector instead.

https://prek.j178.dev/workspace/#selector-syntax

@m-aciek
Copy link

m-aciek commented Oct 15, 2025

Thank you! Yes, I found it in parallel. 👍 🚀 thank you for fixing and releasing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants