scrapy/scrapy/utils
Albert Eduardovich N. 58d85282cf
chore: more ruff rules and overall minor improvements (#7386)
* overall prettyfication

- don't create empty mutable containers (lists, dicts) where it is appropriate
- removed from ignore section and applied some rules from ruff (but keep them ignored in tests)
- use `deque` in `_AsyncCooperatorAdapter` instead of `list.pop(0)`
- remove `f` prefix from strings without any formatting

* return `SIM300` to ignore

* apply ruff rules to all files

* another one

* remove extra space in pyproject.toml

* simplify `__getattr__` in `scrapy.utils.url`

* lazy `url_is_from_any_domain` and `url_is_from_spider`

* improve typing

* specify `arg_to_iter` with None as arg
2026-04-03 19:00:13 +05:00
..
__init__.py mv scrapy/trunk to root as part of svn2hg migration 2009-05-06 15:55:17 -03:00
_compression.py Restore brotlicffi support (#7160) 2025-11-25 12:06:55 +05:00
_deps_compat.py TLS code modernization (#7353) 2026-03-25 15:42:43 +05:00
_download_handlers.py Move TLS logging from _ScrapyClientTLSOptions to handlers. (#7387) 2026-04-01 16:02:55 +05:00
asyncgen.py Support asynchronous start requests (#6729) 2025-05-07 19:04:03 +02:00
asyncio.py Docs for the reactorless mode (#7385) 2026-04-01 20:40:34 +05:00
benchserver.py Disable mypy allow_untyped_calls. (#7331) 2026-03-24 10:31:17 +01:00
boto.py Bump tool versions. (#6941) 2025-07-05 10:30:30 +02:00
conf.py Remove Python 3.9 support (#7121) 2025-10-27 12:37:49 +01:00
console.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
curl.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
datatypes.py Move to mypy --strict with exceptions. (#7300) 2026-03-02 15:47:23 +05:00
decorators.py asyncio alternative to deferToThread() (#7349) 2026-03-24 15:41:15 +01:00
defer.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
deprecate.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
display.py Bump tool versions. (#6941) 2025-07-05 10:30:30 +02:00
engine.py Bump ruff, fix some of rules (#7277) 2026-02-23 11:48:38 +01:00
ftp.py Add parameters to typing.IO. 2024-05-31 21:41:27 +05:00
gz.py Mitigate brotli and deflate decompression bombs DoS (#7134) 2025-11-17 14:21:50 +05:00
httpobj.py Remove --keep-runtime-typing from pyupgrade. 2024-10-17 21:26:02 +05:00
iterators.py Exclude deprecated code from coverage. (#7241) 2026-02-06 09:15:07 +01:00
job.py Remove --keep-runtime-typing from pyupgrade. 2024-10-17 21:26:02 +05:00
log.py Move to mypy --strict with exceptions. (#7300) 2026-03-02 15:47:23 +05:00
misc.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
ossignal.py Remove Python 3.9 support (#7121) 2025-10-27 12:37:49 +01:00
project.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
python.py Fix arbitrary callable execution from the Referrer-Policy response header 2026-01-19 16:44:03 +01:00
reactor.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
reactorless.py Rename TWISTED_ENABLED to TWISTED_REACTOR_ENABLED. (#7394) 2026-04-02 10:20:54 +02:00
request.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
response.py Fix get_meta_refresh to correctly resolve relative URLs using <base> tag (#7047) 2025-09-10 15:17:16 +02:00
serialize.py Remove code deprecated in 2.12.0 (#7126) 2025-10-27 17:14:38 +05:00
signal.py Bump ruff, fix some of rules (#7277) 2026-02-23 11:48:38 +01:00
sitemap.py Bump tool versions. (#6941) 2025-07-05 10:30:30 +02:00
spider.py Update tool versions (#7127) 2025-10-27 14:11:31 +01:00
ssl.py Move TLS logging from _ScrapyClientTLSOptions to handlers. (#7387) 2026-04-01 16:02:55 +05:00
template.py Remove --keep-runtime-typing from pyupgrade. 2024-10-17 21:26:02 +05:00
test.py Rename TWISTED_ENABLED to TWISTED_REACTOR_ENABLED. (#7394) 2026-04-02 10:20:54 +02:00
testproc.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
testsite.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
trackref.py improve trackref (#7375) 2026-04-03 15:15:30 +05:00
url.py chore: more ruff rules and overall minor improvements (#7386) 2026-04-03 19:00:13 +05:00
versions.py Move to mypy --strict with exceptions. (#7300) 2026-03-02 15:47:23 +05:00