sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.9k stars 618 forks source link

[MNT] move linting to `ruff`, resolve strange linting behaviour #1689

Open fkiraly opened 1 week ago

fkiraly commented 1 week ago

We should move the linting to ruff - good first issue for a maintenance affine contributor.

There are also some strange behaviours in the precommits which I cannot pinpoint, e.g., the linter insisting on long single lines instead of line breaks where they would be appropriate. Though I would hope this is resolved as a side effect of moving to ruff.

airookie17 commented 6 days ago

Hello @fkiraly!

I'm interested in working on this issue and have started setting up ruff to replace the existing linters. Could you please assign this issue to me?

Thank you!

fkiraly commented 4 days ago

Of course! You can look at @fnhirwa's work in sktime in case you need a template.

airookie17 commented 2 days ago

Hello @fkiraly! I'm working on replacing the current linting tools with Ruff. However, I've encountered a situation I'd like to clarify:

I ran the pre-commit hooks using pre-commit run --all-files with the current setup, and all checks passed without showing the "strange behaviors" mentioned in the issue description. I couldn't identify specific instances where the linter is "insisting on long single lines instead of line breaks."

Could you give me more specific examples of the issues you've had? This would help ensure that the new ruff configuration addresses these problems effectively.

In the meantime, I'll go ahead and set up ruff as the new linter. Once implemented, I'll test it thoroughly across the codebase and report back with the results.

Thanks!

fkiraly commented 1 day ago

I couldn't identify specific instances where the linter is "insisting on long single lines instead of line breaks."

That is because all lines are already compliant with the current linting - many files in the code base include lines well in excess of the 79 or even larger bounds on number of characters.

Further, if one tries to add line breaks, the linter resets them to "one line code".