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

skip_magic_trailing_comma = true config file support #2606

Closed
adamjstewart opened this issue Nov 13, 2021 · 2 comments
Closed

skip_magic_trailing_comma = true config file support #2606

adamjstewart opened this issue Nov 13, 2021 · 2 comments
Labels
C: configuration CLI and configuration R: not a bug This is deliberate behavior of Black. T: user support OP looking for assistance or answers to a question

Comments

@adamjstewart
Copy link

Is your feature request related to a problem? Please describe.

One of the reasons I use black is so that I can focus on code without having to focus on style. #1824 introduced a --skip-magic-trailing-comma flag to further control style. However, there's no way to set this flag in a config file, so the file format will change depending on whether or not a contributor uses the flag.

Describe the solution you'd like

I would like to be able to set this in a config file like pyproject.toml:

[tool.black]
skip_magic_trailing_comma = true

Describe alternatives you've considered

I could alias black to black --skip-magic-trailing-comma, but that only affects me, not other users who contribute to my library.

Additional context

@hauntsaninja opening an issue as you suggested. I dug around a bit in the code but couldn't figure out how config file parsing works.

@Jackenmen
Copy link
Contributor

The above configuration works for me, are you using an up-to-date version of Black?

@adamjstewart
Copy link
Author

Huh, I swear this wasn't working when I tried a month ago, but it's working now. Maybe I was using an older version of black. Thanks for your help!

@ichard26 ichard26 added C: configuration CLI and configuration R: not a bug This is deliberate behavior of Black. T: user support OP looking for assistance or answers to a question and removed T: enhancement New feature or request labels Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: configuration CLI and configuration R: not a bug This is deliberate behavior of Black. T: user support OP looking for assistance or answers to a question
Projects
None yet
Development

No branches or pull requests

3 participants