mirror of https://github.com/scrapy/scrapy.git
Fix and re-enable unnecessary-comprehension and use-dict-literal pylint tags
This commit is contained in:
parent
532cc8a517
commit
63acd07209
2
pylintrc
2
pylintrc
|
|
@ -68,7 +68,6 @@ disable=abstract-method,
|
|||
too-many-public-methods,
|
||||
too-many-return-statements,
|
||||
unbalanced-tuple-unpacking,
|
||||
unnecessary-comprehension,
|
||||
unnecessary-dunder-call,
|
||||
unnecessary-pass,
|
||||
unreachable,
|
||||
|
|
@ -77,7 +76,6 @@ disable=abstract-method,
|
|||
unused-private-member,
|
||||
unused-variable,
|
||||
unused-wildcard-import,
|
||||
use-dict-literal,
|
||||
used-before-assignment,
|
||||
useless-return,
|
||||
wildcard-import,
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class HttpCompressionMiddleware:
|
|||
respcls = responsetypes.from_args(
|
||||
headers=response.headers, url=response.url, body=decoded_body
|
||||
)
|
||||
kwargs = dict(cls=respcls, body=decoded_body)
|
||||
kwargs = {"cls": respcls, "body": decoded_body}
|
||||
if issubclass(respcls, TextResponse):
|
||||
# force recalculating the encoding until we make sure the
|
||||
# responsetypes guessing is reliable
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class CrawlSpider(Spider):
|
|||
url=link.url,
|
||||
callback=self._callback,
|
||||
errback=self._errback,
|
||||
meta=dict(rule=rule_index, link_text=link.text),
|
||||
meta={"rule": rule_index, "link_text": link.text},
|
||||
)
|
||||
|
||||
def _requests_to_follow(self, response):
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ def re_rsearch(
|
|||
pattern = re.compile(pattern)
|
||||
|
||||
for chunk, offset in _chunk_iter():
|
||||
matches = [match for match in pattern.finditer(chunk)]
|
||||
matches = list(pattern.finditer(chunk))
|
||||
if matches:
|
||||
start, end = matches[-1].span()
|
||||
return offset + start, offset + end
|
||||
|
|
|
|||
Loading…
Reference in New Issue