astral-sh / ruff

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

`generate-shell-completion` is a valid `ruff` command, but is not listed in `ruff help` #12092

Open tpgillam opened 3 months ago

tpgillam commented 3 months ago

As-of ruff 0.4.10, I've observed that:

Personally I think it would aid discoverability to add it to the list in the top-level ruff help listing.

zanieb commented 3 months ago

I believe this is intentionally hidden, perhaps because it's only intended to be run once? I'm not sure.

MichaReiser commented 3 months ago

Not a very good reason but I think one reason is that generate-shell-completion kind of messes with the ruff --help layout. But we could solve this by shortening the command name to completion or shell-completion.

What's interesting is that gt also doesn't show the completion command when running gt --help. It only shows it when entering an invalid command.

tpgillam commented 3 months ago

What's interesting is that gt also doesn't show the completion command when running gt --help. It only shows it when entering an invalid command.

Probably a silly question - what program is gt please? :) A web search isn't helping me much.

MichaReiser commented 3 months ago

Oh sorry. It's graphite CLI.

tpgillam commented 3 months ago

Being somewhat pedantic, I did notice that docs/configuration.md says that ruff help gives the "full list" of top-level commands, so if deciding to hide this command then perhaps this should be modified to "gives a subset of the top-level commands"!

At least to my taste, I like the guarantee of the 'full list' though.