- Notifications
You must be signed in to change notification settings - Fork262
chore: re-enable ruff warnings#961
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
chore: re-enable ruff warnings#961
Uh oh!
There was an error while loading.Please reload this page.
Conversation
9fa20a9 to33c00b9CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| DEFAULT_ENV_TOKEN_NAME="HVCS_TOKEN"# noqa: S105 | ||
| def__init__(self,remote_url:str,*args:Any,**kwargs:Any)->None: | ||
| def__init__(self,remote_url:str,*args:Any,**kwargs:Any)->None:# noqa: ARG002 |
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.
If you think we can remove**kwargs here, I think we could also use it on the various specific vcs systems that inherit?
I don't think just renaming to**_kwargs is the right fix, but that would also shut up ruff, I think?
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.
This is a dumb error from ruff. yes it is needed as stated above, I'm fine with using the underscore rather than a bunch of ignores.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
33c00b9 tocaa6000CompareUh oh!
There was an error while loading.Please reload this page.
| # Execute in mocked environment expecting a GitlabUpdateError to be raised | ||
| withcreate_release_patch,edit_release_notes_patch,get_release_by_id_patch: | ||
| withcreate_release_patch,edit_release_notes_patch,get_release_by_id_patch:# noqa: SIM117 |
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.
What is this about... seems like aruff bug. gahh i hate using <1.0 released software.
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.
It's the nestedwith; the alternative they suggest is to dowith A() as a, B() as b:, but of course that would look pretty messy here, since the first line is 3 separate items....
https://docs.astral.sh/ruff/rules/multiple-with-statements/
If the raises could be a decorator, maybe that would look better, but I think just ignoring it is probably fine here?
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.
Well the doc doesn't consider this situation for creation of the context manger is multiple lines and prior to the with statement.
Yes, ignore is fine here.
c153971 to0ea9062Compare
codejedi365 left a comment
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.
see comments above.
0ea9062 todb73750Comparedb73750 tof7be6faCompareHaving the `--diff` flag in `ruff check` seems to suppress failures fromhappening in CI
f7be6fa toce5a891Compare
codejedi365 left a comment
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.
Looking better
Co-authored-by: codejedi365 <codejedi365@users.noreply.github.com>
ce5a891 toc3c0603Comparewyardley commentedJun 20, 2024
just noting here, I poked at this some more to create the bug report upstream, and the behavior doeskind of make sense... it's just confusing It may be worth adding |
codejedi365 commentedJun 21, 2024
Thanks for looking into this, definitely is a weird result. Either way all I want is it to display where the error is located. The diff is a nice to have where it shows what to fix but I can also look up the rule for where it indicates an error exists. |
wyardley commentedJun 21, 2024
Yeah, re-reading the docs for I think in this case "report on" also implies the exit status as well, in other words, because I agree that things are fine as it is now. It would be nice to have a way to both report the fixable changes as a diff, and also check for findings, with a single command, but seems like not possible as-is. Short of some additional notes in the docs, or adding some additional flags, might be difficult to fix as well. |
Uh oh!
There was an error while loading.Please reload this page.
Having the
--diffflag inruff checkseems to suppress failures from happening in CI. Remove the--diffflag, and then ignore or adjust to resolve the remainingrufffailures. This will help prevent new ruff errors from going unnoticed and getting checked in, at the expense of a little bit of clutter in the code.Note: this can be merged with the two atomic commits, or squashed as one.
We should probably do this after#957 goes in (may require a little conflict resolution on one file)