Files
storybook/lefthook.yml
Sienna Meridian Satterwhite 26bbef58d3 fix(lsp): correct line numbers in convert species/template tests
The tests were using line: 2 but the character declarations were on
line: 1 (due to the leading newline in the raw string literal). This
caused the cursor position to be outside the character span, making
the code actions fail to trigger.

Fixed by changing line: 2 to line: 1 in both test_convert_species_to_template
and test_convert_template_to_species.
2026-02-14 16:29:22 +00:00

56 lines
1.6 KiB
YAML

# lefthook.yml - Git hooks configuration
# https://github.com/evilmartians/lefthook
# Validate commit messages follow conventional commits format
commit-msg:
commands:
conventional-commit:
run: |
commit_msg=$(cat {1})
# Conventional commit pattern
pattern="^(feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert)(\(.+\))?: .{1,}"
if ! echo "$commit_msg" | grep -qE "$pattern"; then
echo "❌ Invalid commit message format!"
echo ""
echo "Commit message must follow conventional commits:"
echo " <type>(<scope>): <description>"
echo ""
echo "Types: feat, fix, docs, style, refactor, perf, test, chore, build, ci, revert"
echo ""
echo "Example:"
echo " feat(auth): add user login endpoint"
echo " fix(ui): resolve button alignment issue"
echo " docs: update README with installation steps"
echo ""
echo "Your message:"
echo " $commit_msg"
exit 1
fi
# Run checks before commit
pre-commit:
parallel: true
commands:
fmt:
glob: "*.rs"
run: cargo fmt --check
stage_fixed: true
clippy:
glob: "*.rs"
run: cargo clippy --workspace --all-targets -- -D warnings
test:
glob: "*.rs"
run: cargo nextest run --no-fail-fast
trailing-whitespace:
glob: "*.{rs,toml,md,yml,yaml}"
run: |
if grep -n '[[:space:]]$' {staged_files}; then
echo "❌ Found trailing whitespace in staged files"
exit 1
fi