-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docstring code formatter: add a --docstring-code-format
parameter to ruff format
CLI
#9186
Comments
--docstring-code-format
parameter to the CLI--docstring-code-format
parameter to ruff format
CLI
Hy @kdeldycke Thanks for opening this issue and explaining your use case. We've been hesitant to expose all formater options because the main benefit of a formatter is consistency and it requires that all users use the same configuration, ideally commited in the repository. We only support Unfortunately, we haven't made progress with implementing a generic way to pass option values yet which, understandably, is unsatisfying for users. I don't think there's a good workaround for use case at the moment. You could specify another configuration but it would override all other settings too (and disables the automatic configuration discovery). Related to: |
Thanks @MichaReiser for the detailed explanation of the current state of the CLI. I totally understand the priority and decision of my feature request. There are things way more important to focus on. In the mean time, I hacked my way into generating a custom local |
Another use case to consider, is using CLI parameters to setting up Ruff VScode extension: |
This will be supported once #9186 is merged |
…9599) Fixes #8368 Fixes #9186 ## Summary Arbitrary TOML strings can be provided via the command-line to override configuration options in `pyproject.toml` or `ruff.toml`. As an example: to run over typeshed and respect typeshed's `pyproject.toml`, but override a specific isort setting and enable an additional pep8-naming setting: ``` cargo run -- check ../typeshed --no-cache --config ../typeshed/pyproject.toml --config "lint.isort.combine-as-imports=false" --config "lint.extend-select=['N801']" ``` --------- Co-authored-by: Micha Reiser <micha@reiser.io> Co-authored-by: Zanie Blue <contact@zanie.dev>
…stral-sh#9599) Fixes astral-sh#8368 Fixes astral-sh#9186 ## Summary Arbitrary TOML strings can be provided via the command-line to override configuration options in `pyproject.toml` or `ruff.toml`. As an example: to run over typeshed and respect typeshed's `pyproject.toml`, but override a specific isort setting and enable an additional pep8-naming setting: ``` cargo run -- check ../typeshed --no-cache --config ../typeshed/pyproject.toml --config "lint.isort.combine-as-imports=false" --config "lint.extend-select=['N801']" ``` --------- Co-authored-by: Micha Reiser <micha@reiser.io> Co-authored-by: Zanie Blue <contact@zanie.dev>
Following the implementation of experimental docstring format, a
docstring-code-format
configuration "knob" has been added in #8854. That way you can activate this new behavior by adding the following toruff.toml
(or any equivalent):What I would like to have is a
--docstring-code-format
CLI option that I can use like so:Why? Because I would like to test the docstring formatter on some projects, by the way of reuseable GitHub actions. And for these projects, I do not have the authority on the configuration files. I can only alter CLI parameters of ruff in the actions.
Is my proposal reasonable? Or is there a way I can pass arbitrary local configuration parameters via the CLI?
The text was updated successfully, but these errors were encountered: