-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
&yarnabrina [MNT] switch to ruff
as linting tool
#6676
Conversation
Few comments
|
I don't think so as
I am running it locally and will get all failures fixed before marking this PR as ready for review.
I agree with this I am getting it disabled and will also request a review on what to disable once the PR is in a good state.
Yeah going to add the |
That's not necessary. Now here's a point of discussion: does it make sense to have both ruff and black as formatters? ruff linter has been for a while and it's quite standard now, but the formatter is quite new. Should we replace |
Even if rules correspond, what I realize that we also need to think about downstream developer workflows. E.g., how will the instructions for linting change, see https://www.sktime.net/en/latest/developer_guide/coding_standards.html - and would we be breaking downstream environment setups? Cannot see how, but just putting this for discussion as a point of consideration. |
I propose that if we decide to completely use ruff we could also update the document for coding standards with our |
ruff
as the linting toolruff
as the linting tool
small note, I just switched to the PR and updated from I also noted that max line length is reduced to 79, I think we should leave it at 88 or we will have loads of code to reformat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff
supports notebooks as well (reference https://docs.astral.sh/ruff/faq/#does-ruff-support-jupyter-notebooks), so we should consider whether to replace nbqa
linting hooks as well.
I am not sure what is the difference between using ruff
directly on *.ipynb
files and using with nbqa
, may be you know @fnhirwa @sktime/core-developers ?
Yeah I read that ruff support |
If this is approved then I would start to update the developer |
I rebased your branch and was about to force push some commits, but it seems you pushed more. I'll wait it out in case CI starts passing.
Please start, I'll review if CI passes. Main review is of course the suppressed messages, as I assume there are no/little manual changes. If you made some manual changes that affect logic or can be considered subjective, can you point out those please? |
Co-authored-by: Anirban Ray <39331844+yarnabrina@users.noreply.github.com>
sktime/performance_metrics/forecasting/probabilistic/_classes.py
Outdated
Show resolved
Hide resolved
Any idea why this CI is stuck for so long? |
This is something common for macOS runners I recall to see this on many PRs |
Yes, I think macos runners are weaker in resources: As a consequence, they tend to be "behind" the other operating systems when there are multiple CI jobs in the queue. With the new test setup, I think the tests run faster than PR are being created, but not on macos, so I have to regularly skip/cancel and test merged batches at once, around releases. |
Is this ready? Assuming the macos tests pass. |
from my end it is, I would like to wait for @yarnabrina confirmation |
I don't have any major feedbacks. Few choices of configurations and skips I'm slightly unhappy about, but overall looks good to me. (Subject to successful CI, of course) |
ok - failures are all sporadic or timeout related (known and unrelated to this PR). I see the docs are included here, so good from my side. |
ruff
as linting toolruff
as linting tool
This PR adds ruff as a linting tool and keeps black in our lint configuration.
Also did a run against all files and corrected the failures.
The main changes are due to the deprecation of usage of
Tuple
List
Dict
andSet
as type annotations being replaced bytuple
list
dict
andset
respectively.closes #6677
closes #5316
closes #6636
depends on #6331