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 git hooks for enforcing specific styles #3

Open
2 tasks
visualcookie opened this issue Sep 10, 2020 · 2 comments · May be fixed by #16
Open
2 tasks

Add git hooks for enforcing specific styles #3

visualcookie opened this issue Sep 10, 2020 · 2 comments · May be fixed by #16
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects

Comments

@visualcookie
Copy link
Contributor

visualcookie commented Sep 10, 2020

Idea

Before submitting code changes, we need to identify simple issues, to enforce a certain code structure and check for any issues, that could break the application when pushing it. If anything fails, the code changes won't be submitted to the repository until it gets fixed.

Open questions

  • What things should be checked using the pre-commit hook?
  • What tools are available for a pre-commit hook check?
@visualcookie visualcookie added the help wanted Extra attention is needed label Sep 10, 2020
@visualcookie visualcookie added this to To do in v1.0.0 via automation Sep 10, 2020
@iduuck
Copy link
Member

iduuck commented Sep 10, 2020

What tools are available for a pre-commit hook check?

I would suggest husky since it has 3,275,175 weekly downloads, it should be fairly the standard in the npm ecosystem.


What things should be checked using the pre-commit hook?

I wouldn't focus on just the pre-commit hook, but also the pre-push, so we can also implement some more heavy operations such as testing the code. Because we are commiting more often, we don't want to run the whole test suite against each commit, but rather against each push. This makes much more sense in my eyes.

I would suggest the following hooks:

Hook Name Tool(s) What to check?
pre-commit eslint, tsc Linting the code, perhaps typechecking for typescript issues
commit-msg commitlint Linting the commit message, so we also have a unified commit message layout
pre-push Any test framework Testing (+ complex operations, that shouldn't run on each commit)

@iduuck iduuck added documentation Improvements or additions to documentation enhancement New feature or request and removed help wanted Extra attention is needed labels Sep 10, 2020
@iduuck iduuck changed the title Add pre-commit hooks Add git hooks for enforcing specific styles Sep 10, 2020
@iduuck iduuck mentioned this issue Sep 12, 2020
@iduuck iduuck assigned louisraetz and iduuck and unassigned louisraetz Sep 24, 2020
@iduuck iduuck linked a pull request Sep 28, 2020 that will close this issue
@iduuck iduuck moved this from To do to In progress in v1.0.0 Sep 28, 2020
@iduuck
Copy link
Member

iduuck commented Sep 28, 2020

Already in the documentation, so I think this should be fine by the release of the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
v1.0.0
  
In progress
Development

Successfully merging a pull request may close this issue.

3 participants