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

πŸ§‘β€πŸ’» (v2.0.0) Setup Husky Git hooks to ensure consistency and automate tasks #536

Open
5 tasks done
arimgibson opened this issue Nov 7, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arimgibson
Copy link
Owner

arimgibson commented Nov 7, 2022

Description

To ensure consistency among developers and adhere to the chosen AirBNB styling guide, Git hooks utilizing Husky should be added. These hooks should be configured to update dependencies, lint/format, and test code before committing (in that order). Other tasks that help with code consistency and automation can also be considered.

Problem

Without an automation system in place for these tasks, multiple unwanted outcomes are possible:

  1. Dependencies used by each developer can be out of date, causing a false positive where tests pass on outdated dependencies but not the updated versions
  2. Code written by different developers can vary drastically, making it harder to read and edit
  3. Developers may forget to run tests before committing their code, leading to breaking changes being added to the production, release versions of the extension.

Rational for Git hooks vs CI/CD

At the current size and development of this project, I believe that having a full CI/CD system would be overkill. I also think it's easier when the aforementioned problems are caught before changes are committed; it keeps commit history cleaner instead of having to commit new changes to fix issues that should've been caught before committing. This system for Git hooks may not be permanent, and it may be worth looking into a CI/CD system at a later date when there aren't larger priorities.

Next Steps

  • Install Husky
  • Add Husky task to update dependencies
  • Add Husky task to run ESLint auto-fix, exiting on changes that must be fixed manually
  • Add Husky task to run tests, exiting on failing tests
  • Add to README documentation specifying how to skip Git hooks when needed

Notes

If you are interested in completing a pull request for this issue, please tag @arimgibson to get approval first. This ensures that multiple people aren't working on the same PR at the same time, and helps to make sure you get credit for your work.

@arimgibson arimgibson added enhancement New feature or request good first issue Good for newcomers labels Nov 7, 2022
@arimgibson arimgibson self-assigned this Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant