mlcommons / mlcommons/algorithmic-efficiency

Optimize Git Hook Configuration

Open
#853 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Good First Issue
Dominant language
Python
Stars
425
Forks
78
PR merge metrics
No merged PRs in 30d

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the current pre-commit hook configuration and any existing Makefile or check commands in the repository. Move the specified checks to pre-push and expose them as make pre-commit, then verify both hook execution and the manual target.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
build-system, developer-experience, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.