danielgtaylor / danielgtaylor/python-betterproto

Use Ruff on generated code (can replace isort)

Open
#488 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.8k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

https://beta.ruff.rs

Config example:
```toml
# pyproject.toml

[tool.ruff]
# https://beta.ruff.rs/docs/rules
line-length = 88 # Default
select = ["ALL"]
ignore = [
# "D203",
# "D213",
"D",
"RUF009", # See `extend-immutable-calls`
"ERA001", # Detects comments as code
# "A003", # See `builtins-ignorelist`
"UP006", # https://github.com/danielgtaylor/python-betterproto/issues/485
]

[tool.ruff.flake8-builtins]
builtins-ignorelist = ["id", "type"]

[tool.ruff.flake8-bugbear]
# https://github.com/charliermarsh/ruff/issues/4355
extend-immutable-calls = ["betterproto.*"]
```

It's possible to have it only emulate isort, but I've tried to enable as much as possible from it, which is still incredibly fast.

Can be run as `ruff check --fix`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.