scikit-learn / scikit-learn/scikit-learn

Reuse the `pre-commit` linter config in the CI runners

Open
#32,500 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Build / CI
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

At the moment, our CI runs linting jobs using a custom script build_tools/lintin.sh with manually pip installed dependencies in the Circle CI and Azure Pipelines CI configuration files.

Those linter tool versions are not always consistent with what we configure in .pre-commit-config.yaml and that can cause problems such as the following: https://github.com/scikit-learn/scikit-learn/pull/32499#issuecomment-3402244557.

I think we should refactor our CI config to reuse the pre-commit command, for instance by running:

pre-commit run --all-files

Instead of our custom build_tools/linting.sh script. However, this might not be that easy:

  • there are probably linting failures to fix or config to update to ignore specific files or folders;
  • there might be CI integration to update, in particular the .github/workflows/bot-lint-comment.yml and the ./build_tools/get_comment.py script that generate a helpful user facing comments will need to be reworked and adapted to work with the output of the pre-commit command.

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 comparing the linting steps in the Circle CI and Azure Pipelines configuration files with .pre-commit-config.yaml and build_tools/linting.sh. Then inspect .github/workflows/bot-lint-comment.yml and build_tools/get_comment.py to understand how lint output is reported. Done means CI reuses the pre-commit configuration consistently, required lint failures or exclusions are addressed, and user-facing comments still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ci-cd, 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.