-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclippy.toml
More file actions
26 lines (24 loc) · 2.45 KB
/
Copy pathclippy.toml
File metadata and controls
26 lines (24 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cognitive-complexity-threshold = 75
# for `disallowed_method`:
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
disallowed-methods = [
{ path = "std::io::Write::write", reason = "This doesn't handle short writes, use `write_all` instead." },
{ path = "zstd::stream::copy_decode", reason = "Use `vector_common::decompression::CappedDecoder::zstd` (or `CappedDecoder::zstd_http` in HTTP contexts) to enforce the decompression size cap." },
{ path = "zstd::stream::decode_all", reason = "Use `vector_common::decompression::CappedDecoder::zstd` (or `CappedDecoder::zstd_http` in HTTP contexts) to enforce the decompression size cap." },
{ path = "zstd::bulk::decompress", reason = "Use `vector_common::decompression::CappedDecoder::zstd` (or `CappedDecoder::zstd_http` in HTTP contexts) to enforce the decompression size cap." },
{ path = "warp::body::bytes", reason = "Reads the whole request body into memory unbounded. Use `crate::sources::util::http::capped_body()` to cap the compressed body size at the global decompressed-size limit." },
]
# Decompression limits are per-component configuration, not process state: take them from the
# component's context (`SourceContext` / `SinkContext` / `TransformContext` -> `GlobalOptions`)
# and pass them into the capped wrapper, rather than reading a global.
disallowed-types = [
{ path = "once_cell::sync::OnceCell", reason = "Use `std::sync::OnceLock` instead." },
{ path = "once_cell::unsync::OnceCell", reason = "Use `std::cell::OnceCell` instead." },
{ path = "once_cell::sync::Lazy", reason = "Use `std::sync::LazyLock` instead." },
{ path = "once_cell::unsync::Lazy", reason = "Use `std::sync::LazyCell` instead." },
{ path = "flate2::read::GzDecoder", reason = "Use `vector_common::decompression::CappedDecoder::gzip` to enforce the decompression size cap." },
{ path = "flate2::read::MultiGzDecoder", reason = "Use `vector_common::decompression::CappedDecoder::gzip` to enforce the decompression size cap." },
{ path = "flate2::read::ZlibDecoder", reason = "Use `vector_common::decompression::CappedDecoder::zlib` to enforce the decompression size cap." },
{ path = "flate2::read::DeflateDecoder", reason = "Use `vector_common::decompression::CappedDecoder` for decompression with the size cap." },
{ path = "zstd::stream::read::Decoder", reason = "Use `vector_common::decompression::CappedDecoder::zstd` (or `CappedDecoder::zstd_http` in HTTP contexts) to enforce the decompression size cap." },
]