File tree Expand file tree Collapse file tree
crates/opencontext-core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,5 +130,3 @@ mod tests {
130130 }
131131 }
132132}
133-
134-
Original file line number Diff line number Diff line change @@ -43,5 +43,3 @@ pub enum SearchError {
4343
4444/// Result type alias for search operations
4545pub type SearchResult < T > = std:: result:: Result < T , SearchError > ;
46-
47-
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ #
3+ # Git pre-commit hook for OpenContext
4+ # Checks Rust formatting before allowing commits
5+ #
6+
7+ echo " 🔍 Checking Rust formatting..."
8+
9+ # Check if cargo is available
10+ if ! command -v cargo & > /dev/null; then
11+ echo " ⚠️ cargo not found, skipping Rust format check"
12+ exit 0
13+ fi
14+
15+ # Check Rust formatting
16+ cd crates/opencontext-core
17+ if ! cargo fmt --check 2> /dev/null; then
18+ echo " "
19+ echo " ❌ Rust formatting check failed!"
20+ echo " "
21+ echo " Please run the following command to fix:"
22+ echo " cd crates/opencontext-core && cargo fmt"
23+ echo " "
24+ echo " Then stage the changes and commit again."
25+ exit 1
26+ fi
27+
28+ echo " ✅ Rust formatting OK"
29+ exit 0
30+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ #
3+ # Setup Git hooks for OpenContext development
4+ #
5+
6+ SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd) "
7+ PROJECT_ROOT=" $( dirname " $SCRIPT_DIR " ) "
8+ HOOKS_DIR=" $PROJECT_ROOT /.git/hooks"
9+
10+ echo " 🔧 Setting up Git hooks..."
11+
12+ # Copy pre-commit hook
13+ cp " $SCRIPT_DIR /pre-commit" " $HOOKS_DIR /pre-commit"
14+ chmod +x " $HOOKS_DIR /pre-commit"
15+
16+ echo " ✅ Git hooks installed successfully!"
17+ echo " "
18+ echo " The following hooks are now active:"
19+ echo " - pre-commit: Checks Rust formatting before commits"
20+
You can’t perform that action at this time.
0 commit comments