Skip to content

Conversation

SamuelMarks
Copy link
Collaborator

Description

pyink had 130k downloads last month whereas ruff had 89M. ruff is faster—being written in Rust—and has more configuration options. All the Python communities are switching to this. In the future; and this PR sets the groundwork; would like to switch to ruff over pylint for lint checking also. After that either Rust-written ty (same folks as ruff) or Pyrefly from Meta for type checking; as the pytype we've been using is deprecated (see google/pytype/issues/1838).

Related: #2210

As you can see the code has changed a little, because it takes indentation seriously. You want two-spaces? - Then that will be enforced throughout. Personally I prefer 4 spaces, but it seems that Google takes 2 spaces religiously so that's what this enforces.

PS: Rather than updating in this PR, can we just remove code_style.sh now that we have proper pre commit hooks?

Tests

N/A

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

…] Add new ruff dependency ; limit it to just checking the formatting ; disable `pyink` ; [.pre-commit-hooks.yaml] Enable the new hook ; disable `pyink`
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.

1 participant