Skip to content

Conversation

@alok
Copy link
Contributor

@alok alok commented May 16, 2018

This is just a preview of one style. If you like the look of it, give it a
thumbs up.

Chrome is an established project with thousands of contributors, and none of
them complain about this style.

Most of the uglier changes relating to line breaks are easily fixed by adding
the appropriate trailing comma to indicate to YAPF that you desire a line break.

Related issue number

#1971

alok and others added 15 commits April 30, 2018 20:02
Any options not set in the config file defer to pep8.
This runs faster thanks to the `--parallel` flag and YAPF's builtin features.

It's also a little clearer (IMO), and was run through `shellcheck` to harden up
against a few of bash's many gotchas.

It also actually uses the .style.yapf in the project repo, which was previously ignored.
cd to parent of script, then use git to find its own root.
format with yapf --style pep8 to satisfy travis
1.  rm useless cd's
2.  Unquote array since it turns out checking the truthiness of an array
    is a real pain in bash and is best done in Python or something.
3.  rm useless `exit 0` since scripts exit with the status of the last
    command anyway.
Added some trailing commas to make certain blocks neater. This style uses more
vertical space but is (IMO) significantly more readable for a lot of code since
you can just sort of scan each block independently since they're clearly
delineated from each other.

Feel free to revert to the last commit
It's better to have the occasional long line than to have very odd looking
code. The codebase has long lines anyway, so it's not like they're totally
verboten.
This should hopefully prevent some of the odder formatting.
This style looks fine to me and doesn't generally have a bunch of whitespace. A
few trailing commas to split lines correctly and it should be satisfactory to
everyone.
@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/5426/
Test PASSed.

@alok alok closed this May 19, 2018
@alok alok deleted the yapf-chromium branch May 21, 2018 10:03
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 this pull request may close these issues.

3 participants