Skip to content
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

Setup linting #379

Open
kesara opened this issue Jan 23, 2024 · 3 comments · May be fixed by #406
Open

Setup linting #379

kesara opened this issue Jan 23, 2024 · 3 comments · May be fixed by #406
Labels
contractor Ask contractor to do it

Comments

@kesara
Copy link
Member

kesara commented Jan 23, 2024

Set up linting with flake8 / black.

@kesara kesara added the contractor Ask contractor to do it label Jan 23, 2024
@mgax
Copy link
Contributor

mgax commented Mar 25, 2024

We have been using ruff at Torchbox lately, as a replacement for both flake8 and black (they recently added support for code formatting), with good results. It's much faster, has more configuration options, and replaces multiple tools with a single one. Is there a strong preference to use flake8 and black?

@rjsparks
Copy link
Member

There is a preference for black, because it isn't configurable. I've not noticed black being slow - are the speed differences in replacing flake8? I have no qualms replacing flake8.

Does ruff undo some of the heavy-handed "there is only one way" formatting rules that are at the core of black's principles?

@mgax
Copy link
Contributor

mgax commented Mar 27, 2024

Does ruff undo some of the heavy-handed "there is only one way" formatting rules that are at the core of black's principles?

It does provide more options, but the defaults aim to be compatible with black:

Ruff’s formatter aims to be drop-in compatible with Black out-of-the-box — which means great defaults with zero configuration. But it does expose a few additional settings.

I'd argue there is no meaningful downside to using the ruff formatter with the default settings, perhaps with a comment in its configuration block to the effect of we stick to black's formatting rules, please don't tweak the settings, and a link to the styleguide (which, in turn, would document a preference for black-style formatting).

@mgax mgax linked a pull request Apr 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contractor Ask contractor to do it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants