1[package]
2name = "derive_utils"
3version = "0.15.0" #publish:version
4edition = "2021"
5rust-version = "1.56" # For syn
6license = "Apache-2.0 OR MIT"
7repository = "https://github.com/taiki-e/derive_utils"
8keywords = ["enum", "macros", "derive"]
9categories = ["development-tools::procedural-macro-helpers", "rust-patterns"]
10exclude = ["/.*", "/tools"]
11description = """
12A procedural macro helper for easily writing derive macros for enums.
13"""
14
15[package.metadata.docs.rs]
16targets = ["x86_64-unknown-linux-gnu"]
17
18[package.metadata.cargo_check_external_types]
19# The following are external types that are allowed to be exposed in our public API.
20allowed_external_types = [
21 "proc_macro2::*",
22 "quote::*",
23 "syn::*",
24]
25
26[lib]
27doc-scrape-examples = false
28
29# Note: proc-macro2, quote, and syn are public dependencies.
30[dependencies]
31proc-macro2 = "1.0.60"
32quote = "1.0.25"
33syn = { version = "2", default-features = false, features = ["parsing", "printing", "clone-impls", "proc-macro", "full"] }
34
35[dev-dependencies]
36example_derive = { path = "examples/example_derive" }
37rustversion = "1"
38trybuild = { git = "https://github.com/taiki-e/trybuild.git", branch = "dev" } # adjust overwrite behavior
39
40[lints]
41workspace = true
42
43[workspace]
44resolver = "2"
45members = ["examples/example", "examples/example_derive"]
46
47# This table is shared by projects under github.com/taiki-e.
48# It is not intended for manual editing.
49[workspace.lints.rust]
50deprecated_safe = "warn"
51improper_ctypes = "warn"
52improper_ctypes_definitions = "warn"
53non_ascii_idents = "warn"
54rust_2018_idioms = "warn"
55single_use_lifetimes = "warn"
56unexpected_cfgs = { level = "warn", check-cfg = [
57] }
58unnameable_types = "warn"
59unreachable_pub = "warn"
60# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV
61[workspace.lints.clippy]
62all = "warn" # Downgrade deny-by-default lints
63pedantic = "warn"
64as_ptr_cast_mut = "warn"
65as_underscore = "warn"
66default_union_representation = "warn"
67inline_asm_x86_att_syntax = "warn"
68trailing_empty_array = "warn"
69transmute_undefined_repr = "warn"
70undocumented_unsafe_blocks = "warn"
71unused_trait_names = "warn"
72# Suppress buggy or noisy clippy lints
73bool_assert_comparison = { level = "allow", priority = 1 }
74borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286
75cast_lossless = { level = "allow", priority = 1 } # https://godbolt.org/z/Pv6vbGG6E
76declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
77doc_markdown = { level = "allow", priority = 1 }
78float_cmp = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7725
79incompatible_msrv = { level = "allow", priority = 1 } # buggy: doesn't consider cfg, https://github.com/rust-lang/rust-clippy/issues/12280, https://github.com/rust-lang/rust-clippy/issues/12257#issuecomment-2093667187
80lint_groups_priority = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12920
81manual_assert = { level = "allow", priority = 1 }
82manual_range_contains = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395
83missing_errors_doc = { level = "allow", priority = 1 }
84module_name_repetitions = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+module_name_repetitions
85naive_bytecount = { level = "allow", priority = 1 }
86nonminimal_bool = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+nonminimal_bool
87range_plus_one = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+range_plus_one
88similar_names = { level = "allow", priority = 1 }
89single_match = { level = "allow", priority = 1 }
90single_match_else = { level = "allow", priority = 1 }
91struct_excessive_bools = { level = "allow", priority = 1 }
92struct_field_names = { level = "allow", priority = 1 }
93too_many_arguments = { level = "allow", priority = 1 }
94too_many_lines = { level = "allow", priority = 1 }
95type_complexity = { level = "allow", priority = 1 }
96unreadable_literal = { level = "allow", priority = 1 }
97