Openlibrary: Quote formatting for python

Created on 5 Feb 2020  路  9Comments  路  Source: internetarchive/openlibrary

Question

Do we want to use single or double quotes? Let's decide on something and find a way to enforce it so we don't have to manually make changes like this.

Additional context

See comments here: https://github.com/internetarchive/openlibrary/pull/2968 ; summary:

  • @hornc python console print strings using single quotes
  • @cdrini + @cclauss : Python Software Foundation is recommending psf/black, which use double quotes.

Stakeholders

@hornc @cclauss

@mekarpeles Linting Community Discussion 3 Development Question

All 9 comments

I think getting an automated tool like black to work for us would be really advantageous, since it's an easy "set it and forget it" deal. Anything else would require a bunch of configuration, which is what we currently have for our JS/CSS: https://github.com/internetarchive/openlibrary/blob/master/.eslintrc.json ; https://github.com/internetarchive/openlibrary/blob/master/.stylelintrc.json .

psf/black, which use single quotes.

No! That's backwards. psf/black insists on double quotes although it can be disabled with the (not recommended) --skip-string-normalization flag.

I've corrected the description (and fixed the link to black)

:+1: My bad! Typo'd

It seems like the consensus here is for double quotes:

  • Double quotes: @cdrini @cclauss @mekarpeles
  • Single quotes: @hornc

Any final comments/votes? (@tfmorris not sure which you're in support of)

Thanks for driving this issue.

Noticing the feedback from the community (the vote seems pretty clear). My top priority is making sure we don't go back and forth on PRs (and get something solidified as lint/process).

In support of the vote, let's go with double quotes and follow psf/black.

Community Decision:

Double quotes

Ah, we posted at the same time :P Re-opening to see if there's any more feedback; otherwise let's merge in a few days.

sgtm, apologies about that @tfmorris -- didn't mean to jump the gun and exclude your vote. This thread was re-cactylzed by a PR which @cclauss opened (which changed single to double quotes) and I was trying to drive for some decision to unblock the review. Happy w/ @cdrini's decision to keep this open and get more feedback. For now, asking @cclauss to separate the style/lint changes in their PR. Provisionally assuming (unless there's additional feedback) based on the current votes that we'll be moving to double quotes.

Abstain

Ok, thanks, re-closing the issue w/ the above resolution

Was this page helpful?
0 / 5 - 0 ratings