Skip to content

Commit f033d26

Browse files
authored
Enable pylint doclinters (#10)
* Enabling docstring linters * Updated docstring text
1 parent e2edf79 commit f033d26

File tree

5 files changed

+40
-17
lines changed

5 files changed

+40
-17
lines changed

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ persistent=no
2020

2121
# List of plugins (as comma separated values of python modules names) to load,
2222
# usually to register additional checkers.
23-
load-plugins=
23+
load-plugins=pylint.extensions.docparams,pylint.extensions.docstyle
2424

2525
# Use multiple processes to speed up Pylint.
2626
jobs=1
@@ -65,7 +65,7 @@ enable=indexing-exception,old-raise-syntax
6565
# --enable=similarities". If you want to run only the classes checker, but have
6666
# no Warning level messages displayed, use"--disable=all --enable=classes
6767
# --disable=W"
68-
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,file-ignored
68+
disable=design,similarities,no-self-use,attribute-defined-outside-init,locally-disabled,star-args,pointless-except,bad-option-value,global-statement,fixme,suppressed-message,useless-suppression,locally-enabled,file-ignored,missing-type-doc
6969

7070

7171
[REPORTS]

firebase_admin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize_app(credential=None, options=None, name=_DEFAULT_APP_NAME):
2828
name: Name of the app (optional).
2929
3030
Returns:
31-
A newly initialized instance of App.
31+
App: A newly initialized instance of App.
3232
3333
Raises:
3434
ValueError: If the app name is already in use, or any of the
@@ -92,7 +92,7 @@ def get_app(name=_DEFAULT_APP_NAME):
9292
name: Name of the App instance to retrieve (optional).
9393
9494
Returns:
95-
An App instance.
95+
App: An App instance with the given name.
9696
9797
Raises:
9898
ValueError: If the specified name is not a string, or if the specified

firebase_admin/auth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_token_generator(app):
5151
app: A Firebase App instance (or None to use the default App).
5252
5353
Returns:
54-
A _TokenGenerator instance.
54+
_TokenGenerator: A _TokenGenerator for the specified App instance.
5555
5656
Raises:
5757
ValueError: If the app argument is invalid.
@@ -73,7 +73,7 @@ def create_custom_token(uid, developer_claims=None, app=None):
7373
app: An App instance (optional).
7474
7575
Returns:
76-
A token string minted from the input parameters.
76+
string: A token minted from the input parameters.
7777
7878
Raises:
7979
ValueError: If input parameters are invalid.
@@ -93,7 +93,7 @@ def verify_id_token(id_token, app=None):
9393
app: An App instance (optional).
9494
9595
Returns:
96-
A dict consisting of the key-value pairs parsed from the decoded JWT.
96+
dict: A dictionary of key-value pairs parsed from the decoded JWT.
9797
9898
Raises:
9999
ValueError: If the input parameters are invalid, or if the App was not
@@ -140,7 +140,7 @@ def create_custom_token(self, uid, developer_claims=None):
140140
developer_claims: A dictionary of claims to be included in the token.
141141
142142
Returns:
143-
A token string minted from the input parameters.
143+
string: A token string minted from the input parameters.
144144
145145
Raises:
146146
ValueError: If input parameters are invalid.
@@ -195,7 +195,7 @@ def verify_id_token(self, id_token):
195195
id_token: A string of the encoded JWT.
196196
197197
Returns:
198-
A dict consisting of the key-value pairs parsed from the decoded JWT.
198+
dict: A dictionary of key-value pairs parsed from the decoded JWT.
199199
200200
Raises:
201201
ValueError: The app was not initialized with a credentials.Certificate instance.

firebase_admin/credentials.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ class Base(object):
1414
"""Provides OAuth2 access tokens for accessing Firebase services."""
1515

1616
def get_access_token(self):
17-
"""Fetches a Google OAuth2 access token using this credential instance.
18-
19-
Returns:
20-
An oauth2client.client.AccessTokenInfo instance
21-
"""
17+
"""Fetches a Google OAuth2 access token using this credential instance."""
2218
raise NotImplementedError
2319

2420
def get_credential(self):
@@ -76,9 +72,18 @@ def service_account_email(self):
7672
return self._service_account_email
7773

7874
def get_access_token(self):
75+
"""Fetches a Google OAuth2 access token using this certificate credential.
76+
77+
Returns:
78+
oauth2client.client.AccessTokenInfo: An access token obtained via oauth2client.
79+
"""
7980
return self._g_credential.get_access_token(_http)
8081

8182
def get_credential(self):
83+
"""Returns the underlying Google credential.
84+
85+
Returns:
86+
oauth2client.client.GoogleCredentials: An oauth2client credential instance."""
8287
return self._g_credential
8388

8489

@@ -96,9 +101,18 @@ def __init__(self):
96101
self._g_credential = client.GoogleCredentials.get_application_default()
97102

98103
def get_access_token(self):
104+
"""Fetches a Google OAuth2 access token using this application default credential.
105+
106+
Returns:
107+
oauth2client.client.AccessTokenInfo: An access token obtained via oauth2client.
108+
"""
99109
return self._g_credential.get_access_token(_http)
100110

101111
def get_credential(self):
112+
"""Returns the underlying Google credential.
113+
114+
Returns:
115+
oauth2client.client.GoogleCredentials: An oauth2client credential instance."""
102116
return self._g_credential
103117

104118

@@ -143,7 +157,16 @@ def refresh_token(self):
143157
return self._refresh_token
144158

145159
def get_access_token(self):
160+
"""Fetches a Google OAuth2 access token using this refresh token credential.
161+
162+
Returns:
163+
oauth2client.client.AccessTokenInfo: An access token obtained via oauth2client.
164+
"""
146165
return self._g_credential.get_access_token(_http)
147166

148167
def get_credential(self):
168+
"""Returns the underlying Google credential.
169+
170+
Returns:
171+
oauth2client.client.GoogleCredentials: An oauth2client credential instance."""
149172
return self._g_credential

firebase_admin/jwt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def encode(payload, signer, headers=None):
5757
headers: An dictionary of headers (optional).
5858
5959
Returns:
60-
A signed JWT token as a string
60+
string: A signed JWT token.
6161
"""
6262
header = {'typ': 'JWT', 'alg': 'RS256'}
6363
if headers:
@@ -86,7 +86,7 @@ def decode(token):
8686
token: A signed JWT token as a string.
8787
8888
Returns:
89-
A 2-tuple where the first element is a dictionary of JWT headers,
89+
tuple: A 2-tuple where the first element is a dictionary of JWT headers,
9090
and the second element is a dictionary of payload claims.
9191
9292
Raises:
@@ -118,7 +118,7 @@ def verify_id_token(id_token, cert_uri, audience=None, kid=None, http=None):
118118
http: An httplib2 HTTP client instance.
119119
120120
Returns:
121-
A dictionary of claims extracted from the ID token.
121+
dict: A dictionary of claims extracted from the ID token.
122122
123123
Raises:
124124
ValueError: Certificate URI is None or empty.

0 commit comments

Comments
 (0)