Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bouweandela
Copy link
Contributor

Adjust yapf so its PEP8 style follows PEP8 regarding blank lines around class methods. Quote from PEP8:

Method definitions inside a class are surrounded by a single blank line.

Closes #744

@google-cla google-cla bot added the cla: yes label Aug 20, 2021
@coveralls
Copy link

coveralls commented Aug 20, 2021

Coverage Status

Coverage remained the same at 92.977% when pulling b517596 on bouweandela:blank-lines-surround-methods into da0dbb3 on google:main.

@bwendling
Copy link
Member

Thanks! Please update the CHANGELOG as well.

@bouweandela
Copy link
Contributor Author

Thanks! I updated the changelog.

@bwendling bwendling merged commit 5fda04e into google:main Aug 23, 2021
@bouweandela bouweandela deleted the blank-lines-surround-methods branch August 23, 2021 20:17
Codym48 added a commit to Codym48/cmake_saver that referenced this pull request Mar 13, 2022
This is more consistent with PEP8. There was a bug in yapf 0.28.0
through 0.31.0 that led to this setting being false by default for
based_on_style=pep8. google/yapf#954 updated yapf to default
blank_line_before_nested_class_or_def to true to correctly insert
this blank line.

Rather than explicitly set blank_line_before_nested_class_or_def
to true, just update the offending file and leave that line missing
from the configuration. This will fail yapf formatting with yapf
< 0.32.0 but should allow us to stay more pep8 compliant if there
are future changes to these settings.
Andrea-Oliveri pushed a commit to Andrea-Oliveri/yapf that referenced this pull request Aug 13, 2025
…ngle blank line (google#954)

* PEP8: Method definitions inside a class are surrounded by a single blank line.

* Add changelog entry for "pep8" style update
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.

yapf 0.28.0 now removes blank line between class docstring and first function

4 participants