-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rewrite ecosystem checks and add ruff format
reports
#8223
Conversation
0202efd
to
ea0602a
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no linter changes. ✅ ecosystem check detected no format changes. |
fd7fc90
to
5f1ef59
Compare
dddeffe
to
2f1b233
Compare
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.
I heaven't read all the code but I find it much easier to quickly identify the relevant code parts that are responsible or X compared to before.
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.
very clean code!
|
||
def __add__(self, other: Self) -> Self: | ||
if not isinstance(other, type(self)): | ||
return NotImplemented |
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.
nit:
return NotImplemented | |
return TypeError |
That's TRY004 :P
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.
I think not here https://docs.python.org/3.11/library/constants.html#NotImplemented
Although raise TypeError
would be fine, this is "more correct"
That means a lot if comes from @konstin ! |
f5a8feb
to
63f1122
Compare
Fixes bug where `total_affected_rules` is empty, a division by zero error can occur if there are only errors and no rule changes. Calculates the maximum display per rule with the calculated project maximum as the upper bound instead of 50, this should show more rule variety when project maximums are lower. This commit was meant to be in #8223 but I missed it.
Changes the title and adds some notes re the old formatter ecosystem checks in light of #8223 Does not remove it as I'm not sure where else we test for instabilities.
Closes #7239
scripts/check_ecosystem.py
into a new Python project atpython/ruff-ecosystem
ruff-ecosystem
CLIruff check
report included "fixable" summary lineruff check
reportsruff format
reportsruff format
reports, which format with the baseline then the useformat --diff
to generate a reportKnown problems
git diff
and some wonky hunk matching to recover the original line numbers but it doesn't seem worth it. I think we should probably commit the formatted changes to a fork or something if we want great results here. Consequently, I've just used the start line instead of a range for now.pr-comment
workflow is an absolute pain to change because it runs separately from this pull request so I if I want to make edits to it I can only test it via manual workflow dispatch.Future work
ruff-ecosystem
to support non-default projects andcheck_ecosystem_all.py
behavior