-
-
Notifications
You must be signed in to change notification settings - Fork 64
Lint codebase with ruff (and substitute black)
#580
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
Conversation
…to ruff # Conflicts: # docs/conf.py # drawBot/context/tools/imageObject.py # scripting/imageObjectCodeExtractor.py # tests/testImageObject.py
|
Thanks! Not a big fan of autocommit, and I would prefer a pre-commit based approach that does apply fixes. What I do in other projects:
Ideally I would like to see two separate PRs:
|
|
on my way : ) |
|
I would convert this one to PR1 and open another one for GHA |
justvanrossum
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.
I left a few minor comments. LGTM, apart from the test failure.
|
I'll wait for this one to be merged before working on the github actions logic. |
justvanrossum
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.
LGTM
|
@typemytype, shall we merge soon? I fear it will cause merge conflicts if we don't. Case in point: #582. |
|
Sure, this is awesome! Is there a PR merge order? |
No... In this case, If we merge PR A first, PR B will (likely) have a conflict. Maybe merge this one first. |
|
im ooo, but I agree with Just, let's merge the linted code first, I'll work on the hook and workflow next week : ) |
|
(Oooh we got lucky: there was no merge conflict!) |
|
thanks @roberto-arista !! |
|
ty! |
Hey!
Here's a PR with my implementation proposal for ruff in the drawBot codebase. In a nutshell:
lint.ymlfile with instructions to format the code and auto-commit it back to the codebasetest.ymlneeds to start once the auto-commit is completed (workflow_run section)ruff.tomlconfiguration fileruff-apipackage that allows callingrufffrom the python codebase to substituteblack(application menu > python > format code)I've had mixed results with triggering one action from another when writing back some changes in the repo, we might explore different options eventually. Also, the ruff-api would like to have a filename to format the code (I guess for imports?), have a look at the FIXME here: drawBot/ui/drawBotController.py
That's it, let me know what you think!
👋