mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Implement shell autocompletion for rule codes
For example: $ ruff check --select=EM<Tab> EM -- flake8-errmsg EM10 EM1 -- EM101 -- raw-string-in-exception EM102 -- f-string-in-exception EM103 -- dot-format-in-exception (You will need to enable autocompletion as described in the Autocompletion section in the README.) Fixes #2808. (The --help help change in the README is due to a clap bug, for which I already submitted a fix: https://github.com/clap-rs/clap/pull/4710.)
This commit is contained in:
parent
ca49b00e55
commit
70e378b736
5 changed files with 86 additions and 7 deletions
|
@ -57,6 +57,7 @@ pub fn register_rules(input: &Input) -> proc_macro2::TokenStream {
|
|||
PartialOrd,
|
||||
Ord,
|
||||
AsRefStr,
|
||||
::strum_macros::IntoStaticStr,
|
||||
)]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum Rule { #rule_variants }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue