Skip to content
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

Removing wrong-import-position Pylint ignore statements. #1255

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions gcloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@

from gcloud.environment_vars import PROJECT

# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
app_identity = None
# pylint: enable=wrong-import-position


_NOW = datetime.datetime.utcnow # To be replaced by tests.
Expand Down
2 changes: 0 additions & 2 deletions gcloud/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
class _GAECreds(object):
"""Dummy class if not in App Engine environment."""

# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
Expand All @@ -41,7 +40,6 @@ class _GAECreds(object):
from gcloud._helpers import UTC
from gcloud._helpers import _NOW
from gcloud._helpers import _microseconds_from_datetime
# pylint: enable=wrong-import-position


def get_credentials():
Expand Down
11 changes: 11 additions & 0 deletions pylintrc_default
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ load-plugins=pylint.extensions.check_docs
# return int(value)
# else:
# return float(value)
# - wrong-import-position: This error is overzealous. It assumes imports are
# completed whenever something non-trivial is
# defined, e.g.
# try:
# from foo import Bar
# except ImportError:
# class Bar(object):
# """Hi everyone"""
# and thus causes subsequent imports to be
# diagnosed as out-of-order.
disable =
maybe-no-member,
no-member,
Expand All @@ -94,6 +104,7 @@ disable =
star-args,
method-hidden,
redefined-variable-type,
wrong-import-position,


[REPORTS]
Expand Down