A Fast Alternative to Pylint R0801
说明与用途
Arid 是一个快速的 Python 代码重复检测工具,替代 Pylint R0801,提升 CI 性能并提供结构化输出。
问题
Duplicate code detection (Pylint R0801) is slow and adds unnecessary overhead when only that check is needed.
结果
Arid is 191–250× faster than Pylint for duplicate-code detection, enabling fast local feedback and structured CI reporting without the overhead of a full linter.
工作流
- 1. Install Ruff and Arid (e.g., via uv or pip).
- 2. Run Ruff for general linting:
ruff check . - 3. Run Arid for duplicate detection:
arid .or use the GitHub Actionsponge-b0b/[email protected]. - 4. Configure Arid to ignore comments, docstrings, imports, or function signatures if desired.
- 5. In CI, use Arid’s SARIF or JSON output for automated analysis and baseline management.
- 6. For mature codebases, record existing duplicates as baseline and enforce only new duplicates.
证据
Running serially, the results were: Requests — 191.19x faster, Pydantic — 219.06x faster, Polaris — 249.68x faster
Arid is a Python duplicate-code checker written in Rust
- 记录日期: 2026-09-02T14:27:40.293Z