Skip to content
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

Make boolean configuration options overridable #301

Open
7 tasks
akaihola opened this issue Feb 21, 2022 · 1 comment
Open
7 tasks

Make boolean configuration options overridable #301

akaihola opened this issue Feb 21, 2022 · 1 comment
Labels
enhancement New feature or request many-formatters Support for multiple code formatters and skipping formatting

Comments

@akaihola
Copy link
Owner

akaihola commented Feb 21, 2022

Currently if a boolean option is toggled on in pyproject.toml, there's no way to toggle it off on the command line. To fix this, the following options should be introduced:

  • --no-stdout
  • --no-isort
  • updated help texts
  • unit tests

Design decisions needed:

  • option to do neither --diff nor --check?
  • --no-lint <LINTER> (maybe?)
  • --no-skip-magic-trailing-comma (or: --magic-trailing-comma?)

See also:

@akaihola akaihola added the enhancement New feature or request label Feb 21, 2022
@akaihola akaihola added this to the 1.5.0 milestone Feb 21, 2022
@akaihola akaihola added this to To do in Akaihola's Open source work via automation Feb 21, 2022
@akaihola
Copy link
Owner Author

akaihola commented Apr 1, 2022

I'm actually not so sure about moving to click (see #47). If Darker moves towards being a generic reformatter/linter front-end (see #304), we might not necessarily have click installed as a dependency from another installed package. And argparse is currently serving us well.

And boolean options can be made togglable both ways with argparse as well.

I guess --myoption / --no-myoption would be a fair syntax. It also would mirror this from Black:

 --color / --no-color            Show colored diff. Only applies when
                                 `--diff` is given.

These options could be added for reversing configuration options from pyproject.toml:

  • --no-diff
  • --no-stdout
  • --no-isort
  • --no-lint <LINTER> maybe, for turning individual linters off by matching the <LINTER> string exactly?
  • --no-skip-magic-trailing-comma

@akaihola akaihola modified the milestones: 1.5.0, 1.5.1, 1.6.0 Apr 5, 2022
@akaihola akaihola modified the milestones: 1.6.0, 1.6.1, 1.8.0 Dec 19, 2022
@akaihola akaihola added the many-formatters Support for multiple code formatters and skipping formatting label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request many-formatters Support for multiple code formatters and skipping formatting
Projects
Development

No branches or pull requests

1 participant