Skip to content

Conversation

@Marvin182
Copy link
Contributor

Unfortunately the Google internal formatting is different from PEP8
(column limit 79 -> 80 and indent width 4 -> 2, a few things around when
and how to split lines). YAPFs own style matches this but is not the default.

YAPF will automatically pick up the config when run anywhere inside the
repository.

@google-cla
Copy link

google-cla bot commented Aug 4, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Aug 4, 2020
Unfortunately the Google internal formating is different from PEP8
(column limit 79 -> 80 and indent width 4 -> 2, a few things around when
and how to split lines). YAPFs own style matches this.

YAPF will automatically pick up the config when run anywhere inside the
repository.
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2020

Codecov Report

Merging #384 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #384   +/-   ##
=======================================
  Coverage   78.76%   78.76%           
=======================================
  Files          34       34           
  Lines        2256     2256           
=======================================
  Hits         1777     1777           
  Misses        479      479           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c799b5d...7bcd502. Read the comment docs.

@google-cla google-cla bot added cla: yes and removed cla: no labels Aug 4, 2020
@Marvin182 Marvin182 mentioned this pull request Aug 4, 2020
@Marvin182 Marvin182 requested a review from levskaya August 6, 2020 08:11
@avital
Copy link
Contributor

avital commented Aug 7, 2020

I think this is great! A few questions:

  1. Is yapf both a formatter and a linter?
  2. Does it integrate with common IDEs like VSCode?
  3. Is the plan to add yapf to some kind of pre-commit hook?

@Marvin182
Copy link
Contributor Author

I think this is great! A few questions:

  1. Is yapf both a formatter and a linter?
    just a formatter. It can fix some things that a linter might complain about but not all.

We probably want 3 things:

  1. Linter. I don't use any.
  2. Formatter that makes it a bit easier to be conform with the linter and have consistent style.
  3. Type checking (internally we use pytype, I think JAX uses mypy)
  1. Does it integrate with common IDEs like VSCode?
    Yes, Dan is using it with VSCode
  1. Is the plan to add yapf to some kind of pre-commit hook?
    No, I think a linter and type checking would be the way to go

@Marvin182 Marvin182 closed this Aug 7, 2020
@Marvin182 Marvin182 reopened this Aug 7, 2020
@Marvin182 Marvin182 merged commit e7f1754 into google:master Aug 7, 2020
@avital
Copy link
Contributor

avital commented Aug 7, 2020

Wouldn't we want to make sure all commits adhere to the same style guide? That way blame always works because you don't catch other people just reformatting a file that they are editing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants