@@ -28,15 +28,15 @@ macro_rules! define_Conf {
28
28
( $(
29
29
#[ $doc: meta]
30
30
$( #[ conf_deprecated( $dep: literal) ] ) ?
31
- ( $name: ident: $ty: ty $ ( = $default: expr) ? ) ,
31
+ ( $name: ident: $ty: ty = $default: expr) ,
32
32
) * ) => {
33
33
/// Clippy lint configuration
34
34
pub struct Conf {
35
35
$( #[ $doc] pub $name: $ty, ) *
36
36
}
37
37
38
38
mod defaults {
39
- $( pub fn $name( ) -> $ty { define_Conf! ( @ default $ ( $ default) ? ) } ) *
39
+ $( pub fn $name( ) -> $ty { $ default } ) *
40
40
}
41
41
42
42
impl Default for Conf {
@@ -90,20 +90,19 @@ macro_rules! define_Conf {
90
90
}
91
91
}
92
92
} ;
93
- ( @default ) => ( Default :: default ( ) ) ;
94
- ( @default $default: expr) => ( $default) ;
95
93
}
96
94
95
+ // N.B., this macro is parsed by util/lintlib.py
97
96
define_Conf ! {
98
97
/// Lint: CLONED_INSTEAD_OF_COPIED, REDUNDANT_FIELD_NAMES, REDUNDANT_STATIC_LIFETIMES, FILTER_MAP_NEXT, CHECKED_CONVERSIONS, MANUAL_RANGE_CONTAINS, USE_SELF, MEM_REPLACE_WITH_DEFAULT, MANUAL_NON_EXHAUSTIVE, OPTION_AS_REF_DEREF, MAP_UNWRAP_OR, MATCH_LIKE_MATCHES_MACRO, MANUAL_STRIP, MISSING_CONST_FOR_FN, UNNESTED_OR_PATTERNS, FROM_OVER_INTO, PTR_AS_PTR. The minimum rust version that the project supports
99
- ( msrv: Option <String >) ,
98
+ ( msrv: Option <String > = None ) ,
100
99
/// Lint: BLACKLISTED_NAME. The list of blacklisted names to lint about. NB: `bar` is not here since it has legitimate uses
101
100
( blacklisted_names: Vec <String > = [ "foo" , "baz" , "quux" ] . iter( ) . map( ToString :: to_string) . collect( ) ) ,
102
101
/// Lint: COGNITIVE_COMPLEXITY. The maximum cognitive complexity a function can have
103
102
( cognitive_complexity_threshold: u64 = 25 ) ,
104
103
/// DEPRECATED LINT: CYCLOMATIC_COMPLEXITY. Use the Cognitive Complexity lint instead.
105
- #[ conf_deprecated( "Please use `cognitive-complexity-threshold` instead. " ) ]
106
- ( cyclomatic_complexity_threshold: Option <u64 >) ,
104
+ #[ conf_deprecated( "Please use `cognitive-complexity-threshold` instead" ) ]
105
+ ( cyclomatic_complexity_threshold: Option <u64 > = None ) ,
107
106
/// Lint: DOC_MARKDOWN. The list of words this lint should not consider as identifiers needing ticks
108
107
( doc_valid_idents: Vec <String > = [
109
108
"KiB" , "MiB" , "GiB" , "TiB" , "PiB" , "EiB" ,
@@ -142,7 +141,7 @@ define_Conf! {
142
141
/// Lint: DECIMAL_LITERAL_REPRESENTATION. The lower bound for linting decimal literals
143
142
( literal_representation_threshold: u64 = 16384 ) ,
144
143
/// Lint: TRIVIALLY_COPY_PASS_BY_REF. The maximum size (in bytes) to consider a `Copy` type for passing by value instead of by reference.
145
- ( trivial_copy_size_limit: Option <u64 >) ,
144
+ ( trivial_copy_size_limit: Option <u64 > = None ) ,
146
145
/// Lint: LARGE_TYPE_PASS_BY_MOVE. The minimum size (in bytes) to consider a type for passing by reference instead of by value.
147
146
( pass_by_value_size_limit: u64 = 256 ) ,
148
147
/// Lint: TOO_MANY_LINES. The maximum number of lines a function or method can have
@@ -158,15 +157,15 @@ define_Conf! {
158
157
/// Lint: FN_PARAMS_EXCESSIVE_BOOLS. The maximum number of bools function parameters can have
159
158
( max_fn_params_bools: u64 = 3 ) ,
160
159
/// Lint: WILDCARD_IMPORTS. Whether to allow certain wildcard imports (prelude, super in tests).
161
- ( warn_on_all_wildcard_imports: bool ) ,
160
+ ( warn_on_all_wildcard_imports: bool = false ) ,
162
161
/// Lint: DISALLOWED_METHOD. The list of disallowed methods, written as fully qualified paths.
163
- ( disallowed_methods: Vec <String >) ,
162
+ ( disallowed_methods: Vec <String > = Vec :: new ( ) ) ,
164
163
/// Lint: UNREADABLE_LITERAL. Should the fraction of a decimal be linted to include separators.
165
164
( unreadable_literal_lint_fractions: bool = true ) ,
166
165
/// Lint: UPPER_CASE_ACRONYMS. Enables verbose mode. Triggers if there is more than one uppercase char next to each other
167
- ( upper_case_acronyms_aggressive: bool ) ,
166
+ ( upper_case_acronyms_aggressive: bool = false ) ,
168
167
/// Lint: _CARGO_COMMON_METADATA. For internal testing only, ignores the current `publish` settings in the Cargo manifest.
169
- ( cargo_ignore_publish: bool ) ,
168
+ ( cargo_ignore_publish: bool = false ) ,
170
169
}
171
170
172
171
/// Search for the configuration file.
0 commit comments