mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 22:55:08 +00:00
![]() ## Summary While fixing https://github.com/astral-sh/ruff/pull/5233, I noticed that in FastAPI, 343 out of 823 files weren't hitting the cache. It turns out these are standalone files in the documentation that lack a "package root". Later, when looking up the cache entries, we fallback to the package directory. This PR ensures that we initialize the cache for both kinds of files: those that are in a package, and those that aren't. The total size of the FastAPI cache for me is now 388K. I also suspect that this approach is much faster than as initially written, since before, we were probably initializing one cache per _directory_. ## Test Plan Ran `cargo run -p ruff_cli -- check ../fastapi --verbose`; verified that, on second execution, there were no "Checking" entries in the logs. |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_formatter | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_whitespace | ||
ruff_rustpython | ||
ruff_testing_macros | ||
ruff_textwrap | ||
ruff_wasm |