-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Only tracking pre-commit hooks in git, allowing for personal s… #1349
Conversation
📝 WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.gitignore (1)
11-12
: Consider removing one empty line.There are two consecutive empty lines here. While spacing in
.gitignore
helps visually separate rule groups, a single empty line is sufficient..hooks/* !.hooks/pre-commit - # Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,vim,webstorm+all,node,yarn
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
.gitignore
(1 hunks).hooks/pre-commit
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .hooks/pre-commit
🔇 Additional comments (1)
.gitignore (1)
9-10
: LGTM! Clean implementation of hook management.
The implementation correctly:
- Ignores all files in
.hooks/
directory - Explicitly tracks only the pre-commit hook
- Allows for personal hook configurations
This is a good practice that balances team consistency (tracked pre-commit hook) with developer flexibility (untracked personal configurations).
Let's verify the hook setup:
✅ Verification successful
Pre-commit hook setup verified and working as intended
The verification confirms:
- Pre-commit hook exists at
.hooks/pre-commit
- Pre-commit hook is properly tracked in git
- No other hooks are tracked, allowing for untracked personal configurations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify pre-commit hook exists and is tracked
# Test 1: Verify pre-commit hook exists
if [ -f ".hooks/pre-commit" ]; then
echo "✓ pre-commit hook exists"
else
echo "✗ pre-commit hook missing"
exit 1
fi
# Test 2: Verify pre-commit hook is tracked
if git ls-files --error-unmatch .hooks/pre-commit >/dev/null 2>&1; then
echo "✓ pre-commit hook is tracked in git"
else
echo "✗ pre-commit hook is not tracked in git"
exit 1
fi
# Test 3: Check for any other tracked files in .hooks
other_hooks=$(git ls-files .hooks/ | grep -v "pre-commit" || true)
if [ -z "$other_hooks" ]; then
echo "✓ No other hooks are tracked"
else
echo "✗ Unexpected tracked hooks found:"
echo "$other_hooks"
exit 1
fi
Length of output: 371
…etup
Hva er endret?
Dokumentasjon / Storybook / testdekning
stories
iStorybook
, eller så er ikke dette relevant.Skjermbilder eller GIFs (valgfritt)
Summary by CodeRabbit
.gitignore
to ignore all files in the.hooks
directory while keeping thepre-commit
file tracked..hooks/pre-commit
file for clarity, with no changes to its existing functionality.