mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
This lets you test the ruff linters or use the ruff library without having to compile the ~100 additional dependencies that are needed by the CLI. Because we set the following in the [workspace] section of Cargo.toml: default-members = [".", "ruff_cli"] `cargo run` still runs the CLI and `cargo test` still tests the code in src/ as well as the code in the new ruff_cli crate. (But you can now also run `cargo test -p ruff` to only test the linters.)
10 lines
295 B
Rust
10 lines
295 B
Rust
use std::path::{Path, PathBuf};
|
|
|
|
pub const CACHE_DIR_NAME: &str = ".ruff_cache";
|
|
|
|
/// Return the cache directory for a given project root. Defers to the
|
|
/// `RUFF_CACHE_DIR` environment variable, if set.
|
|
pub fn cache_dir(project_root: &Path) -> PathBuf {
|
|
project_root.join(CACHE_DIR_NAME)
|
|
}
|