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

brunette is not changing to single quotes #5

Closed
svaningelgem opened this issue Jun 26, 2020 · 9 comments · Fixed by #14
Closed

brunette is not changing to single quotes #5

svaningelgem opened this issue Jun 26, 2020 · 9 comments · Fixed by #14

Comments

@svaningelgem
Copy link
Contributor

brunette . --target-version py36 --config setup.cfg (within the checked out brunette repo).
==> All single quotes are changed into double quotes.

Very likely this is because black is starting some kind of daemon process in which the black module is re-loaded... Causing the single-quote implementation you had to be ignored (again).

@richardARPANET
Copy link
Contributor

Is this fixed by #4 or it is a separate issue?

@svaningelgem
Copy link
Contributor Author

No, this is a separate issue; hence the different ticket :). I didn't really have an easy way to fix this as I did not dig too deep into how black is working.

@richardARPANET
Copy link
Contributor

Maybe there's a way to disable that daemon process to avoid this.

@richardARPANET
Copy link
Contributor

@svaningelgem When I run your example above, single quotes are used to format the files. Can you provide another working example to reproduce this one?

@mmulich
Copy link
Contributor

mmulich commented Aug 24, 2020

I run into this problem as well. It's inconsistent though... I'm using pre-commit and occasionally need to uninstall get the commit through then re-install. It's a real PITA. But I've not been able to find any pattern to the behavior.

@mmulich
Copy link
Contributor

mmulich commented Aug 24, 2020

I've attached the case that is failing for me. It's a slimmed down set of changes that pre-commit (the executor of brunette) is stumbling over.

$ unzip brunette-issue-5.zip
$ cd brunette-issue-5
$ brunette . --config setup.cfg
All done! ✨ 🍰 ✨
4 files left unchanged.

brunette-issue-5.zip

@mmulich
Copy link
Contributor

mmulich commented Sep 8, 2020

Correct me if I'm wrong, but this is a critical flaw that can't be fixed...

Any monkey patching you do at the start of brunette is lost due to processes being started in the background (all new memory space). Without some cooperation from the black code this can't be solved. Right?

@richardARPANET
Copy link
Contributor

richardARPANET commented Sep 23, 2020

@mmulich Anything is possible :) This can be updated to just batch the 'black' source code (on disk) worse case, I just don't have time to do it at the moment. Hopefully soon though.

@mmulich
Copy link
Contributor

mmulich commented Dec 16, 2020

I put together a small fix for this in #14. But as I mention there, it forces everyone into serial execution mode. Maybe that's not a huge issue... 🤷🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants