mlcommons/algorithmic-efficiency

Optimize Git Hook Configuration

Open

#853 opened on Mar 13, 2025

 (1 comment) (0 reactions) (0 assignees)Python (76 forks)auto 404
Good First Issue

Repository metrics

Stars
 (422 stars)
PR merge metrics
 (PR metrics pending)

Description

Description

Our current setup uses pre-commit hooks to enforce code quality checks before each commit. While this helps maintain consistency, it can slow down development.

To balance consistency and efficiency, we can:

  • Switch to Pre-Push Hooks

    • Runs checks before pushing to the remote repository, reducing interruptions during commits.
    • Since most pre-commit checks handle formatting, fixing them before pushing is sufficient (unlike API keys, which should never be committed).
  • Provide a Makefile for Manual Pre-Commit Checks

    • Developers can run make pre-commit periodically to format and clean up code in bulk.
    • This avoids enforcing checks on every commit while still ensuring consistency.

By combining pre-push hooks and a Makefile, we ensure that checks happen at the right time—automatically before pushing, with an option for developers to run them manually when needed.

Contributor guide