atlp-rwanda / dynamites-ecomm-fe

https://dynamites-ecomm-fe.netlify.app/
0 stars 0 forks source link

Set Up Pre-commit Hooks for Linting and Code Formatting #12

Closed bertrandshema closed 3 weeks ago

bertrandshema commented 3 weeks ago

This PR implements pre-commit hooks to ensure that all code commits adhere to our linting and code formatting standards. This setup will help maintain code quality and consistency across the project by automatically running linting and formatting checks before each commit. We are using Husky to manage these Git hooks.

Tasks Completed

  1. Installed Husky as a development dependency.
  2. Set up Husky to manage Git hooks.
  3. Added a pre-commit hook to run linting and formatting checks before each commit.
  4. Updated package.json to include scripts for linting and formatting.
  5. Configured Husky pre-commit hook file.

Acceptance Criteria

Testing

Opened the terminal and navigated to the project's root directory.

  1. Installed Husky: npm install husky --save-dev
  2. Set up Husky: npx husky install
  3. Added pre-commit hook: npx husky add .husky/pre-commit "npm run pre-commit"
  4. Attempted to make a commit with linting and formatting issues: Verified that the commit was blocked and errors were displayed in the terminal.
  5. Fixed the issues and committed again: Verified that the commit was successful once all linting and formatting issues were resolved.

Additional Notes

What are the relevant pivotal trackers/story id?

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dynamites-ecomm-fe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 7, 2024 1:30pm
codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 17.24%. Comparing base (3fd4bb9) to head (9413af8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #12 +/- ## ======================================== Coverage 17.24% 17.24% ======================================== Files 4 4 Lines 29 29 Branches 4 4 ======================================== Hits 5 5 Misses 21 21 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.