Fix remaining flake8 issues

Disabling W504 and W605 for now as there are too many instances.
This commit is contained in:
Chih-Hsuan Yen 2019-10-27 21:00:01 +08:00
parent 18173a5951
commit 84fb52d0a2
No known key found for this signature in database
GPG Key ID: 0453A6CA23C56315
10 changed files with 28 additions and 35 deletions

View File

@ -1,5 +1,5 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import logging # import logging
# logging.getLogger('boto').setLevel(logging.CRITICAL) # logging.getLogger('boto').setLevel(logging.CRITICAL)
__title__ = 'moto' __title__ = 'moto'

View File

@ -96,11 +96,11 @@ class CloudWatchResponse(BaseResponse):
extended_statistics = self._get_param('ExtendedStatistics') extended_statistics = self._get_param('ExtendedStatistics')
dimensions = self._get_param('Dimensions') dimensions = self._get_param('Dimensions')
if unit or extended_statistics or dimensions: if unit or extended_statistics or dimensions:
raise NotImplemented() raise NotImplementedError()
# TODO: this should instead throw InvalidParameterCombination # TODO: this should instead throw InvalidParameterCombination
if not statistics: if not statistics:
raise NotImplemented("Must specify either Statistics or ExtendedStatistics") raise NotImplementedError("Must specify either Statistics or ExtendedStatistics")
datapoints = self.cloudwatch_backend.get_metric_statistics(namespace, metric_name, start_time, end_time, period, statistics) datapoints = self.cloudwatch_backend.get_metric_statistics(namespace, metric_name, start_time, end_time, period, statistics)
template = self.response_template(GET_METRIC_STATISTICS_TEMPLATE) template = self.response_template(GET_METRIC_STATISTICS_TEMPLATE)

View File

@ -1,7 +1,5 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import re import re
import six
import re
from collections import deque from collections import deque
from collections import namedtuple from collections import namedtuple
@ -221,7 +219,6 @@ class ConditionExpressionParser:
# -------------- # --------------
LITERAL = 'LITERAL' LITERAL = 'LITERAL'
class Nonterminal: class Nonterminal:
"""Enum defining nonterminals for productions.""" """Enum defining nonterminals for productions."""
@ -240,7 +237,6 @@ class ConditionExpressionParser:
RIGHT_PAREN = 'RIGHT_PAREN' RIGHT_PAREN = 'RIGHT_PAREN'
WHITESPACE = 'WHITESPACE' WHITESPACE = 'WHITESPACE'
Node = namedtuple('Node', ['nonterminal', 'kind', 'text', 'value', 'children']) Node = namedtuple('Node', ['nonterminal', 'kind', 'text', 'value', 'children'])
def _lex_condition_expression(self): def _lex_condition_expression(self):
@ -290,7 +286,6 @@ class ConditionExpressionParser:
raise ValueError("Cannot parse condition starting at: " + raise ValueError("Cannot parse condition starting at: " +
remaining_expression) remaining_expression)
value = match_text
node = self.Node( node = self.Node(
nonterminal=nonterminal, nonterminal=nonterminal,
kind=self.Kind.LITERAL, kind=self.Kind.LITERAL,
@ -351,7 +346,6 @@ class ConditionExpressionParser:
'size', 'size',
} }
if name.lower() in reserved: if name.lower() in reserved:
# e.g. AND # e.g. AND
nonterminal = reserved[name.lower()] nonterminal = reserved[name.lower()]
@ -755,7 +749,6 @@ class ConditionExpressionParser:
else: # pragma: no cover else: # pragma: no cover
raise ValueError("Unknown operand: %r" % node) raise ValueError("Unknown operand: %r" % node)
def _make_op_condition(self, node): def _make_op_condition(self, node):
if node.kind == self.Kind.OR: if node.kind == self.Kind.OR:
lhs, rhs = node.children lhs, rhs = node.children

View File

@ -15,5 +15,5 @@ commands =
nosetests {posargs} nosetests {posargs}
[flake8] [flake8]
ignore = E128,E501 ignore = E128,E501,W504,W605
exclude = moto/packages,dist exclude = moto/packages,dist