astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
30.82k stars 1.02k forks source link

Show version log for changes on rules #11369

Open inoa-jboliveira opened 4 months ago

inoa-jboliveira commented 4 months ago

Context: Discussion https://github.com/astral-sh/ruff/discussions/11367

The idea is that each rule should have a history or log of when it was added as preview, when it became stable and when it had changes in behavior. Also the version if it became deprecated or removed.

Example:

Rule FOO123 v0.1.2 - Added as experimental v0.2.7 - Behavior changed for classes with letter J v0.3.0 - Rule became stable v0.3.2 - Rule deprecated in favor of BAR999 v0.4.0 - Rule removed

This page https://docs.astral.sh/ruff/rules/ could show which minor version the rule became stable if it is stable or the patch version if it is still experimental:

Code Name Message Availability
FOO201 class-comparison-one Checks when class is compared to function 0.2 ✔️ 🛠️
FOO202 class-comparison-two Checks when class is compared to method 0.3.4 🧪 🛠️

In our application we have preview = true because we are moving quite fast with ruff iterations and even experimental ruff rules are usually much better than relying on other linters. Having this would help a lot on us prioritizing rules that been experimental for longer or that have been added on versions that our devs have installed already.

zanieb commented 4 months ago

We'd need to design internal tooling to make this possible.