Skip to content

Cannot set config option with struct type from command-line #13995

@LordAro

Description

@LordAro

While trying out some adhoc testing, I ran the following:

ruff check --extend-select=PT --config 'lint.flake8-pytest-style="csv"'

which resulted in the error:

error: invalid value 'lint.flake8-pytest-style="csv"' for '--config <CONFIG_OPTION>'

  tip: A `--config` flag must either be a path to a `.toml` configuration file
       or a TOML `<KEY> = <VALUE>` pair overriding a specific configuration
       option

Could not parse the supplied argument as a `ruff.toml` configuration option:

invalid type: string "csv", expected struct Flake8PytestStyleOptions
in `lint`

For more information, try '--help'

according to the tip (and the help text) it should work, but... doesn't. I'm not sure if there is a format where it does work, but if nothing else it's unclear.

I can imagine this applies to other options that use this form, but this is the only one I've found.

Ruff: 0.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command-line interfacehelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions