scrapy-lint documentation
scrapy-lint is a linter for Scrapy projects.
To install:
pip install scrapy-lint
To run:
scrapy-lint
Some issues can be fixed automatically. Such issues are marked with [*] in
the output, and you can apply their fixes with the --fix option:
scrapy-lint --fix
Output is colored when writing to a terminal. Set NO_COLOR to disable
colors, or FORCE_COLOR to keep them when redirecting output.
To use with pre-commit, add the following to your
.pre-commit-config.yaml:
- repo: https://github.com/scrapy/scrapy-lint
rev: v0.1.1
hooks:
- id: scrapy-lint
Can be combined with ruff, mypy, pylint and flake8-requirements.
Supported versions
If your project uses any of the following packages, scrapy-lint expects at least these versions of them. With an older version, scrapy-lint may misreport issues and fail to report others. See SCP14 for details.
Package |
Minimum version |
|---|---|
Scrapy |
2.0.1 |
scrapy-zyte-api |
0.5.1 |
scrapy-zyte-smartproxy |
2.0.0 |