-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclippy.toml
74 lines (69 loc) · 5.71 KB
/
clippy.toml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
disallowed-methods = [
{ path = "rustls::ClientConfig::builder", reason = "Use lexe_client_config()" },
{ path = "rustls::ServerConfig::builder", reason = "Use lexe_server_config()" },
{ path = "rustls::ClientConfig::builder_with_provider", reason = "Use lexe_client_config()" },
{ path = "rustls::ServerConfig::builder_with_provider", reason = "Use lexe_server_config()" },
{ path = "rustls::ClientConfig::builder_with_protocol_versions", reason = "Use lexe_client_config()" },
{ path = "rustls::ServerConfig::builder_with_protocol_versions", reason = "Use lexe_server_config()" },
{ path = "rustls::crypto::ring::default_provider", reason = "Use LEXE_CRYPTO_PROVIDER" },
{ path = "rustls::server::WebPkiClientVerifier::builder", reason = "Use LEXE_CRYPTO_PROVIDER" },
{ path = "rustls::client::WebPkiServerVerifier::builder", reason = "Use LEXE_CRYPTO_PROVIDER" },
{ path = "tokio::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::task::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::runtime::Handle::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::runtime::Runtime::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::task::Builder::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::task::join_set::JoinSet::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::task::join_set::Builder::spawn", reason = "Use LxTask::spawn" },
{ path = "tokio::task::Builder::spawn_on", reason = "Use LxTask::spawn" },
{ path = "tokio::task::join_set::JoinSet::spawn_on", reason = "Use LxTask::spawn" },
{ path = "tokio::task::join_set::Builder::spawn_on", reason = "Use LxTask::spawn" },
# Footgun: `.is_elapsed()` counts as 'using' the future, which may still be unpolled
{ path = "tokio::time::Sleep::is_elapsed", reason = "Just poll!() the sleep future instead" },
{ path = "secp256k1::Secp256k1::new", reason = "Use `Crng::gen_secp256k1_ctx`" },
{ path = "secp256k1::Secp256k1::gen_new", reason = "Use `Crng::gen_secp256k1_ctx`" },
{ path = "secp256k1::Secp256k1::signing_only", reason = "Use `Crng::gen_secp256k1_ctx_signing`" },
{ path = "sea_orm_migration::prelude::ColumnDef::binary_len", reason = "Use `.binary()` for consistency. See crate docs." },
{ path = "sea_orm_migration::prelude::ColumnDef::var_binary", reason = "Use `.binary()` for consistency. See crate docs." },
{ path = "sea_orm_migration::prelude::ColumnDef::blob", reason = "Use `.binary()` for consistency. See crate docs." },
{ path = "sea_orm_migration::prelude::ColumnDef::decimal", reason = "Use `decimal_len(DECIMAL_PRECISION, DECIMAL_SCALE)`" },
]
disallowed-types = [
# Ban implementors of axum::extract::FromRequest[Parts] bc their rejections are incompatible.
# - OriginalUri, RawQuery, and State are fine bc they're infallible.
# - The FromRequestParts impls on foreign (HTTP) types are fine bc they're all infallible.
{ path = "axum::Json", reason = "Use LxJson" },
{ path = "axum::Extension", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::ConnectInfo", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::Form", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::Host", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::MatchedPath", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::Multipart", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::NestedPath", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::OriginalUri", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::Path", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::Query", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::RawForm", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::RawPathParams", reason = "Bad Rejection. Use or add to api::server::extract." },
{ path = "axum::extract::WebSocketUpgrade", reason = "Bad Rejection. Use or add to api::server::extract." },
# TODO(max): Also ban other layers like this which return incompatible responses instead of errors
{ path = "tower_http::timeout::Timeout", reason = """\
Incompatible HTTP error response. Use tower::timeout::Timeout instead.\
""" },
{ path = "tower_http::timeout::TimeoutLayer", reason = """\
Incompatible HTTP error response. Use tower::timeout::TimeoutLayer instead.\
""" },
{ path = "tower_http::limit::RequestBodyLimit", reason = """\
Incompatible HTTP error response. \
Use DefaultBodyLimit and axum::RequestExt::with_limited_body instead.\
""" },
{ path = "tower_http::limit::RequestBodyLimitLayer", reason = """\
Incompatible HTTP error response. \
Use DefaultBodyLimit and axum::RequestExt::with_limited_body instead.\
""" },
]
# Suppress useless too_many_arguments lint
too-many-arguments-threshold = 20
# Suppress; this lint suggests type aliases for complex types which increases
# indirection and makes code *less* readable, not more. Better to be explicit.
type-complexity-threshold = 6969