Skip to content

Commit

Permalink
[main]: update hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
xkeshav committed Jan 31, 2025
1 parent 806c18d commit acbaf17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
22 changes: 1 addition & 21 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@ echo "Running pre-commit checks for branch: $BRANCH_NAME"
echo "$BRANCH_NAME" | grep -Eq '^(feature|bugfix|hotfix|task)/[A-Za-z]+-[0-9]+'
if [ $? -ne 0 ]; then
echo "Error: Branch name '$BRANCH_NAME' is invalid."
echo "Use a valid branch naming convention, e.g., feature/XYZ-123-description."
echo "Use a valid branch naming convention, e.g., feature|bugfix|hotfix|task/XYZ-123."
exit 1
fi

# Step 2: Run poetry linting tools
echo "Running poetry linting tools..."
if ! poetry run flake8 .; then
echo "flake8 failed. Aborting commit."
exit 1
fi

if ! poetry run black --check .; then
echo "black failed. Aborting commit."
exit 1
fi

if ! poetry run mypy .; then
echo "mypy failed. Aborting commit."
exit 1
fi

echo "Pre-commit checks passed!"
exit 0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lint": "prettier -w --cache . && prettier -w --cache **/*.astro",
"clean": "rm -rf dist rm -rf build",
"nuke": "shx rm -rf node_modules && rm package-lock.json && npm run clean",
"postinstall": "shx ./setup-hooks.sh"
"postinstall": "bash ./setup-hooks.sh"
},
"dependencies": {
"@astrojs/check": "0.9.4",
Expand Down

0 comments on commit acbaf17

Please sign in to comment.