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: check commit message type before committing #3187

Closed
wants to merge 6 commits into from

Conversation

germa89
Copy link
Collaborator

@germa89 germa89 commented Jun 19, 2024

Description

Use pre-commit hooks to check commit messages before commiting.

Issue linked

N/A

Checklist

@germa89 germa89 added CI/CD Related with CICD, Github Actions, etc new Feature labels Jun 19, 2024
@germa89 germa89 self-assigned this Jun 19, 2024
@germa89 germa89 requested a review from a team as a code owner June 19, 2024 10:55
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot removed the CI/CD Related with CICD, Github Actions, etc label Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.47%. Comparing base (7c1eb1e) to head (d4b0b0b).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3187      +/-   ##
==========================================
- Coverage   86.63%   84.47%   -2.17%     
==========================================
  Files          52       52              
  Lines        9550     9596      +46     
==========================================
- Hits         8274     8106     -168     
- Misses       1276     1490     +214     

@clatapie
Copy link
Contributor

clatapie commented Jun 19, 2024

As the action only checks for the PR name, this will make the pre-commit and therefore the code-style action stricter than it is at present. Also, some automatic commit names such as Merge branch 'main' into ..... or Adding changelog entry: ..... will failed.

Edit: as there is no code-style in the CI/CD, it will not fail because of it.

@germa89 germa89 changed the title feat: check commit message feat: check commit message type before commiting Jun 20, 2024
@germa89
Copy link
Collaborator Author

germa89 commented Jun 20, 2024

As the action only checks for the PR name, this will make the pre-commit and therefore the code-style action stricter than it is at present. Also, some automatic commit names such as Merge branch 'main' into ..... or Adding changelog entry: ..... will failed.

Edit: as there is no code-style in the CI/CD, it will not fail because of it.

Good catch @clatapie

OK. I think the pyansys-ci-bot should have a proper commit message... at the end of the day, we are trying to enforce this. @klmcadams can you give us an option in the changelog to add a prefix to the commit message? Pinging @RobPasMue for feedback.

Regarding the Merge to main... I guess there is no way... we merge to main from github website... and also we use VSCode. I will see if we can have a custom commit message.

Although we do not have code-style action, we do have pre-commit as part of the CICD. We are just missing the docker linter. We could add it though.

Let's merge this if there is no failure on CICD.

@germa89 germa89 changed the title feat: check commit message type before commiting feat: check commit message type before committing Jun 20, 2024
@germa89
Copy link
Collaborator Author

germa89 commented Jun 20, 2024

Merge to main... could be a big headache. Let's park this for the moment.

@germa89 germa89 marked this pull request as draft June 20, 2024 11:50
@RobPasMue
Copy link
Member

RobPasMue commented Jun 20, 2024

@klmcadams can you give us an option in the changelog to add a prefix to the commit message? Pinging @RobPasMue for feedback.

Agreed - in fact we should standardize it to "chore: ..." IMO

@RobPasMue
Copy link
Member

Merge to main... could be a big headache. Let's park this for the moment.

Yeah... you are not going to come around that one easily 😄

@germa89
Copy link
Collaborator Author

germa89 commented Jun 20, 2024

Merge to main... could be a big headache. Let's park this for the moment.

Yeah... you are not going to come around that one easily 😄

History of my life man... xDDD

@germa89
Copy link
Collaborator Author

germa89 commented Jun 24, 2024

I'm closing this PR without merging. Fixing it is more trouble than getting used to the new convention.

@germa89 germa89 closed this Jun 24, 2024
@germa89 germa89 deleted the feat/adding-prehook-for-commit-message branch June 24, 2024 10:10
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.

4 participants