model-card-toolkit icon indicating copy to clipboard operation
model-card-toolkit copied to clipboard

Prefer single quote strings model-card-toolkit

Open codesue opened this issue 1 year ago • 2 comments

Currently, model-card-toolkit uses both single quotes and double quotes for strings. Update the codebase to use single quote strings so that we have consistent style across the project.

Update yapf lint tooling to prefer single quote strings (if possible).

codesue avatar May 21 '23 22:05 codesue

Thank you @codesue for linking the yapf issue. The issue is open for 3+ years and the consensus is

use black to change the quote and then use yapf to make it format the way you want.

Should we use black before yapf?

hanneshapke avatar May 21 '23 23:05 hanneshapke

black prefers double quote strings over single quote strings. https://github.com/psf/black/issues/118

I prefer single quote strings and they're consistent with a lot of other tensorflow org projects, but I wouldn't be a blocker if others prefer double quote strings and if there's tooling to format the code so I don't have to think about it.

black refuses to support 2-space indents, though, so I wonder if it'll be more trouble than it's worth. https://github.com/psf/black/issues/378

codesue avatar May 22 '23 00:05 codesue