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

Use Ruff for linting #3089

Merged
merged 6 commits into from
Jun 16, 2023
Merged

Use Ruff for linting #3089

merged 6 commits into from
Jun 16, 2023

Conversation

stchris
Copy link
Contributor

@stchris stchris commented May 23, 2023

https://github.com/charliermarsh/ruff replaces flake8 + black (and can also auto-fix lots of things).

$ time make lint
ruff check .
make lint  0.01s user 0.03s system 47% cpu 0.091 total

@stchris stchris changed the title Ruff Use Ruff for linting May 23, 2023
Comment on lines 38 to 39
- name: Run linter (ruff)
uses: chartboost/ruff-action@v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the advantage of using this action over just make lint (which will now call ruff, too)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None, I guess. I will change it to be consistent, making sure we use the same version we have pinned.

Makefile Outdated
Comment on lines 35 to 37
format:
black aleph/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but black doesn’t replace a formatter, right?

As a project, Ruff is designed to be used alongside Black and, as such, will defer implementing stylistic lint rules that are obviated by autoformatting.

https://beta.ruff.rs/docs/faq/#is-ruff-compatible-with-black

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally right, my bad. Reverting this.

Copy link
Contributor

@tillprochaska tillprochaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two comments/questions, but in general, I like ruff and am fine with whatever tooling everyone else prefers :)

@stchris
Copy link
Contributor Author

stchris commented May 27, 2023

Thanks for your careful review and great comments. I've made the changes and adapted the corresponding ingest-file PR as well. 👍

Copy link
Contributor

@tillprochaska tillprochaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@stchris stchris merged commit 1e82349 into main Jun 16, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants