-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy path.clippy.toml
More file actions
70 lines (56 loc) · 3.92 KB
/
.clippy.toml
File metadata and controls
70 lines (56 loc) · 3.92 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
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
too-many-lines-threshold = 200
# We don't have any downstream users, we don't care about external API changes,
# and this makes the codebase cleaner
avoid-breaking-exported-api = false
disallowed-methods = [
{ path = "str::to_ascii_lowercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_ascii_lowercase` instead." },
{ path = "str::to_ascii_uppercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_ascii_uppercase` instead." },
{ path = "str::to_lowercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_lowercase` instead." },
{ path = "str::to_uppercase", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_to_uppercase` instead." },
{ path = "str::replace", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replace` instead." },
{ path = "str::replacen", reason = "To avoid memory allocation, use `cow_utils::CowUtils::cow_replacen` instead." },
{ path = "std::env::current_dir", reason = "To get an `AbsolutePathBuf`, Use `vite_path::current_dir` instead." },
]
disallowed-types = [
{ path = "std::collections::HashMap", reason = "Use `rustc_hash::FxHashMap` instead, which is typically faster." },
{ path = "std::collections::HashSet", reason = "Use `rustc_hash::FxHashSet` instead, which is typically faster." },
{ path = "std::path::Path", reason = "Use `vite_path::RelativePath` or `vite_path::AbsolutePath` instead" },
{ path = "std::path::PathBuf", reason = "Use `vite_path::RelativePathBuf` or `vite_path::AbsolutePathBuf` instead" },
{ path = "std::string::String", reason = "Use `vite_str::Str` for small strings. For large strings, prefer `Box/Rc/Arc<str>` if mutation is not needed." },
]
disallowed-macros = [
{ path = "std::format", reason = "Use `vite_str::format` for small strings." },
{ path = "std::println", reason = "Use `vite_shared::output` functions (`info`, `note`, `success`) instead." },
{ path = "std::print", reason = "Use `vite_shared::output` functions (`info`, `note`, `success`) instead." },
{ path = "std::eprintln", reason = "Use `vite_shared::output` functions (`warn`, `error`) instead." },
{ path = "std::eprint", reason = "Use `vite_shared::output` functions (`warn`, `error`) instead." },
]
### await-holding-invalid-types
## we can remove these if https://github.com/xacrimon/dashmap/issues/348 lands
[[await-holding-invalid-types]]
path = "dashmap::mapref::one::Ref"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::mapref::one::RefMut"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::mapref::one::MappedRef"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::mapref::entry::Entry"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::mapref::multiple::RefMulti"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::mapref::multiple::RefMutMulti"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::iter::Iter"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::iter::IterMut"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"
[[await-holding-invalid-types]]
path = "dashmap::iter::OwningIter"
reason = "holding dashmap references will cause deadlocks, if the same thread tries to acquire a reference"