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

fix: remove useless and unknown Pylint options #247

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
80 changes: 1 addition & 79 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -55,86 +55,15 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
redefined-builtin,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
arguments-differ,
dangerous-default-value,
logging-fstring-interpolation
Expand Down Expand Up @@ -326,13 +255,6 @@ max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
2 changes: 1 addition & 1 deletion slo_generator/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ def process_batch_req(request, data, config):
client.publish(topic_path, data=data).result()
else: # http
LOGGER.info(f'Sending {url} to HTTP batch handler.')
requests.post(service_url, headers=headers, data=url)
requests.post(service_url, headers=headers, data=url, timeout=10)
6 changes: 4 additions & 2 deletions slo_generator/exporters/cloudevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

LOGGER = logging.getLogger(__name__)


# pylint: disable=too-few-public-methods
class CloudeventExporter:
"""Cloudevent exporter class.
Expand Down Expand Up @@ -55,11 +56,12 @@ def export(self, data, **config):
id_token = None
if 'token' in auth:
id_token = auth['token']
elif auth.get('google_service_account_auth', False): # Google oauth
elif auth.get('google_service_account_auth', False): # Google oauth
auth = google.auth.transport.requests.Request()
id_token = fetch_id_token(auth, service_url)
if id_token:
headers["Authorization"] = f'Bearer {id_token}'
resp = requests.post(service_url, headers=headers, data=data)
resp = requests.post(service_url, headers=headers, data=data,
timeout=10)
resp.raise_for_status()
return resp