BLOG-145 Add pre-commit hooks #147
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "BLOG-145_add_pre_commit_hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Package Changes
No response
Screenshots
No response
Reference
Resolves #145.
Checklist
/improve
PR Code Suggestions ✨
Validate and stage generated SQLx data
Modify the
sqlx-prepare.sh
script to ensure that thesqlx-data.json
file isup-to-date and staged. If the
cargo sqlx prepare --workspace
command modifiessqlx-data.json
but it's not staged, the hook should fail, prompting the developer tostage the changes. This prevents committing an outdated
sqlx-data.json
file.script/sqlx-prepare.sh [1-6]
Suggestion importance[1-10]: 8
__
Why: This suggestion addresses a potential issue where
sqlx-data.json
might be modified but not staged, leading to an outdated file in the repository. The proposedgit diff
check and error handling significantly improve the pre-commit hook's reliability.Standardize hook language for scripts
For consistency and robustness, consider changing the
language
for custom shellscripts from
system
toscript
. This ensures the hooks are executed via a shellinterpreter, avoiding potential issues if the scripts lack execute permissions.
.pre-commit-config.yaml [11-18]
Suggestion importance[1-10]: 7
__
Why: Changing
language: system
tolanguage: script
for custom shell scripts in.pre-commit-config.yaml
is a good practice that improves robustness and consistency, ensuring scripts are executed correctly via a shell interpreter.Align setup instructions for consistency
For consistency, update the "Full Project Setup" section to refer to
frontend/README.md
for detailed frontend setup, similar to how it referencesbackend/README.md
. This ensures users are directed to the most comprehensiveinstructions for both parts of the project.
README.md [75-76]
Suggestion importance[1-10]: 6
__
Why: Updating the
README.md
to consistently refer tofrontend/README.md
for detailed setup instructions, similar to the backend, enhances documentation clarity and user experience. It's a good improvement for maintainability.Addressed in
feaddd2fed
.Addressed in
1d8a864ad4
.Addressed in
65a2b0a6d6
.