awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.64k stars 755 forks source link

ci: update lints Ruff & docformatter #3130

Closed Borda closed 6 months ago

Borda commented 9 months ago

Issue #, if available: dofformatter gave a false positive signal; it has lots of issues, but as --check was missing, it just fixed without any real code change and so passed green even if it failed, see for example https://github.com/awslabs/gluonts/actions/runs/7975893111/job/21775154024?pr=3130

Description of changes:

validation of the actual Ruff & Docfroatter on the latest codebase

Please tag this pr with at least one of these labels to make our release process faster: this is just fixing the actual linting issue, but the better and ext step shall be #3111

cc: @jaheba @kashif @lostella

Borda commented 9 months ago

I do think that the stile check is related, but anyway would be good to update Black (sending PR #3131) so we better see if it is related :chipmunk:

Borda commented 9 months ago

not sure what Black does not like:

would reformat /home/runner/work/gluonts/gluonts/src/gluonts/maybe.py
would reformat /home/runner/work/gluonts/gluonts/src/gluonts/mx/block/snmlp.py
would reformat /home/runner/work/gluonts/gluonts/src/gluonts/nursery/tsbench/src/tsbench/analysis/utils/misc.py
would reformat /home/runner/work/gluonts/gluonts/src/gluonts/torch/util.py
kashif commented 9 months ago

@Borda unrelated, can you kindly send me an email kashif.rasul@gmail.com I wanted to ask you something about lightning?

Borda commented 7 months ago

@kashif @lostella resolved conflicts, could you pls check it :flamingo:

it would also need to update the required checks, remove flake8 and add lint (ruff) instead

Borda commented 7 months ago

@lostella, thank you for your detailed read and for pointing out all the issues... I will try to address them just to clarify, the docformatter even was running was ignored, so this is just trying to re-enable it properly :)

I think that Ruff's rule D could help here

Borda commented 7 months ago

@lostella, do you have any suggestions on what we should do with the remaining cases? :flamingo:

lostella commented 7 months ago

@Borda just one comment then this can go in 🚀

Borda commented 7 months ago

@lostella committed your suggestion, thx :)

Borda commented 7 months ago

@lostella hope all is fine now, and with this resolved, I could finish the other PR :flamingo:

could you pls replace flake8 with Ruff & Docformat in the required checks?

Borda commented 6 months ago

@lostella, how are you doing? mind have look :)