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

Add pre-commit hook and task to automatically install it #408

Merged
merged 2 commits into from
Aug 3, 2020

Conversation

vbuberen
Copy link
Collaborator

@vbuberen vbuberen commented Aug 3, 2020

📄 Context

This PR implements enhancement #248 to run code checks before commiting the code. Except adding the hook itself I have also added a task to install hook which runs whenever clean task is fired. It means that with such hack every contributor will have hook installed automatically.

Closes #248

📝 Changes

  • Added pre-commit script file
  • Added task to install this script file
  • Set clean task to depend on install task.

📎 Related PR

🚫 Breaking

Nothing

🛠️ How to test

Run Clean or Rebuild task and see that installGitHook task is executed as well.
After that hook should run on every commit attempt.

⏱️ Next steps

We might consider integrating formatting task into the hook as well after adding #249

@vbuberen vbuberen added the enhancement New feature or improvement to the library label Aug 3, 2020
@vbuberen vbuberen added this to the 3.3.0 milestone Aug 3, 2020
@vbuberen vbuberen requested a review from cortinico August 3, 2020 17:52
Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Just tested and it works great. I'll udpate #407

Co-authored-by: Nicola Corti <corti.nico@gmail.com>
@vbuberen vbuberen merged commit d03af58 into develop Aug 3, 2020
@vbuberen vbuberen deleted the update/hook branch August 3, 2020 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pre-commit hooks to run code checks
2 participants