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

Determine how to convey the availablity of preview-only fixes #8075

Open
zanieb opened this issue Oct 19, 2023 · 1 comment
Open

Determine how to convey the availablity of preview-only fixes #8075

zanieb opened this issue Oct 19, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation preview Related to preview mode features

Comments

@zanieb
Copy link
Member

zanieb commented Oct 19, 2023

We intend for some fixes to only be available in preview, e.g. #8073 and #7934 but then rules will be displayed as fixable in the documentation without indication that it is only fixable with preview enabled. We worry this will be confusing.

@zanieb zanieb added documentation Improvements or additions to documentation preview Related to preview mode features labels Oct 19, 2023
@zanieb zanieb mentioned this issue Oct 19, 2023
@Avasam
Copy link

Avasam commented Oct 28, 2023

I was just about to open a new issue about a rule being documented with "Fix is always available." (https://docs.astral.sh/ruff/rules/unnecessary-builtin-import/).


On the rule page itself, I think you could have:
"Fix is always available" / "Fix is sometimes available" / (no fix available)
and separately mention that "Some fixes are marked unsafe by default"

I don't think it's necessary to mention that "All fixes are unsafe". But at a user I wouldn't mind being a touch more exact. As long as it is show that I need to run --unsafe-fixes to get all the available fixes.


As for the "all rules" page.
You could differentiate between "sometimes autofixable" and "always autofixable" with 🔨 or 🔧, it's visually just 🛠️ but with a tool missing. I personally quite like that.

As for fix safety, I'm less certain of the best way to display that / convey the information concisely. I think that adding a column should be fine.
The first thing that comes to mind is ⚠️, but it looks out of place/scary even when grayed out:
image
Other suggestions may include ⁉, 🚦, or just annotating the autofix with *, or even get fancy with it with a set-width column (or a 0-width element translated to the right position):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation preview Related to preview mode features
Projects
None yet
Development

No branches or pull requests

2 participants