-
Notifications
You must be signed in to change notification settings - Fork 654
Move YAPF style setting to a project-wide .style.yapf file
#1038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [style] | ||
| based_on_style = google | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -72,7 +72,7 @@ for changed_file in ${changed_files}; do | |||||
| ) | ||||||
| if [[ "${changed_line_ranges}" != "--lines=0-0 " ]]; then | ||||||
| # Do the formatting. | ||||||
| results=$(yapf --style=google --diff "${changed_file}" ${changed_line_ranges}) | ||||||
| results=$(yapf --diff "${changed_file}" ${changed_line_ranges}) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with
Suggested change
|
||||||
|
|
||||||
| # Print colorized error messages. | ||||||
| if [ ! -z "${results}" ]; then | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,8 +28,7 @@ | |||||
| lines = cell.get('source') | ||||||
| # This will safely skip over cells containing !% magic | ||||||
| try: | ||||||
| fmt_lines = yapf.yapf_api.FormatCode(''.join(lines), | ||||||
| style_config="google")[0] | ||||||
| fmt_lines = yapf.yapf_api.FormatCode(''.join(lines))[0] | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When using the
Suggested change
|
||||||
| except (SyntaxError, yapf.yapflib.errors.YapfError): | ||||||
| continue | ||||||
| # google style always adds an EOF newline; undo this. | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.