From c2f16d649b46b154f4af45310067fb3a414065c4 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 28 Nov 2017 11:44:47 -0500 Subject: [PATCH] Better yapf setting to fulfill PEP257 D202 pep257: D202 / No blank lines allowed after function docstring (found 1) Disable this yapf feature beacuse of PEP257 --- .pre-commit-config.yaml | 1 + .style.yapf | 2 +- readthedocs/oauth/services/base.py | 1 - readthedocs/oauth/services/gitlab.py | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b713b46410c..bc363b1e931 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,7 @@ repos: - id: yapf exclude: 'migrations|settings|scripts' additional_dependencies: ['futures'] + args: ['--style=.style.yapf', '--parallel'] - repo: git@github.com:FalconSocial/pre-commit-python-sorter.git sha: b57843b0b874df1d16eb0bef00b868792cb245c2 diff --git a/.style.yapf b/.style.yapf index 3b41722a8b2..14cf5c70108 100644 --- a/.style.yapf +++ b/.style.yapf @@ -26,7 +26,7 @@ ALLOW_MULTILINE_DICTIONARY_KEYS=False # # <------ this blank line # def method(): # ... -BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True +BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=False # Insert a blank line before a class-level docstring. BLANK_LINE_BEFORE_CLASS_DOCSTRING=True diff --git a/readthedocs/oauth/services/base.py b/readthedocs/oauth/services/base.py index 4e812e512af..839007e712e 100644 --- a/readthedocs/oauth/services/base.py +++ b/readthedocs/oauth/services/base.py @@ -111,7 +111,6 @@ def token_updater(self, token): u'expires_at': 1449218652.558185 } """ - def _updater(data): token.token = data['access_token'] token.expires_at = datetime.fromtimestamp(data['expires_at']) diff --git a/readthedocs/oauth/services/gitlab.py b/readthedocs/oauth/services/gitlab.py index ed1f5bc979d..f80fc002fda 100644 --- a/readthedocs/oauth/services/gitlab.py +++ b/readthedocs/oauth/services/gitlab.py @@ -121,7 +121,6 @@ def create_repository( :type organization: RemoteOrganization :rtype: RemoteRepository """ - def is_owned_by(owner_id): return self.account.extra_data['id'] == owner_id