-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add ruff, black & isort configs #6382
Conversation
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.
Seems reasonable.
Not mandated, but for use if wanted (e.g. using "format selection" in IDEs). Chosen defaults that best match our current style.
7a7a612
to
24f444f
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.
Should be uncontroversial as it's basically just documenting what we do already.
We should probably sync this change to other repos in time 🤷 (I too have my own local .isort
config to allow me to autoformat code selections in my test editor).
I often find myself typing out some code that wouldn't pass flake8, then hitting "format selection" or "organise imports" in VSCode. I am using isort and ruff for this (having briefly used black before ruff).
I think it would be useful to define our configs for these tools on a project level so we can agree the style and avoid unnecessary diff resulting from this going forwards.
I've chosen defaults that I think best match our current prevailing style. If we want to haggle over this, make it brief!
To illustrate, I've ruffened/blackened and isorted
pathutil.py
as a small example.Check List
CONTRIBUTING.md
and added my name as a Code Contributor.?.?.x
branch.