Skip to content

Add Support for Pre-Commit Hooks #1138

Open

Description

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!

Activity

  1. gvatsal60 commented on Oct 3, 2024

    @gvatsal60
    ContributorAuthor

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

  2. samruddhikhandale commented on Oct 8, 2024

    @samruddhikhandale
    Member

    Hi Vatsal Gupta (@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 Brigit Murtaugh (@bamurtaugh) What do you think? 👀

  3. bamurtaugh commented on Oct 8, 2024

    @bamurtaugh
    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 :)

  4. gvatsal60 commented on Oct 13, 2024

    @gvatsal60
    ContributorAuthor

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

  5. rikochetkiki-crypto commented on Aug 21, 2025

    @rikochetkiki-crypto

    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 Je pense que cette fonctionnalité améliorera considérablement notre flux de développement et aidera à maintenir une base de code propre. S'il existe des outils ou des bibliothèques existants que vous recommanderiez pour mettre en œuvre cela, j'aimerais en entendre parler !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions