Personal ATProto tools.
1allow-unwrap-in-tests = true
2# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#avoid-breaking-exported-api
3avoid-breaking-exported-api = false
4excessive-nesting-threshold = 7
5max-fn-params-bools = 0
6# https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file
7max-include-file-size = 1000000
8# https://rust-lang.github.io/rust-clippy/master/index.html#/large_stack_frames
9stack-size-threshold = 65536
10too-many-lines-threshold = 64
11array-size-threshold = 32
12future-size-threshold = 8192
13type-complexity-threshold = 200
14cognitive-complexity-threshold = 7
15missing-docs-in-crate-items = true
16check-private-items = true
17too-many-arguments-threshold = 5
18
19# -----------------------------------------------------------------------------
20
21# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
22disallowed-macros = [
23 'dbg',
24 'std::eprint',
25 'std::eprintln',
26 'std::print',
27 # 'std::println',
28# 'std::unimplemented',
29]
30
31# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods
32disallowed-methods = [
33 { path = "log::error", reason = "use tracing::error" },
34 { path = "log::warn", reason = "use tracing::warn" },
35 { path = "log::info", reason = "use tracing::info" },
36 { path = "log::debug", reason = "use tracing::debug" },
37 { path = "log::trace", reason = "use tracing::trace" },
38 { path = "sha1::Digest::new", reason = "SHA1 is cryptographically broken" },
39 { path = "std::env::temp_dir", reason = "Use the tempdir crate instead" },
40 { path = "std::panic::catch_unwind", reason = "We compile with `panic = 'abort'`" },
41 { path = "std::thread::spawn", reason = "Use `std::thread::Builder` and name the thread" },
42
43 # There are many things that aren't allowed on wasm,
44 # but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
45 { path = "crossbeam::channel::Receiver::into_iter", reason = "Cannot block on Web" },
46 { path = "crossbeam::channel::Receiver::iter", reason = "Cannot block on Web" },
47 { path = "crossbeam::channel::Receiver::recv_timeout", reason = "Cannot block on Web" },
48 { path = "crossbeam::channel::Receiver::recv", reason = "Cannot block on Web" },
49 { path = "poll_promise::Promise::block_and_take", reason = "Cannot block on Web" },
50 { path = "poll_promise::Promise::block_until_ready_mut", reason = "Cannot block on Web" },
51 { path = "poll_promise::Promise::block_until_ready", reason = "Cannot block on Web" },
52 { path = "pollster::block_on", reason = "Cannot block on Web" },
53 { path = "rayon::spawn", reason = "Cannot spawn threads on wasm" },
54 { path = "std::sync::mpsc::Receiver::into_iter", reason = "Cannot block on Web" },
55 { path = "std::sync::mpsc::Receiver::iter", reason = "Cannot block on Web" },
56 { path = "std::sync::mpsc::Receiver::recv_timeout", reason = "Cannot block on Web" },
57 { path = "std::sync::mpsc::Receiver::recv", reason = "Cannot block on Web" },
58 { path = "std::thread::spawn", reason = "Cannot spawn threads on wasm" },
59 { path = "std::time::Duration::elapsed", reason = "use `web-time` crate instead for wasm/web compatibility" },
60 { path = "std::time::Instant::now", reason = "use `web-time` crate instead for wasm/web compatibility" },
61 { path = "std::time::SystemTime::now", reason = "use `web-time` or `time` crates instead for wasm/web compatibility" },
62]
63
64# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names
65disallowed-names = []
66
67# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
68disallowed-types = [
69 { path = "ring::digest::SHA1_FOR_LEGACY_USE_ONLY", reason = "SHA1 is cryptographically broken" },
70 { path = "std::sync::Condvar", reason = "Use parking_lot instead" },
71 { path = "std::sync::Mutex", reason = "Use parking_lot instead" },
72 { path = "std::sync::RwLock", reason = "Use parking_lot instead" },
73
74 # There are many things that aren't allowed on wasm,
75 { path = "instant::SystemTime", reason = "Known bugs. Use web-time." },
76 { path = "std::thread::Builder", reason = "Cannot spawn threads on wasm" },
77 # { path = "std::path::PathBuf", reason = "Can't read/write files on web" },
78]
79
80# Allow-list of words for markdown in docstrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
81doc-valid-idents = [
82 "..",
83 "GitHub",
84 "GLB",
85 "GLTF",
86 "iOS",
87 "macOS",
88 "MessagePack",
89 "MiMalloc",
90 "NaN",
91 "OBJ",
92 "OpenGL",
93 "PyPI",
94 "sRGB",
95 "sRGBA",
96 "WebGL",
97 "WebGPU",
98 "WebSocket",
99 "WebSockets",
100]