mlcommons / mlcommons/inference

Codebase Refactor: Adding pre-commit checks and enforcing them.

Open
#2,535 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.6k
Forks
650
Avg merge
1d 22h
Merged PRs (30d)
6

Description

We really should try to enforce linting and code quality checks locally when possible, as it can ensure our code quality is high and prevent some easy errors.

Using pre-commit is easy - we just need to add the .pre-commit-config.yaml.

However, while it is easy to push the yaml into the repo, we should actually ensure compliance with ruff and other tools so that we can ensure everything is going as expected.

The PR to be mentioned will contain this first change, but I'll push any PRs I can that address issues as separate issues and PRs. This issue should be closed when we can run the pre-commit mentioned without any major errors.

Hooks used:
ruff (lint and format)
shellcheck
trailing-whitespace
end-of-file-fixer
check-yaml
check-added-large-files
detect-private-key

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 reviewing the repository and the proposed .pre-commit-config.yaml, then run the listed hooks to identify existing violations. Check ruff linting and formatting first, followed by shellcheck and the file-safety checks. Done means pre-commit runs without major errors and the repository complies with the configured hooks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 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.