Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
487fafb
test: verify pre-commit hook execution
anegg0 Dec 8, 2025
38fef68
cleanup: remove test file
anegg0 Dec 8, 2025
0ee211b
test: verify CSS formatting behavior
anegg0 Dec 8, 2025
5b3e9e4
test: verify TypeScript formatting behavior
anegg0 Dec 8, 2025
b3776b0
cleanup: remove test files
anegg0 Dec 8, 2025
0348aba
test: verify format:check validation with properly formatted file
anegg0 Dec 8, 2025
e0236f5
test: verify format:check catches unformatted files
anegg0 Dec 8, 2025
6563153
feat: add format:check validation to pre-commit hook
anegg0 Dec 8, 2025
35e0a7a
test: trigger format:check validation
anegg0 Dec 8, 2025
2430dfa
fix: preserve exit codes in time_command to properly block commits on…
anegg0 Dec 8, 2025
4aedeb0
test: final validation demo with all files formatted
anegg0 Dec 8, 2025
5897ffa
cleanup: remove test files
anegg0 Dec 8, 2025
7b3f6e0
test: verify validation only checks staged files
anegg0 Dec 8, 2025
0011f67
fix: validate only staged files instead of entire project in format c…
anegg0 Dec 8, 2025
60d80a4
reformat vercel.json
anegg0 Dec 9, 2025
2efb6ce
fix malformed link
anegg0 Dec 9, 2025
ad7ad23
fix: check only staged markdown files in markdownlint validation
anegg0 Dec 9, 2025
9ca0617
fix: make TypeScript checking optional with clear project-wide scope …
anegg0 Dec 9, 2025
10328cb
Revert "fix: make TypeScript checking optional with clear project-wid…
anegg0 Dec 9, 2025
6188d18
fix TS issue by giving file correct extension
anegg0 Dec 9, 2025
398e261
fix: remove invalid /? suffix from Vercel redirect patterns
anegg0 Dec 9, 2025
5e0e800
fix: remove remaining ? suffixes from redirect patterns
anegg0 Dec 9, 2025
1463350
re-add test file
anegg0 Dec 9, 2025
db8fc43
Merge branch 'master' into redirect-and-format-check-fix
anegg0 Dec 9, 2025
bff6f60
Update package.json
anegg0 Dec 10, 2025
d013e75
Add trailingSlash configuration to handle trailing slashes globally
anegg0 Dec 10, 2025
16d27ae
remove unneeded logging from pre-commit hook
anegg0 Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ check_command() {
time_command() {
local start_time=$(date +%s)
"$@"
local exit_code=$?
local end_time=$(date +%s)
local duration=$((end_time - start_time))
log_info "⏱️ Completed in ${duration}s"
return $exit_code
}

# Get list of staged files for selective processing
Expand All @@ -106,7 +107,6 @@ main() {
log_step "Starting pre-commit hook validation..."

# Environment and dependency checks
log_info "🔍 Checking environment and dependencies..."
check_command "node"
check_command "yarn"
check_command "git"
Expand All @@ -125,8 +125,6 @@ main() {
exit 0
fi

log_info "📁 Found $(echo "$staged_files" | wc -l | tr -d ' ') staged files"

# 1. Fast redirect validation (project-specific)
log_step "Validating redirects..."
time_command yarn check-redirects || exit_with_error "Redirect validation failed. Fix redirect issues before committing."
Expand All @@ -137,8 +135,6 @@ main() {
log_step "Updating git submodules..."
time_command git submodule update --init --recursive || exit_with_error "Git submodule update failed. Check submodule configuration."
log_success "Git submodules updated"
else
log_info "⏭️ Skipping submodule update (no submodule changes detected)"
fi

# 3. Selective code formatting (only format staged files)
Expand All @@ -152,44 +148,55 @@ main() {

# Format JavaScript/TypeScript files if any
if [ -n "$js_files" ]; then
log_info "🎨 Formatting JS/TS files..."
echo "$js_files" | xargs yarn prettier --write --config "./.prettierrc.js" || exit_with_error "JavaScript/TypeScript formatting failed"
fi

# Format Markdown files if any
if [ -n "$md_files" ]; then
log_info "📝 Formatting Markdown files..."
echo "$md_files" | xargs yarn prettier --write --config "./.prettierrc.js" || exit_with_error "Markdown formatting failed"
fi

# Re-stage formatted files
echo "$staged_files" | grep -E "\.(js|jsx|ts|tsx|json|md|mdx|scss)$" | xargs git add || true

# Validate formatting of staged files only
local formatted_files
formatted_files=$(echo "$staged_files" | grep -E "\.(js|jsx|ts|tsx|json|md|mdx|scss)$" || true)
if [ -n "$formatted_files" ]; then
if ! echo "$formatted_files" | xargs yarn prettier --check --config "./.prettierrc.js"; then
exit_with_error "Formatting validation failed. Some staged files are not properly formatted. This should not happen after auto-formatting."
fi
fi

log_success "Code formatting completed and files re-staged"
else
log_info "⏭️ Skipping code formatting (no formattable files staged)"
fi

# 4. Markdown linting (only if markdown files are staged)
if has_staged_files "\.(md|mdx)$"; then
log_step "Validating Markdown syntax..."
time_command yarn lint:markdown || exit_with_error "Markdown validation failed. Fix markdown syntax errors before committing."
log_success "Markdown validation passed"
else
log_info "⏭️ Skipping Markdown validation (no markdown files staged)"

# Get staged markdown files excluding sdk directory
local lint_md_files
lint_md_files=$(echo "$staged_files" | grep -E "\.(md|mdx)$" | grep -v "docs/sdk/" || true)

if [ -n "$lint_md_files" ]; then
# Run markdownlint only on staged files
if ! echo "$lint_md_files" | xargs yarn markdownlint; then
exit_with_error "Markdown validation failed. Fix markdown syntax errors before committing."
fi
log_success "Markdown validation passed"
fi
fi

# 5. TypeScript type checking (only if TS files are staged)
if has_staged_files "\.(ts|tsx)$"; then
log_step "Running TypeScript type checking..."
time_command yarn typecheck || exit_with_error "TypeScript type checking failed. Fix type errors before committing."
log_success "TypeScript type checking passed"
else
log_info "⏭️ Skipping TypeScript check (no TypeScript files staged)"
fi

# Final success message with timing
log_success "🎉 All pre-commit checks passed successfully!"
log_info "✨ Commit is ready to proceed..."
}

# Trap to handle interruptions gracefully
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (con *ArbHi) SayHi(c ctx, evm mech) (string, error) {
}
```

Next, navigate to (arbitrum_signer.go)[https://github.com/OffchainLabs/go-ethereum/blob/v1.12.2/core/types/arbitrum_signer.go] and add the new precompile address.
Next, navigate to [arbitrum_signer.go](https://github.com/OffchainLabs/go-ethereum/blob/v1.12.2/core/types/arbitrum_signer.go) and add the new precompile address.

```go
var ArbosAddress = common.HexToAddress("0xa4b05")
Expand Down
Loading