Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"[json][jsonc][markdown][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "prettier.prettier-vscode"
},
"vscord.app.privacyMode.enable": true
}
9 changes: 9 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
absolute-paths-max-segments = 3
max-fn-params-bools = 2
max-struct-bools = 2
single-char-binding-names-threshold = 3
too-many-arguments-threshold = 3

disallowed-methods = [
{ path = "std::process::exit", reason = "this performs a dirty exit and prevents the macro from returning a `TokenStream`" },
]
245 changes: 231 additions & 14 deletions impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,243 @@ categories = ["development-tools", "rust-patterns"]
[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0.104"
quote = "1.0.42"
regex = "1.12.2"
syn = { version = "2.0.112", features = [] }

[dev-dependencies]
error-stack = "0.6.0"

[lints.rust]
ambiguous_glob_reexports = "deny"
ambiguous_negative_literals = "warn"
closure_returning_async_block = "warn"
coherence_leak_check = "deny"
const_evaluatable_unchecked = "forbid"
const_item_mutation = "deny"
deprecated_where_clause_location = "deny"
deref_into_dyn_supertrait = "deny"
explicit_outlives_requirements = "warn"
exported_private_dependencies = "deny"
forbidden_lint_groups = "forbid"
hidden_glob_reexports = "deny"
incomplete_features = "forbid"
internal_features = "deny"
late_bound_lifetime_arguments = "forbid"
malformed_diagnostic_attributes = "deny"
malformed_diagnostic_format_literals = "deny"
missing_docs = "warn"
opaque_hidden_inferred_bound = "forbid"
redundant_imports = "warn"
redundant_lifetimes = "warn"
refining_impl_trait_internal = "deny"
refining_impl_trait_reachable = "deny"
self_constructor_from_outer_item = "forbid"
single_use_lifetimes = "warn"
unconditional_recursion = "deny"
unit_bindings = "warn"
special_module_name = "deny"
unconditional_recursion = "forbid"
uncovered_param_in_projection = "forbid"
unexpected_cfgs = "deny"
unfulfilled_lint_expectations = "deny"
unknown_diagnostic_attributes = "forbid"
unknown_lints = "forbid"
unnameable_types = "warn"
unreachable_pub = "warn"
unsafe_code = "deny"
unsafe_code = "forbid"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_macro_rules = "warn"
unused_qualifications = "warn"
unused_results = "warn"
variant_size_differences = "warn"

[lints.clippy]
unwrap_used = "warn"
absolute_paths = "warn"
allow_attributes = "warn"
arc_with_non_send_sync = "deny"
arithmetic_side_effects = "warn"
as_conversions = "warn"
as_underscore = "deny"
assertions_on_result_states = "warn"
assigning_clones = "warn"
blanket_clippy_restriction_lints = "deny"
cargo_common_metadata = "warn"
case_sensitive_file_extension_comparisons = "warn"
cfg_not_test = "warn"
clone_on_ref_ptr = "warn"
cloned_instead_of_copied = "warn"
comparison_chain = "warn"
copy_iterator = "warn"
declare_interior_mutable_const = "deny"
default_trait_access = "warn"
deprecated_cfg_attr = "deny"
deprecated_clippy_cfg_attr = "deny"
disallowed_methods = "deny"
doc_broken_link = "warn"
doc_comment_double_space_linebreaks = "warn"
doc_include_without_cfg = "warn"
duplicate_mod = "deny"
elidable_lifetime_names = "warn"
empty_drop = "warn"
empty_enum_variants_with_brackets = "warn"
empty_line_after_outer_attr = "deny"
empty_loop = "deny"
empty_structs_with_brackets = "warn"
enum_glob_use = "deny"
error_impl_error = "deny"
excessive_precision = "deny"
expect_used = "warn"
panic = "warn"

[dependencies]
proc-macro2 = "1.0.104"
quote = "1.0.42"
regex = "1.12.2"
syn = { version = "2.0.112", features = [] }

[dev-dependencies]
error-stack = "0.6.0"
expl_impl_clone_on_copy = "deny"
explicit_deref_methods = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
field_scoped_visibility_modifiers = "warn"
filetype_is_file = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
float_cmp = "warn"
fn_params_excessive_bools = "warn"
format_collect = "warn"
format_push_string = "warn"
if_not_else = "warn"
if_then_some_else_none = "warn"
ignore_without_reason = "warn"
ignored_unit_patterns = "warn"
impl_trait_in_params = "warn"
implicit_clone = "warn"
implicit_hasher = "deny"
incompatible_msrv = "forbid"
inconsistent_struct_constructor = "warn"
indexing_slicing = "deny"
inefficient_to_string = "warn"
infinite_loop = "deny"
items_after_statements = "deny"
iter_filter_is_ok = "warn"
iter_not_returning_iterator = "warn"
iter_over_hash_type = "warn"
large_futures = "deny"
large_include_file = "warn"
large_stack_arrays = "warn"
large_types_passed_by_value = "warn"
legacy_numeric_constants = "deny"
lossy_float_literal = "deny"
macro_use_imports = "warn"
manual_assert = "warn"
manual_instant_elapsed = "warn"
manual_is_power_of_two = "warn"
manual_is_variant_and = "warn"
manual_let_else = "warn"
manual_midpoint = "warn"
manual_string_new = "warn"
many_single_char_names = "warn"
map_err_ignore = "deny"
map_unwrap_or = "warn"
map_with_unused_argument_over_ranges = "warn"
match_bool = "warn"
match_same_arms = "warn"
match_wild_err_arm = "warn"
match_wildcard_for_single_variants = "warn"
maybe_infinite_iter = "warn"
mem_forget = "deny"
mismatching_type_param_order = "warn"
missing_assert_message = "deny"
missing_enforced_import_renames = "deny"
missing_fields_in_debug = "warn"
missing_inline_in_public_items = "deny"
missing_panics_doc = "warn"
mixed_attributes_style = "deny"
mixed_read_write_in_expression = "warn"
module_name_repetitions = "warn"
multi_assignments = "deny"
multiple_crate_versions = "warn"
multiple_inherent_impl = "deny"
must_use_unit = "deny"
mut_mut = "warn"
mut_range_bound = "deny"
mutable_key_type = "deny"
naive_bytecount = "warn"
needless_bitwise_bool = "warn"
needless_continue = "warn"
needless_for_each = "warn"
needless_pass_by_value = "warn"
needless_raw_string_hashes = "warn"
needless_raw_strings = "warn"
negative_feature_names = "warn"
no_effect_underscore_binding = "warn"
non_std_lazy_statics = "warn"
non_zero_suggestions = "warn"
option_as_ref_cloned = "warn"
option_option = "warn"
panic = "deny"
partial_pub_fields = "deny"
pathbuf_init_then_push = "warn"
pattern_type_mismatch = "deny"
permissions_set_readonly_false = "deny"
pointer_format = "forbid"
precedence_bits = "warn"
print_in_format_impl = "deny"
print_stderr = "warn"
print_stdout = "warn"
pub_underscore_fields = "warn"
pub_without_shorthand = "warn"
range_minus_one = "warn"
range_plus_one = "warn"
rc_buffer = "warn"
rc_mutex = "deny"
redundant_closure_for_method_calls = "warn"
redundant_else = "warn"
redundant_feature_names = "warn"
redundant_test_prefix = "warn"
redundant_type_annotations = "warn"
ref_option = "deny"
renamed_function_params = "deny"
rest_pat_in_fully_bound_structs = "warn"
return_and_then = "warn"
same_functions_in_if_condition = "warn"
same_name_method = "deny"
self_named_module_files = "deny"
semicolon_inside_block = "warn"
shadow_reuse = "deny"
shadow_same = "deny"
shadow_unrelated = "deny"
should_panic_without_expect = "deny"
similar_names = "warn"
single_char_pattern = "warn"
single_match_else = "warn"
stable_sort_primitive = "warn"
str_split_at_newline = "warn"
str_to_string = "warn"
string_add = "warn"
string_add_assign = "warn"
string_slice = "deny"
struct_excessive_bools = "warn"
struct_field_names = "warn"
test_attr_in_doctest = "deny"
tests_outside_test_module = "deny"
todo = "warn"
trivially_copy_pass_by_ref = "warn"
try_err = "warn"
unicode_not_nfc = "warn"
unimplemented = "warn"
uninlined_format_args = "warn"
unnecessary_box_returns = "warn"
unnecessary_debug_formatting = "warn"
unneeded_field_pattern = "warn"
unnested_or_patterns = "warn"
unreadable_literal = "warn"
unseparated_literal_suffix = "warn"
unused_async = "warn"
unused_self = "warn"
unused_trait_names = "warn"
unwrap_used = "deny"
used_underscore_binding = "warn"
used_underscore_items = "warn"
verbose_bit_mask = "warn"
verbose_file_reads = "warn"
wildcard_dependencies = "forbid"
wildcard_imports = "deny"
zero_sized_map_values = "warn"
zombie_processes = "deny"
2 changes: 2 additions & 0 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
//! [`error-stack`]: https://crates.io/crates/error-stack
//! [documentation]: https://docs.rs/error-stack-macros2

#![deny(unstable_features)]

use proc_macro::TokenStream;
use quote::quote;
use syn::parse_macro_input;
Expand Down
Loading