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 Support for Pre-Commit Hooks #1138

Open
gvatsal60 opened this issue Oct 3, 2024 · 4 comments
Open

Add Support for Pre-Commit Hooks #1138

gvatsal60 opened this issue Oct 3, 2024 · 4 comments

Comments

@gvatsal60
Copy link
Contributor

Summary
I would like to propose adding support for pre-commit hooks to the project. Implementing this feature would help maintain code quality and prevent common issues, such as trimming trailing whitespaces and managing line endings, before code is committed.

Motivation
Using pre-commit hooks can automate checks and fixes for formatting issues, improving the overall code consistency and reducing errors. This would encourage developers to adhere to coding standards without needing to remember to run checks manually.

Benefits
Automatic Formatting: Ensure that code is consistently formatted before commits.
Error Prevention: Catch potential issues early in the development process.
Team Consistency: Align coding practices across all contributors.

Suggested Implementation
Introduce a configuration file (e.g., .pre-commit-config.yaml) to define hooks.

Include hooks for:

  • Trailing whitespace removal
  • Line ending normalization
  • Any additional checks that would enhance code quality

Additional Notes
I believe this feature will greatly enhance our development workflow and help maintain a clean codebase. If there are any existing tools or libraries you’d recommend for implementing this, I’d love to hear about them!

@gvatsal60
Copy link
Contributor Author

gvatsal60 commented Oct 3, 2024

Hi @samruddhikhandale
Is it a good idea to add support for pre-commit hooks on the repo ?

@samruddhikhandale
Copy link
Member

Hi @gvatsal60 👋

Thank you for such a wonderful suggestion. We appreciate your willingness to contribute this change.

I like the idea and agree with you; it would be super useful. Feel free to open a PR with your changes. I'm happy to help land them ⚡

// cc @bamurtaugh What do you think? 👀

@bamurtaugh
Copy link
Member

Thanks so much for opening this issue and for looping me in! I agree that this sounds like a great idea, and we'd love to review a PR :)

@gvatsal60
Copy link
Contributor Author

I'm glad you liked the idea. I've opened a PR #1149.
Thanks for your support! ⚡

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