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

Rule documentation link does not work with lower case code #15016

Open
DaniBodor opened this issue Dec 16, 2024 · 2 comments
Open

Rule documentation link does not work with lower case code #15016

DaniBodor opened this issue Dec 16, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@DaniBodor
Copy link
Contributor

When trying to load a specific rule's documentation page using a the lower case letter for that rule (e.g. https://docs.astral.sh/ruff/rules/f401), I get a 404 - Not Found.
After loading the page once using an uppercase letter instead (which does work), if I then try it again with the lowercase, my browser (Firefox) automatically corrects the lowercase to the uppercase and the site does load.
It might be nice to make the mirror work immediately in a case insensitive manner.

@AlexWaygood AlexWaygood added the documentation Improvements or additions to documentation label Dec 16, 2024
@dhruvmanila dhruvmanila changed the title documentation mirror does not work with lower case letters Rule documentation link does not work with lower case code Dec 17, 2024
@dhruvmanila
Copy link
Member

Yeah, I noticed this last week and I was wondering if this should be allowed because the rule selection wouldn't allow lowercase either (select = ["f401"] doesn't work). The same argument can be applied to rule names as well as it only works with lower case names so https://docs.astral.sh/ruff/rules/Unused-Import doesn't work.

@DaniBodor
Copy link
Contributor Author

What would be the argument not to allow it?
I guess formally you're right that it's an "invalid" rule code, but I don't think there's any level of confusion of what is intended when a user inputs a rule code with a lower case letter.
I find it convenient to type the rule code without worrying about the capitalization, and have now a few times been surprised as to why it doesnt always work (until I discovered that it'll only work if I've been on that page before).

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
Projects
None yet
Development

No branches or pull requests

3 participants