-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
95 lines (90 loc) · 4.18 KB
/
Cargo.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[package]
name = "codecrafters-kafka"
version = "0.1.0"
authors = ["Codecrafters <[email protected]>"]
edition = "2021"
rust-version = "1.82"
[dependencies]
anyhow = "1.0.95" # error handling #
bytes = "1.9.0" # helps manage buffers #
crc32c = "0.6.8" # CRC-32-Castagnoli impl #
encode-decode-derive = { version = "0.1.0", path = "encode-decode-derive" } #
paste = "1.0.15" # helps with macro magic #
smart-default = "0.7.1" # simpler default impls #
strum = { version = "0.26.3", features = ["derive"] } # enum utils #
thiserror = "2.0.11" # error handling #
uuid = "1.12.1" # uuids #
[dev-dependencies]
indoc = "2.0.5"
[lints.rust]
unsafe_code = "forbid" # Good state to start with, can switch if some use case arises
unsafe_op_in_unsafe_fn = "deny" # See https://www.youtube.com/watch?v=8j_FbjiowvE&t=301s
[lints.clippy]
#################################### Warns #####################################
#--- suspicious, complexity, perf & style groups are warn-by-default
#--- set entire pedantic group to warn (pedantic is intended for opt-outs)
pedantic = { level = "warn", priority = -1 } # feel free to #[allow] specific lints in code
nursery = { level = "warn", priority = -1 }
#--- set selective lints from restriction group to warn (restriction is intended for opt-ins)
# restriction = { level = "warn", priority = -1 }
absolute_paths = "warn" # clippy config: `absolute-paths-max-segments = 2`
allow_attributes = "warn"
allow_attributes_without_reason = "warn"
clone_on_ref_ptr = "warn"
create_dir = "warn"
empty_enum_variants_with_brackets = "warn"
empty_structs_with_brackets = "warn"
error_impl_error = "warn"
filetype_is_file = "warn"
fn_to_numeric_cast_any = "warn"
format_push_string = "warn"
if_then_some_else_none = "warn"
impl_trait_in_params = "warn"
infinite_loop = "warn"
integer_division = "warn" # feel free to #[allow] where required
let_underscore_untyped = "warn"
lossy_float_literal = "warn"
map_err_ignore = "warn"
map_with_unused_argument_over_ranges = "warn"
min_ident_chars = "warn" # clippy config: `min-ident-chars-threshold = 1`
mem_forget = "warn"
missing_assert_message = "warn"
missing_asserts_for_indexing = "warn"
mixed_read_write_in_expression = "warn"
module_name_repetitions = "warn"
multiple_inherent_impl = "warn"
multiple_unsafe_ops_per_block = "warn" # combines with undocumented_unsafe_blocks to ensure each unsafe usage is documented
mutex_atomic = "warn"
non_zero_suggestions = "warn"
panic_in_result_fn = "warn"
partial_pub_fields = "warn"
pathbuf_init_then_push = "warn"
pub_without_shorthand = "warn" # choosing pub_with_shorthand as it's more concise
rc_buffer = "warn"
rc_mutex = "warn"
renamed_function_params = "warn" # clippy config: `allow-renamed-params-for = [ "..", "mycrate::myTrait" ]`
rest_pat_in_fully_bound_structs = "warn"
same_name_method = "warn"
self_named_module_files = "warn" # choosing mod_module_files as it keeps related rs files in same dir
semicolon_outside_block = "warn"
shadow_unrelated = "warn"
string_to_string = "warn"
tests_outside_test_module = "warn"
try_err = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
unneeded_field_pattern = "warn"
# TODO: Enable once tests are refactored to using request model
# unseparated_literal_suffix = "warn" # choosing separated_literal_suffix for better readability
unused_result_ok = "warn"
unused_trait_names = "warn"
unwrap_in_result = "warn" # feel free to #[allow] for specific functions
unwrap_used = "warn"
# use_debug = "warn" # keeping disabled by default, can be enabled when required
verbose_file_reads = "warn"
wildcard_enum_match_arm = "warn" # feel free to #[allow] for specific blocks
#################################### Allows ####################################
#--- set selective lints from pedantic group to allow
map_unwrap_or = "allow" # This reduces readability; see https://github.com/rust-lang/rust-clippy/issues/10428