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

✨ feat: add pre-commit hook config #199

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TribuneX
Copy link

Summary

This PR makes git-sumi usuable via pre-commit.

Related issue

#179


How has this been tested?


Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have read the contributing guidelines.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I have formatted the code with cargo fmt.
  • My change requires updating the documentation.
  • I have updated the documentation accordingly.

@TribuneX TribuneX requested a review from welpo as a code owner January 17, 2025 23:14
@TribuneX
Copy link
Author

TribuneX commented Jan 18, 2025

The output looks like this:

 pre-commit  try-repo ../git-sumi git-sumi --verbose --all-files --hook-stage prepare-commit-msg --commit-msg-filename commit-msg
===============================================================================
Using config:
===============================================================================
repos:
-   repo: ../git-sumi
    rev: a54d2fffca82d70ab1638a38b4d889d71e441381
    hooks:
    -   id: git-sumi
===============================================================================
[INFO] Initializing environment for ../git-sumi.
[INFO] Installing environment for ../git-sumi.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Lint commit message with git sumi........................................Failed
- hook id: git-sumi
- duration: 0.19s
- exit code: 1

💬 Input: "chore: test commit"
️❗ Header must contain exactly 1 emoji, found 0
️❗ Header does not match the required pattern: '^([\p{Emoji_Presentation}\p{Extended_Pictographic}](?:\u{FE0F})?\u{200D}?) \w'
❌ Error: Found 2 linting errors

I also tested it with a real commit in the test repo

@welpo welpo added the enhancement New feature or request label Jan 18, 2025
Copy link
Owner

@welpo welpo left a comment

Choose a reason for hiding this comment

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

Thank you! I've added a few questions/comments.

.pre-commit-hooks.yaml Outdated Show resolved Hide resolved
.pre-commit-hooks.yaml Show resolved Hide resolved
website/docs/index.md Outdated Show resolved Hide resolved
website/docs/index.md Show resolved Hide resolved
@TribuneX TribuneX force-pushed the feat/integrate-pre-commit branch from f00d8a3 to 9d454aa Compare January 18, 2025 22:41
@TribuneX
Copy link
Author

Thanks for the review. I amended the changes into the same commit.

@welpo
Copy link
Owner

welpo commented Jan 19, 2025

Thank you! I've made a few changes.

Could you do a final review? If all looks good to you, I'll merge :)

@TribuneX
Copy link
Author

TribuneX commented Jan 20, 2025

One last remark. Otherwise looks good to me.

website/docs/integration.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants