Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve pre-commit hook #265

Merged
merged 2 commits into from
Feb 5, 2024
Merged

ci: improve pre-commit hook #265

merged 2 commits into from
Feb 5, 2024

Conversation

kerber0x
Copy link
Contributor

@kerber0x kerber0x commented Feb 1, 2024

Description and Motivation

This PR improves the pre-commit hook, formatting not only rust files but also toml and shell scripts files.

It also introduces a commit-msg hook, which makes sure the conventional commit format is being used.

Related Issues


Checklist:

  • I have read Migaloo's contribution guidelines.
  • My pull request has a sound title and description (not something vague like Update index.md)
  • All existing and new tests are passing.
  • I updated/added relevant documentation.
  • The code is formatted properly cargo fmt --all --.
  • Clippy doesn't report any issues cargo clippy -- -D warnings.
  • I have regenerated the schemas if needed cargo schema.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7a799b7) 94.42% compared to head (91c5fe2) 94.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #265   +/-   ##
=======================================
  Coverage   94.42%   94.42%           
=======================================
  Files         218      218           
  Lines       24691    24691           
=======================================
  Hits        23314    23314           
  Misses       1377     1377           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -18,6 +18,9 @@ test FEATURE='':
cargo test --features {{FEATURE}}
fi

fmt:
@just format
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an alias for just format, so you can also do just fmt

COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")

# Regular expression to match Conventional Commits format
CONVENTIONAL_COMMIT_REGEX="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(\S+\))?: .+$"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried to do it with convco first but it was giving me some issues so i just did a regex :P

@Sen-Com Sen-Com assigned nseguias and unassigned nseguias Feb 2, 2024
@kerber0x kerber0x merged commit 418bf25 into main Feb 5, 2024
6 checks passed
@kerber0x kerber0x deleted the ci/improved-precommit-hook branch February 5, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants