This PR introduces a new `CacheKey` trait for types that can be used as a cache key. I'm not entirely sure if this is worth the "overhead", but I was surprised to find `HashableHashSet` and got scared when I looked at the time complexity of the `hash` function. These implementations must be extremely slow in hashed collections. I then searched for usages and quickly realized that only the cache uses these `Hash` implementations, where performance is less sensitive. This PR introduces a new `CacheKey` trait to communicate the difference between a hash and computing a key for the cache. The new trait can be implemented for types that don't implement `Hash` for performance reasons, and we can define additional constraints on the implementation: For example, we'll want to enforce portability when we add remote caching support. Using a different trait further allows us not to implement it for types without stable identities (e.g. pointers) or use other implementations than the standard hash function.
73 lines
2.4 KiB
TOML
73 lines
2.4 KiB
TOML
[package]
|
|
name = "ruff_cli"
|
|
version = "0.0.253"
|
|
authors = ["Charlie Marsh <charlie.r.marsh@gmail.com>"]
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
documentation = "https://github.com/charliermarsh/ruff"
|
|
homepage = "https://github.com/charliermarsh/ruff"
|
|
repository = "https://github.com/charliermarsh/ruff"
|
|
readme = "../../README.md"
|
|
license = "MIT"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[[bin]]
|
|
name = "ruff"
|
|
path = "src/main.rs"
|
|
doctest = false
|
|
|
|
# Since the name of the binary is the same as the name of the `ruff` crate
|
|
# running `cargo doc --no-deps --all` results in an `output filename collision`
|
|
# See also https://github.com/rust-lang/cargo/issues/6313.
|
|
# We therefore disable the documentation generation for the binary.
|
|
doc = false
|
|
|
|
[dependencies]
|
|
ruff = { path = "../ruff" }
|
|
ruff_cache = { path = "../ruff_cache" }
|
|
|
|
annotate-snippets = { version = "0.9.1", features = ["color"] }
|
|
anyhow = { workspace = true }
|
|
atty = { version = "0.2.14" }
|
|
bincode = { version = "1.3.3" }
|
|
bitflags = { version = "1.3.2" }
|
|
cachedir = { version = "0.3.0" }
|
|
chrono = { version = "0.4.21", default-features = false, features = ["clock"] }
|
|
clap = { workspace = true, features = ["derive", "env"] }
|
|
clap_complete_command = { version = "0.4.0" }
|
|
clearscreen = { version = "2.0.0" }
|
|
colored = { version = "2.0.0" }
|
|
filetime = { version = "0.2.17" }
|
|
glob = { version = "0.3.0" }
|
|
ignore = { version = "0.4.18" }
|
|
itertools = { workspace = true }
|
|
log = { version = "0.4.17" }
|
|
notify = { version = "5.0.0" }
|
|
path-absolutize = { version = "3.0.14", features = ["once_cell_cache"] }
|
|
quick-junit = { version = "0.3.2" }
|
|
rayon = { version = "1.5.3" }
|
|
regex = { workspace = true }
|
|
rustc-hash = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
shellexpand = { version = "3.0.0" }
|
|
similar = { version = "2.2.1" }
|
|
strum = { version = "0.24.1" }
|
|
textwrap = { version = "0.16.0" }
|
|
walkdir = { version = "2.3.2" }
|
|
|
|
[dev-dependencies]
|
|
assert_cmd = { version = "2.0.4" }
|
|
strum = { version = "0.24.1" }
|
|
ureq = { version = "2.5.0", features = [] }
|
|
|
|
[package.metadata.maturin]
|
|
name = "ruff"
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
mimalloc = "0.1.29"
|
|
|
|
[target.'cfg(all(not(target_os = "windows"), not(target_os = "openbsd"), any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "powerpc64")))'.dependencies]
|
|
tikv-jemallocator = "0.5.0"
|