Skip to content

Commit 9a139a1

Browse files
authored
Merge pull request #34 from LuisFerLCC/workspace-config
Add strict lints and Rustfmt configuration
2 parents 412bf41 + 769ffe0 commit 9a139a1

16 files changed

Lines changed: 602 additions & 112 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"[json][jsonc][markdown][yaml]": {
3-
"editor.defaultFormatter": "esbenp.prettier-vscode"
3+
"editor.defaultFormatter": "prettier.prettier-vscode"
44
},
55
"vscord.app.privacyMode.enable": true
66
}

clippy.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
absolute-paths-max-segments = 3
2+
max-fn-params-bools = 2
3+
max-struct-bools = 2
4+
single-char-binding-names-threshold = 3
5+
too-many-arguments-threshold = 3
6+
7+
disallowed-methods = [
8+
{ path = "std::process::exit", reason = "this performs a dirty exit and prevents the macro from returning a `TokenStream`" },
9+
]

impl/Cargo.toml

Lines changed: 231 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,243 @@ categories = ["development-tools", "rust-patterns"]
1414
[lib]
1515
proc-macro = true
1616

17+
[dependencies]
18+
proc-macro2 = "1.0.104"
19+
quote = "1.0.42"
20+
regex = "1.12.2"
21+
syn = { version = "2.0.112", features = [] }
22+
23+
[dev-dependencies]
24+
error-stack = "0.6.0"
25+
1726
[lints.rust]
27+
ambiguous_glob_reexports = "deny"
28+
ambiguous_negative_literals = "warn"
29+
closure_returning_async_block = "warn"
30+
coherence_leak_check = "deny"
31+
const_evaluatable_unchecked = "forbid"
32+
const_item_mutation = "deny"
33+
deprecated_where_clause_location = "deny"
34+
deref_into_dyn_supertrait = "deny"
35+
explicit_outlives_requirements = "warn"
36+
exported_private_dependencies = "deny"
37+
forbidden_lint_groups = "forbid"
38+
hidden_glob_reexports = "deny"
39+
incomplete_features = "forbid"
40+
internal_features = "deny"
41+
late_bound_lifetime_arguments = "forbid"
42+
malformed_diagnostic_attributes = "deny"
43+
malformed_diagnostic_format_literals = "deny"
1844
missing_docs = "warn"
45+
opaque_hidden_inferred_bound = "forbid"
46+
redundant_imports = "warn"
47+
redundant_lifetimes = "warn"
48+
refining_impl_trait_internal = "deny"
49+
refining_impl_trait_reachable = "deny"
50+
self_constructor_from_outer_item = "forbid"
1951
single_use_lifetimes = "warn"
20-
unconditional_recursion = "deny"
21-
unit_bindings = "warn"
52+
special_module_name = "deny"
53+
unconditional_recursion = "forbid"
54+
uncovered_param_in_projection = "forbid"
55+
unexpected_cfgs = "deny"
56+
unfulfilled_lint_expectations = "deny"
57+
unknown_diagnostic_attributes = "forbid"
58+
unknown_lints = "forbid"
2259
unnameable_types = "warn"
2360
unreachable_pub = "warn"
24-
unsafe_code = "deny"
61+
unsafe_code = "forbid"
62+
unused_extern_crates = "warn"
63+
unused_import_braces = "warn"
2564
unused_lifetimes = "warn"
65+
unused_macro_rules = "warn"
66+
unused_qualifications = "warn"
67+
unused_results = "warn"
68+
variant_size_differences = "warn"
2669

2770
[lints.clippy]
28-
unwrap_used = "warn"
71+
absolute_paths = "warn"
72+
allow_attributes = "warn"
73+
arc_with_non_send_sync = "deny"
74+
arithmetic_side_effects = "warn"
75+
as_conversions = "warn"
76+
as_underscore = "deny"
77+
assertions_on_result_states = "warn"
78+
assigning_clones = "warn"
79+
blanket_clippy_restriction_lints = "deny"
80+
cargo_common_metadata = "warn"
81+
case_sensitive_file_extension_comparisons = "warn"
82+
cfg_not_test = "warn"
83+
clone_on_ref_ptr = "warn"
84+
cloned_instead_of_copied = "warn"
85+
comparison_chain = "warn"
86+
copy_iterator = "warn"
87+
declare_interior_mutable_const = "deny"
88+
default_trait_access = "warn"
89+
deprecated_cfg_attr = "deny"
90+
deprecated_clippy_cfg_attr = "deny"
91+
disallowed_methods = "deny"
92+
doc_broken_link = "warn"
93+
doc_comment_double_space_linebreaks = "warn"
94+
doc_include_without_cfg = "warn"
95+
duplicate_mod = "deny"
96+
elidable_lifetime_names = "warn"
97+
empty_drop = "warn"
98+
empty_enum_variants_with_brackets = "warn"
99+
empty_line_after_outer_attr = "deny"
100+
empty_loop = "deny"
101+
empty_structs_with_brackets = "warn"
102+
enum_glob_use = "deny"
103+
error_impl_error = "deny"
104+
excessive_precision = "deny"
29105
expect_used = "warn"
30-
panic = "warn"
31-
32-
[dependencies]
33-
proc-macro2 = "1.0.104"
34-
quote = "1.0.42"
35-
regex = "1.12.2"
36-
syn = { version = "2.0.112", features = [] }
37-
38-
[dev-dependencies]
39-
error-stack = "0.6.0"
106+
expl_impl_clone_on_copy = "deny"
107+
explicit_deref_methods = "warn"
108+
explicit_into_iter_loop = "warn"
109+
explicit_iter_loop = "warn"
110+
field_scoped_visibility_modifiers = "warn"
111+
filetype_is_file = "warn"
112+
filter_map_next = "warn"
113+
flat_map_option = "warn"
114+
float_cmp = "warn"
115+
fn_params_excessive_bools = "warn"
116+
format_collect = "warn"
117+
format_push_string = "warn"
118+
if_not_else = "warn"
119+
if_then_some_else_none = "warn"
120+
ignore_without_reason = "warn"
121+
ignored_unit_patterns = "warn"
122+
impl_trait_in_params = "warn"
123+
implicit_clone = "warn"
124+
implicit_hasher = "deny"
125+
incompatible_msrv = "forbid"
126+
inconsistent_struct_constructor = "warn"
127+
indexing_slicing = "deny"
128+
inefficient_to_string = "warn"
129+
infinite_loop = "deny"
130+
items_after_statements = "deny"
131+
iter_filter_is_ok = "warn"
132+
iter_not_returning_iterator = "warn"
133+
iter_over_hash_type = "warn"
134+
large_futures = "deny"
135+
large_include_file = "warn"
136+
large_stack_arrays = "warn"
137+
large_types_passed_by_value = "warn"
138+
legacy_numeric_constants = "deny"
139+
lossy_float_literal = "deny"
140+
macro_use_imports = "warn"
141+
manual_assert = "warn"
142+
manual_instant_elapsed = "warn"
143+
manual_is_power_of_two = "warn"
144+
manual_is_variant_and = "warn"
145+
manual_let_else = "warn"
146+
manual_midpoint = "warn"
147+
manual_string_new = "warn"
148+
many_single_char_names = "warn"
149+
map_err_ignore = "deny"
150+
map_unwrap_or = "warn"
151+
map_with_unused_argument_over_ranges = "warn"
152+
match_bool = "warn"
153+
match_same_arms = "warn"
154+
match_wild_err_arm = "warn"
155+
match_wildcard_for_single_variants = "warn"
156+
maybe_infinite_iter = "warn"
157+
mem_forget = "deny"
158+
mismatching_type_param_order = "warn"
159+
missing_assert_message = "deny"
160+
missing_enforced_import_renames = "deny"
161+
missing_fields_in_debug = "warn"
162+
missing_inline_in_public_items = "deny"
163+
missing_panics_doc = "warn"
164+
mixed_attributes_style = "deny"
165+
mixed_read_write_in_expression = "warn"
166+
module_name_repetitions = "warn"
167+
multi_assignments = "deny"
168+
multiple_crate_versions = "warn"
169+
multiple_inherent_impl = "deny"
170+
must_use_unit = "deny"
171+
mut_mut = "warn"
172+
mut_range_bound = "deny"
173+
mutable_key_type = "deny"
174+
naive_bytecount = "warn"
175+
needless_bitwise_bool = "warn"
176+
needless_continue = "warn"
177+
needless_for_each = "warn"
178+
needless_pass_by_value = "warn"
179+
needless_raw_string_hashes = "warn"
180+
needless_raw_strings = "warn"
181+
negative_feature_names = "warn"
182+
no_effect_underscore_binding = "warn"
183+
non_std_lazy_statics = "warn"
184+
non_zero_suggestions = "warn"
185+
option_as_ref_cloned = "warn"
186+
option_option = "warn"
187+
panic = "deny"
188+
partial_pub_fields = "deny"
189+
pathbuf_init_then_push = "warn"
190+
pattern_type_mismatch = "deny"
191+
permissions_set_readonly_false = "deny"
192+
pointer_format = "forbid"
193+
precedence_bits = "warn"
194+
print_in_format_impl = "deny"
195+
print_stderr = "warn"
196+
print_stdout = "warn"
197+
pub_underscore_fields = "warn"
198+
pub_without_shorthand = "warn"
199+
range_minus_one = "warn"
200+
range_plus_one = "warn"
201+
rc_buffer = "warn"
202+
rc_mutex = "deny"
203+
redundant_closure_for_method_calls = "warn"
204+
redundant_else = "warn"
205+
redundant_feature_names = "warn"
206+
redundant_test_prefix = "warn"
207+
redundant_type_annotations = "warn"
208+
ref_option = "deny"
209+
renamed_function_params = "deny"
210+
rest_pat_in_fully_bound_structs = "warn"
211+
return_and_then = "warn"
212+
same_functions_in_if_condition = "warn"
213+
same_name_method = "deny"
214+
self_named_module_files = "deny"
215+
semicolon_inside_block = "warn"
216+
shadow_reuse = "deny"
217+
shadow_same = "deny"
218+
shadow_unrelated = "deny"
219+
should_panic_without_expect = "deny"
220+
similar_names = "warn"
221+
single_char_pattern = "warn"
222+
single_match_else = "warn"
223+
stable_sort_primitive = "warn"
224+
str_split_at_newline = "warn"
225+
str_to_string = "warn"
226+
string_add = "warn"
227+
string_add_assign = "warn"
228+
string_slice = "deny"
229+
struct_excessive_bools = "warn"
230+
struct_field_names = "warn"
231+
test_attr_in_doctest = "deny"
232+
tests_outside_test_module = "deny"
233+
todo = "warn"
234+
trivially_copy_pass_by_ref = "warn"
235+
try_err = "warn"
236+
unicode_not_nfc = "warn"
237+
unimplemented = "warn"
238+
uninlined_format_args = "warn"
239+
unnecessary_box_returns = "warn"
240+
unnecessary_debug_formatting = "warn"
241+
unneeded_field_pattern = "warn"
242+
unnested_or_patterns = "warn"
243+
unreadable_literal = "warn"
244+
unseparated_literal_suffix = "warn"
245+
unused_async = "warn"
246+
unused_self = "warn"
247+
unused_trait_names = "warn"
248+
unwrap_used = "deny"
249+
used_underscore_binding = "warn"
250+
used_underscore_items = "warn"
251+
verbose_bit_mask = "warn"
252+
verbose_file_reads = "warn"
253+
wildcard_dependencies = "forbid"
254+
wildcard_imports = "deny"
255+
zero_sized_map_values = "warn"
256+
zombie_processes = "deny"

impl/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
//! [`error-stack`]: https://crates.io/crates/error-stack
108108
//! [documentation]: https://docs.rs/error-stack-macros2
109109
110+
#![deny(unstable_features)]
111+
110112
use proc_macro::TokenStream;
111113
use quote::quote;
112114
use syn::parse_macro_input;

0 commit comments

Comments
 (0)