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

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

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

bertrandshema
Copy link
Contributor

@bertrandshema bertrandshema commented Jun 5, 2024

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

  • Pre-commit hooks are successfully installed and configured: Verified that Husky is installed and set up correctly to manage Git hooks.
  • Linting and formatting checks run automatically before each commit: Ensured that the pre-commit script in package.json runs linting and formatting checks.
  • Documentation is updated to reflect these changes: Updated project documentation to include instructions for setting up and using the pre-commit hooks.

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

  • This setup ensures that code quality is maintained consistently across the project.
  • Developers are encouraged to run npm run lint:fix and npm run format manually during development to avoid issues at commit time.

What are the relevant pivotal trackers/story id?

@bertrandshema bertrandshema self-assigned this Jun 5, 2024
@bertrandshema bertrandshema linked an issue Jun 5, 2024 that may be closed by this pull request
6 tasks
Copy link

vercel bot commented Jun 5, 2024

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
Copy link

codecov-commenter commented Jun 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bertrandshema bertrandshema added the Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager label Jun 7, 2024
Copy link
Collaborator

@ambroisegithub ambroisegithub left a comment

Choose a reason for hiding this comment

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

It Looks good for merge!!!

Copy link
Contributor

@wayneleon1 wayneleon1 left a comment

Choose a reason for hiding this comment

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

Good job

@dushimeemma dushimeemma merged commit b6329ef into develop Jun 7, 2024
4 checks passed
@niyobern niyobern self-requested a review June 7, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Front-End Ready for TTL Review the PR is ready to be reviewed by the TTL/Manager WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set Up Pre-commit Hooks for Linting and Code Formatting
6 participants