Implement config subcommand

The synopsis is as follows.

List all top-level config keys:

    $ ruff config
    allowed-confusables
    builtins
    cache-dir
    ... etc.

List all config keys in a specific section:

    $ ruff config mccabe
    max-complexity

Describe a specific config option:

    $ ruff config mccabe.max-complexity
    The maximum McCabe complexity to allow before triggering `C901` errors.

    Default value: 10
    Type: int
    Example usage:
    ```toml
    # Flag errors (`C901`) whenever the complexity level exceeds 5.
    max-complexity = 5
    ```
This commit is contained in:
Martin Fischer 2023-02-11 18:37:11 +01:00 committed by Charlie Marsh
parent bbe44360e8
commit 0e4d5eeea7
5 changed files with 53 additions and 0 deletions

View file

@ -44,6 +44,8 @@ pub enum Command {
#[arg(long, value_enum, default_value = "pretty")]
format: HelpFormat,
},
/// List or describe the available configuration options
Config { option: Option<String> },
/// List all supported upstream linters
Linter {
/// Output format