-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Documentation: Comparison between Black and WPS #1196
Comments
Black intentionally has very few options. See https://github.com/psf/black#command-line-options.
Yes, see
No, but you can use |
@hugovk what about preserving trailing commas in lists and objects (since that is a convention adopted by many projects)? |
If it's not in the documentation, then no. I think there is a PR related to trailing commas, but I don't think there'll be an option. |
@hugovk would like to see the PR exist though, since that would allow maximum compatibility with WPS, turning it into a powerhouse. Also some have suggested that the max line length limit needs to be hardened (see wemake-services/wemake-python-styleguide#518 and wemake-services/wemake-python-styleguide#890 ) |
It strikes me that https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/auto-formatters.html#black is out of date, because according to the Black docs (emphasis mine):
|
Is it possible to enforce trailing commas instead of removing them? Assuming that that are out-of-date and that we are trying to be WPS-compliant (since they stated that https://github.com/asottile/add-trailing-comma is perfect for WPS)? Also if you are free, is it possible for us to collaborate over at the Issue page in WPS? |
@DonaldTsang According to the add-trailing-comma readme, it does exactly the same thing as Black for one-line lists:
|
@ferdnyc if you are free, is it possible for us to collaborate over at the Issue page in WPS? Also @hugovk is it possible for us to "force" single quotes instead of just allowing single quotes? It should be simple to regex Have anyone tested this statment's validity yet?
|
No, this has been discussed many times and it's unlikely Black will change. You could use the |
@DonaldTsang The info I posted here is the same information (it turns out) that @uhbif19 included when opening wemake-services/wemake-python-styleguide#890 over two months ago. Seems to me the problem isn't that information is needed, it's that it needs to be acted on by someone involved in WPS. I have nothing more to add, really. |
@hugovk is it possible to make the fixer a plugin to black or a separate program? Not everyone uses pre-commit hooks in their workflow. |
Not as a plugin to Black, but you can run pre-commit as a standalone tool without actually using installing the pre-commit hooks. See the CI in this repo, for example. |
You can use |
@ambv Can you confirm the edited documentation in https://hackmd.io/3vzJNofVQ_G0aS_QWwvLQA in case I make any errors? Also to @ferdnyc there has been more discoveries with such incompatibilities wemake-services/wemake-python-styleguide#890 (comment) |
Please do not tag me on this issue, I have no desire to be involved any further. |
This is partially true, the comments about Black's usage of double quotes and unstable trailing comma enforcement are valid. What is not valid is the comment about line length. There is a way to configure it, it can be done via Also a slight nitpick, |
@ichard26 I think I have redacted that specific line in the HackMD document prior to your comment. Other than that, I think that there might be tools to switching from enforcing single quotes to enforcing double quotes like "double-quote-string-fixer". |
@DonaldTsang, sorry about that, I was looking the version hosted at readthedocs since it looked better formatted and for other reasons... oops.. Anyway, technically it LGTM. Original comment about |
As wemake-services/wemake-python-styleguide#1059 have noted
(and as https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/auto-formatters.html#black have referenced), there are a few noticeable difference between Black and WeMake Python StyleGuide. Here are some questions:
The text was updated successfully, but these errors were encountered: