@@ -18,6 +18,64 @@ homepage = "https://github.com/notify-rs/notify"
1818repository = " https://github.com/notify-rs/notify.git"
1919edition = " 2024"
2020
21+ [workspace .lints .clippy ]
22+ # Guidelines
23+ # - We should only disable rules globally if they are either false positives, chaotic, or does not make sense.
24+ # - Group are enabled with priority -1, so we could easily override some specific rules.
25+ # - https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-lints-section
26+
27+ # --- restriction https://doc.rust-lang.org/clippy/usage.html#clippyrestriction
28+ allow_attributes = " deny"
29+ dbg_macro = " deny"
30+ print_stdout = " deny"
31+
32+ # I like the explicitness of this rule as it removes confusion around `clone`.
33+ # This increases readability, avoids `clone` mindlessly and heap allocating on accident.
34+ clone_on_ref_ptr = " deny"
35+ empty_drop = " deny"
36+ exit = " deny"
37+ filetype_is_file = " deny"
38+ get_unwrap = " deny"
39+ rc_buffer = " deny"
40+ rc_mutex = " deny"
41+ rest_pat_in_fully_bound_structs = " deny"
42+ unnecessary_safety_comment = " deny"
43+
44+ # --- pedantic #https://doc.rust-lang.org/clippy/usage.html#clippypedantic
45+ # To write the best rust code, pedantic group is enabled by default.
46+ pedantic = { level = " deny" , priority = -1 }
47+ case_sensitive_file_extension_comparisons = " allow"
48+
49+ # Though the following are nursery rules, they’re still useful.
50+ debug_assert_with_mut_call = " warn"
51+ iter_on_single_items = " warn"
52+ needless_pass_by_ref_mut = " warn"
53+ redundant_clone = " warn"
54+ redundant_pub_crate = " warn"
55+ significant_drop_in_scrutinee = " warn"
56+ unused_peekable = " warn"
57+
58+ # Wizards, naming is too hard.
59+ module_inception = " allow"
60+ module_name_repetitions = " allow"
61+ similar_names = " allow"
62+ struct_field_names = " allow"
63+ # Forwarding `Result` is a common pattern, this rule is too pedantic.
64+ missing_errors_doc = " allow"
65+ doc_markdown = " allow"
66+ inline_always = " allow"
67+ wildcard_imports = " allow"
68+ redundant_closure_for_method_calls = " allow"
69+ items_after_statements = " allow"
70+ redundant-pub-crate = " allow"
71+ # Order doesn't really matter https://rust-lang.github.io/rust-clippy/master/index.html#/inconsistent_struct_constructor
72+ inconsistent_struct_constructor = " allow"
73+ # Single match is equally readable as if/else. https://rust-lang.github.io/rust-clippy/master/index.html#/single_match
74+ single_match = " allow"
75+ single_match_else = " allow"
76+ # Rewriting `unwrap_or` to `map_or` requires to annotate type explicitly which is cumbersome
77+ map_unwrap_or = " allow"
78+
2179[workspace .dependencies ]
2280bitflags = " 2.7.0"
2381crossbeam-channel = " 0.5.0"
0 commit comments