INRIA / scikit-learn-mooc

Machine learning in Python with scikit-learn MOOC
https://inria.github.io/scikit-learn-mooc
Creative Commons Attribution 4.0 International
1.12k stars 516 forks source link

MNT Use lint and black format #693

Closed ArturoAmorQ closed 1 year ago

ArturoAmorQ commented 1 year ago

This may create conflicts with previously opened PRs. Please merge this PR before any other.

ogrisel commented 1 year ago

Did you use the default line length of 88 columns or a custom one?

We probably need a pre-commit config file and a CI entry to run the linter.

In hazardous I configured the pre-commit as follows:

and then reused it in the linter config for the CI:

ogrisel commented 1 year ago

We also need to configure the black line length in pyproject.toml.

https://github.com/soda-inria/hazardous/blob/2b2cbd5fe6696c225f0c9dccae0c9dcfd0cc1eeb/pyproject.toml#LL55C1-L68C4

ogrisel commented 1 year ago

Maybe we can try:

[tool.nbqa]
ignore = ["# noqa", "%%"]

from https://you.com/search?q=make++black+ignore+%25%25+cell+magic&tbm=youchat&fromExtension=true&cid=c0_d133d0e8-aeab-457b-a263-e4c292233ef1

EDIT: this won't work on jupytext python files, only for ipynb files.