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

Running script before each commit to auto format and test #85

Open
1 of 6 tasks
PengVidDev opened this issue Jul 30, 2023 · 5 comments
Open
1 of 6 tasks

Running script before each commit to auto format and test #85

PengVidDev opened this issue Jul 30, 2023 · 5 comments

Comments

@PengVidDev
Copy link

PengVidDev commented Jul 30, 2023

  • Bug
  • Clean up
  • Question
  • Enhancement
  • Suggestion
  • Other

What needs to be done.

  • Writing a script to run before each commit to automatically:
    • Run lint:fix to ensure that files are being formatted correctly
    • Run tests to ensure that behavior of code is validated

Why

  • Sometimes we forget to run tests or fix linter issues after working on the code, good to have an automated way to do all of this because we are lazy and are eager to work on next task 😄.

How

  • Using Husky and git hooks (pre-commit) to run script when committing changes
  • More about Husky
@github-actions
Copy link

Welcome to your first issue! A maintainer will review the Issue and get back to you as soon as possible.

@PengVidDev
Copy link
Author

Currently working on this at the moment, and doing some testing.

@Sukhacoder02
Copy link

Sukhacoder02 commented Sep 5, 2023

Can I take this up, @PengVidDev ?

@PengVidDev
Copy link
Author

Can I take this up, @PengVidDev ?

yes please, been busy.

@rielAsh24
Copy link

Hey @PengVidDev ! I tried working with this and was able to add a pre-commit hook using husky. It performs both linting and tests on the codebase.

pre-commit-hook_Demo.mov

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

No branches or pull requests

3 participants