Tidy up noqa comments.

This commit is contained in:
Andrey Rakhmatullin 2024-12-10 14:58:45 +05:00
parent ba30f64268
commit f4d8d6d8ac
4 changed files with 6 additions and 9 deletions

View File

@ -310,7 +310,6 @@ ignore = [
# Issues pending a review:
"docs/conf.py" = ["E402"]
"scrapy/utils/url.py" = ["F403", "F405"]
"tests/CrawlerRunner/change_reactor.py" = ["E402"]
"tests/test_loader.py" = ["E741"]
[tool.ruff.lint.pydocstyle]

View File

@ -17,7 +17,7 @@ class NoRequestsSpider(Spider):
configure_logging({"LOG_FORMAT": "%(levelname)s: %(message)s", "LOG_LEVEL": "DEBUG"})
from scrapy.utils.reactor import install_reactor
from scrapy.utils.reactor import install_reactor # noqa: E402
install_reactor("twisted.internet.asyncioreactor.AsyncioSelectorReactor")
@ -25,7 +25,7 @@ runner = CrawlerRunner()
d = runner.crawl(NoRequestsSpider)
from twisted.internet import reactor
from twisted.internet import reactor # noqa: E402
d.addBoth(callback=lambda _: reactor.stop())
reactor.run()

View File

@ -473,7 +473,7 @@ class S3FeedStorageTest(unittest.TestCase):
class GCSFeedStorageTest(unittest.TestCase):
def test_parse_settings(self):
try:
from google.cloud.storage import Client # noqa
from google.cloud.storage import Client # noqa: F401
except ImportError:
raise unittest.SkipTest("GCSFeedStorage requires google-cloud-storage")
@ -487,7 +487,7 @@ class GCSFeedStorageTest(unittest.TestCase):
def test_parse_empty_acl(self):
try:
from google.cloud.storage import Client # noqa
from google.cloud.storage import Client # noqa: F401
except ImportError:
raise unittest.SkipTest("GCSFeedStorage requires google-cloud-storage")
@ -504,7 +504,7 @@ class GCSFeedStorageTest(unittest.TestCase):
@defer.inlineCallbacks
def test_store(self):
try:
from google.cloud.storage import Client # noqa
from google.cloud.storage import Client # noqa: F401
except ImportError:
raise unittest.SkipTest("GCSFeedStorage requires google-cloud-storage")

View File

@ -273,9 +273,7 @@ class ItemMetaTest(unittest.TestCase):
def f(self):
# For rationale of this see:
# https://github.com/python/cpython/blob/ee1a81b77444c6715cbe610e951c655b6adab88b/Lib/test/test_super.py#L222
return (
__class__ # noqa https://github.com/scrapy/scrapy/issues/2836
)
return __class__
MyItem()