lightly-ai / lightly

A python library for self-supervised learning on images.
https://docs.lightly.ai/self-supervised-learning/
MIT License
3.16k stars 283 forks source link

style: migrate to `ruff` #1564

Open SauravMaheshkar opened 4 months ago

SauravMaheshkar commented 4 months ago

astral-sh/ruff has emerged as a competitor to the existing linters. It's considerably faster than the current linter pylint viz.

Source: ruff repository

Switching to ruff would enable us to switch to a single tool, as it has drop-in parity with black, isort and support for pylint rules.

Happy to open a PR if interested 😄

References:

philippmwirth commented 4 months ago

Great idea, we already use ruff internally. We'd welcome a PR.

TakshPanchal commented 4 months ago

I would like to contribute.

SauravMaheshkar commented 4 months ago

@TakshPanchal sounds good, LMK if you need any help with the PR

TakshPanchal commented 4 months ago

Currently, isort and black is being used right? So I have to pylintrc as reference config. From docs,

Ruff can be configured through a pyproject.toml, ruff.toml, or .ruff.toml file.

So majorly I have to convert pylintrc with one of these file right?

SauravMaheshkar commented 4 months ago

Currently, isort and black is being used right? So I have to pylintrc as reference config. From docs,

Ruff can be configured through a pyproject.toml, ruff.toml, or .ruff.toml file.

So majorly I have to convert pylintrc with one of these file right?

Yes, and let's stick with one single configuration file, so convert pylintrc to a ruff configuration within pyproject.toml.

Ideally the changes lead to no style changes, i.e. running make lint with ruff leads to no changes in code files.

Abhrajitdas02 commented 3 weeks ago

can I work on this issue?

SauravMaheshkar commented 3 weeks ago

Sure, we only assign one issue at a time. So, I'll assign this issue for now. If you want to work on some other issue first, let me know.

SauravMaheshkar commented 1 day ago

@Abhrajitdas02 would you like any help with this issue?