Skip to content

Commit a94b6b7

Browse files
committed
Merge pull request #92 from box/pylint
Updates to code to pass pylint newest version.
2 parents 726dc0a + da00ad5 commit a94b6b7

File tree

21 files changed

+70
-47
lines changed

21 files changed

+70
-47
lines changed

.pylintrc

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
# pygtk.require().
88
#init-hook=
99

10-
# Profiled execution.
11-
profile=no
12-
1310
# Add files or directories to the blacklist. They should be base names, not
1411
# paths.
1512
#ignore=CVS
@@ -68,20 +65,13 @@ reports=no
6865
# (RP0004).
6966
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
7067

71-
# Add a comment according to your evaluation note. This is used by the global
72-
# evaluation report (RP0004).
73-
comment=no
74-
7568
# Template used to display messages. This is a python new-style format string
7669
# used to format the massage information. See doc for all details
7770
msg-template={module}:{line}:{column}: [{msg_id}({symbol}), {obj}] {msg}
7871

7972

8073
[BASIC]
8174

82-
# Required attributes for module, separated by a comma
83-
required-attributes=
84-
8575
# List of builtins function names that should not be used, separated by a comma
8676
bad-functions=map,filter,apply,input
8777

@@ -131,6 +121,8 @@ no-docstring-rgx=__.*__
131121
# ones are exempt.
132122
docstring-min-length=-1
133123

124+
# Maximum number of nested blocks for function / method body
125+
max-nested-blocks=6
134126

135127
[FORMAT]
136128

@@ -180,10 +172,6 @@ ignore-mixin-members=yes
180172
#ignored-classes=SQLObject
181173
ignored-classes=pytest, _pytest
182174

183-
# When zope mode is activated, add a predefined set of Zope acquired attributes
184-
# to generated-members.
185-
zope=no
186-
187175
# List of members which are set dynamically and missed by pylint inference
188176
# system, and so shouldn't trigger E0201 when accessed. Python regular
189177
# expressions are accepted.
@@ -206,10 +194,6 @@ additional-builtins=
206194

207195
[CLASSES]
208196

209-
# List of interface methods to ignore, separated by a comma. This is used for
210-
# instance to not check methods defines in Zope's Interface base class.
211-
ignore-iface-methods=
212-
213197
# List of method names used to declare (i.e. assign) instance attributes.
214198
defining-attr-methods=__init__,__new__,setUp
215199

boxsdk/auth/jwt_auth.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# coding: utf-8
22

33
from __future__ import unicode_literals
4-
from cryptography.hazmat.backends import default_backend
5-
from cryptography.hazmat.primitives import serialization
4+
65
from datetime import datetime, timedelta
7-
import jwt
86
import random
97
import string
8+
9+
from cryptography.hazmat.backends import default_backend
10+
from cryptography.hazmat.primitives import serialization
11+
import jwt
12+
1013
from .oauth2 import OAuth2
1114
from boxsdk.util.compat import total_seconds
1215

boxsdk/auth/oauth2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ def access_token(self):
9292

9393
def get_authorization_url(self, redirect_url):
9494
"""
95-
Get the authorization url based on the client id and the redirect url, passed in
95+
Get the authorization url based on the client id and the redirect url passed in
9696
9797
:param redirect_url:
9898
An HTTPS URI or custom URL scheme where the response will be redirected. Optional if the redirect URI is
9999
registered with Box already.
100100
:type redirect_url:
101101
`unicode` or None
102102
:return:
103-
A tuple of the URL of Boxs authorization page and the CSRF token.
103+
A tuple of the URL of Box's authorization page and the CSRF token.
104104
This is the URL that your application should forward the user to in first leg of OAuth 2.
105105
:rtype:
106106
(`unicode`, `unicode`)

boxsdk/auth/redis_managed_oauth2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# coding: utf-8
22

33
from __future__ import unicode_literals
4+
5+
from uuid import uuid4
6+
47
from redis import StrictRedis
58
from redis.lock import Lock
6-
from uuid import uuid4
9+
710
from boxsdk import JWTAuth, OAuth2
811

912

boxsdk/network/default_network.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import unicode_literals
44

5-
import requests
65
import time
76

7+
import requests
8+
89
from .network_interface import Network, NetworkResponse
910

1011

boxsdk/object/search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import unicode_literals
44

5+
import json
6+
57
from .base_endpoint import BaseEndpoint
68
from boxsdk.util.translator import Translator
7-
import json
89

910

1011
class MetadataSearchFilter(object):

boxsdk/util/log.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ def setup_logging(stream_or_file=None, debug=False, name=None):
3131
"""
3232
logger = logging.getLogger(name)
3333
if isinstance(stream_or_file, string_types):
34-
handler = logging.FileHandler(stream_or_file, mode='w')
34+
logger.addHandler(logging.FileHandler(stream_or_file, mode='w'))
3535
else:
36-
handler = logging.StreamHandler(stream_or_file or sys.stdout)
37-
logger.addHandler(handler)
36+
logger.addHandler(logging.StreamHandler(stream_or_file or sys.stdout))
3837
logger.setLevel(logging.DEBUG if debug else logging.INFO)
3938
return logger

test/functional/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# coding: utf-8
22

33
from __future__ import unicode_literals
4+
5+
import re
6+
47
from mock import patch
58
import pytest
6-
import re
79
import requests
810
import six
911
from six.moves.urllib import parse # pylint:disable=import-error, no-name-in-module
12+
1013
from boxsdk.auth.oauth2 import OAuth2
1114
from boxsdk.config import API
1215
from boxsdk.client import Client

test/functional/mock_box/behavior/event_behavior.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# coding: utf-8
22

33
from __future__ import division, unicode_literals
4-
from bottle import request
4+
55
from datetime import datetime, timedelta
6-
from sqlalchemy import event
76
from threading import Event
7+
8+
from bottle import request
9+
from sqlalchemy import event
10+
811
from test.functional.mock_box.db_model.event_model import EventModel
912
from test.functional.mock_box.db_model.file_model import FileModel
1013
from test.functional.mock_box.db_model.folder_model import FolderModel

test/functional/mock_box/behavior/file_behavior.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# coding: utf-8
22

33
from __future__ import unicode_literals
4-
from bottle import response, request
4+
55
from hashlib import sha1
6+
7+
from bottle import response, request
68
from sqlalchemy.orm import make_transient
9+
710
from test.functional.mock_box.behavior.item_behavior import ItemBehavior
811
from test.functional.mock_box.db_model.event_model import EventModel
912
from test.functional.mock_box.db_model.file_model import FileModel

0 commit comments

Comments
 (0)