Closed jscotka closed 3 years ago
Why does the check convert single quotes to double quotes? What's wrong with the single quote style strings?
Why does the check convert single quotes to double quotes? What's wrong with the single quote style strings?
I do not have idea, but probably it is more pythonish :-) or there is some python best practice rule to use "
when possible and not '
yeah, black is opinionated, on the other hand one does not care about style problems anymore :(
When it comes down to '
vs "
it's just preference (even according to PEP8). Either is fine but one should be consistent and use the same type across the code (with the exception of using quotes inside the string, then you may use the other type to avoid escaping the quotes). We use them rather inconsistently in tmt/fmf :/ Black apparently forces double quotes
yeah, black is opinionated, on the other hand one does not care about style problems anymore :(
Right, and it is what I like, why to care about formatting, when there exist tooling like autopep
, black
or similar tools.
And finally it also helps you to understand these rules, because you see therese changes. connection with pre-commit helps you to focus on coding, not this bureaucracy :-)
I don't think this is about bureaucracy, but readability counts. It's very true that we read the code much more many times than writing it. So it makes a perfect sense to me to have a beautiful code ;-) I've experimented a bit with black
and ran into a couple important problems which did not convince me about the benefits.
Let's make the pre-commit
setup consistent with tmt
. I'll re-use this pull request for that.
Need a non-fork pull request to test the pre-commit
config directly. Covered by #137.
ideally in another PR fix all other issues (
pre-commit run --all
):