@@ -18,23 +18,26 @@ use std::{cmp, env, fmt, fs, io};
18
18
#[ rustfmt:: skip]
19
19
const DEFAULT_DOC_VALID_IDENTS : & [ & str ] = & [
20
20
"KiB" , "MiB" , "GiB" , "TiB" , "PiB" , "EiB" ,
21
+ "AccessKit" ,
22
+ "CoreFoundation" , "CoreGraphics" , "CoreText" ,
21
23
"DevOps" ,
22
- "DirectX" ,
24
+ "Direct2D" , "Direct3D" , "DirectWrite" , " DirectX",
23
25
"ECMAScript" ,
24
26
"GPLv2" , "GPLv3" ,
25
27
"GitHub" , "GitLab" ,
26
28
"IPv4" , "IPv6" ,
27
- "ClojureScript" , "CoffeeScript" , "JavaScript" , "PureScript" , "TypeScript" ,
29
+ "ClojureScript" , "CoffeeScript" , "JavaScript" , "PostScript" , " PureScript", "TypeScript" ,
28
30
"WebAssembly" ,
29
31
"NaN" , "NaNs" ,
30
32
"OAuth" , "GraphQL" ,
31
33
"OCaml" ,
32
- "OpenDNS" , "OpenGL" , "OpenMP" , "OpenSSH" , "OpenSSL" , "OpenStreetMap" , "OpenTelemetry" ,
33
- "WebGL" , "WebGL2" , "WebGPU" ,
34
+ "OpenAL" , "OpenDNS" , "OpenGL" , "OpenMP" , "OpenSSH" , "OpenSSL" , "OpenStreetMap" , "OpenTelemetry" ,
35
+ "OpenType" ,
36
+ "WebGL" , "WebGL2" , "WebGPU" , "WebRTC" , "WebSocket" , "WebTransport" ,
34
37
"WebP" , "OpenExr" , "YCbCr" , "sRGB" ,
35
38
"TensorFlow" ,
36
39
"TrueType" ,
37
- "iOS" , "macOS" , "FreeBSD" ,
40
+ "iOS" , "macOS" , "FreeBSD" , "NetBSD" , "OpenBSD" ,
38
41
"TeX" , "LaTeX" , "BibTeX" , "BibLaTeX" ,
39
42
"MinGW" ,
40
43
"CamelCase" ,
@@ -235,7 +238,7 @@ define_Conf! {
235
238
///
236
239
/// A type, say `SomeType`, listed in this configuration has the same behavior of
237
240
/// `["SomeType" , "*"], ["*", "SomeType"]` in `arithmetic_side_effects_allowed_binary`.
238
- ( arithmetic_side_effects_allowed: FxHashSet <String > = <_>:: default ( ) ) ,
241
+ ( arithmetic_side_effects_allowed: Vec <String > = <_>:: default ( ) ) ,
239
242
/// Lint: ARITHMETIC_SIDE_EFFECTS.
240
243
///
241
244
/// Suppress checking of the passed type pair names in binary operations like addition or
@@ -262,12 +265,12 @@ define_Conf! {
262
265
/// ```toml
263
266
/// arithmetic-side-effects-allowed-unary = ["SomeType", "AnotherType"]
264
267
/// ```
265
- ( arithmetic_side_effects_allowed_unary: FxHashSet <String > = <_>:: default ( ) ) ,
268
+ ( arithmetic_side_effects_allowed_unary: Vec <String > = <_>:: default ( ) ) ,
266
269
/// Lint: ENUM_VARIANT_NAMES, LARGE_TYPES_PASSED_BY_VALUE, TRIVIALLY_COPY_PASS_BY_REF, UNNECESSARY_WRAPS, UNUSED_SELF, UPPER_CASE_ACRONYMS, WRONG_SELF_CONVENTION, BOX_COLLECTION, REDUNDANT_ALLOCATION, RC_BUFFER, VEC_BOX, OPTION_OPTION, LINKEDLIST, RC_MUTEX, UNNECESSARY_BOX_RETURNS, SINGLE_CALL_FN, NEEDLESS_PASS_BY_REF_MUT.
267
270
///
268
271
/// Suppress lints whenever the suggested change would cause breakage for other crates.
269
272
( avoid_breaking_exported_api: bool = true ) ,
270
- /// Lint: MANUAL_SPLIT_ONCE, MANUAL_STR_REPEAT, CLONED_INSTEAD_OF_COPIED, REDUNDANT_FIELD_NAMES, OPTION_MAP_UNWRAP_OR, 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, IF_THEN_SOME_ELSE_NONE, APPROX_CONSTANT, DEPRECATED_CFG_ATTR, INDEX_REFUTABLE_SLICE, MAP_CLONE, BORROW_AS_PTR, MANUAL_BITS, ERR_EXPECT, CAST_ABS_TO_UNSIGNED, UNINLINED_FORMAT_ARGS, MANUAL_CLAMP, MANUAL_LET_ELSE, UNCHECKED_DURATION_SUBTRACTION, COLLAPSIBLE_STR_REPLACE, SEEK_FROM_CURRENT, SEEK_REWIND, UNNECESSARY_LAZY_EVALUATIONS, TRANSMUTE_PTR_TO_REF, ALMOST_COMPLETE_RANGE, NEEDLESS_BORROW, DERIVABLE_IMPLS, MANUAL_IS_ASCII_CHECK, MANUAL_REM_EUCLID, MANUAL_RETAIN, TYPE_REPETITION_IN_BOUNDS, TUPLE_ARRAY_CONVERSIONS, MANUAL_TRY_FOLD, MANUAL_HASH_ONE, ITER_KV_MAP, MANUAL_C_STR_LITERALS, ASSIGNING_CLONES, LEGACY_NUMERIC_CONSTANTS, MANUAL_PATTERN_CHAR_COMPARISON, ALLOW_ATTRIBUTES, ALLOW_ATTRIBUTES_WITHOUT_REASON.
273
+ /// Lint: MANUAL_SPLIT_ONCE, MANUAL_STR_REPEAT, CLONED_INSTEAD_OF_COPIED, REDUNDANT_FIELD_NAMES, OPTION_MAP_UNWRAP_OR, 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, IF_THEN_SOME_ELSE_NONE, APPROX_CONSTANT, DEPRECATED_CFG_ATTR, INDEX_REFUTABLE_SLICE, MAP_CLONE, BORROW_AS_PTR, MANUAL_BITS, ERR_EXPECT, CAST_ABS_TO_UNSIGNED, UNINLINED_FORMAT_ARGS, MANUAL_CLAMP, MANUAL_LET_ELSE, UNCHECKED_DURATION_SUBTRACTION, COLLAPSIBLE_STR_REPLACE, SEEK_FROM_CURRENT, SEEK_REWIND, UNNECESSARY_LAZY_EVALUATIONS, TRANSMUTE_PTR_TO_REF, ALMOST_COMPLETE_RANGE, NEEDLESS_BORROW, DERIVABLE_IMPLS, MANUAL_IS_ASCII_CHECK, MANUAL_REM_EUCLID, MANUAL_RETAIN, TYPE_REPETITION_IN_BOUNDS, TUPLE_ARRAY_CONVERSIONS, MANUAL_TRY_FOLD, MANUAL_HASH_ONE, ITER_KV_MAP, MANUAL_C_STR_LITERALS, ASSIGNING_CLONES, LEGACY_NUMERIC_CONSTANTS, MANUAL_PATTERN_CHAR_COMPARISON, ALLOW_ATTRIBUTES, ALLOW_ATTRIBUTES_WITHOUT_REASON, COLLAPSIBLE_MATCH.
271
274
///
272
275
/// The minimum rust version that the project supports. Defaults to the `rust-version` field in `Cargo.toml`
273
276
#[ default_text = "" ]
@@ -311,7 +314,7 @@ define_Conf! {
311
314
/// default configuration of Clippy. By default, any configuration will replace the default value. For example:
312
315
/// * `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
313
316
/// * `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.
314
- ( doc_valid_idents: Vec <String > = DEFAULT_DOC_VALID_IDENTS . iter( ) . map( ToString :: to_string) . collect( ) ) ,
317
+ ( doc_valid_idents: FxHashSet <String > = DEFAULT_DOC_VALID_IDENTS . iter( ) . map( ToString :: to_string) . collect( ) ) ,
315
318
/// Lint: TOO_MANY_ARGUMENTS.
316
319
///
317
320
/// The maximum number of argument a function or method can have
@@ -547,7 +550,7 @@ define_Conf! {
547
550
/// Lint: PATH_ENDS_WITH_EXT.
548
551
///
549
552
/// Additional dotfiles (files or directories starting with a dot) to allow
550
- ( allowed_dotfiles: FxHashSet <String > = FxHashSet :: default ( ) ) ,
553
+ ( allowed_dotfiles: Vec <String > = Vec :: default ( ) ) ,
551
554
/// Lint: MULTIPLE_CRATE_VERSIONS.
552
555
///
553
556
/// A list of crate names to allow duplicates of
@@ -700,7 +703,6 @@ pub fn lookup_conf_file() -> io::Result<(Option<PathBuf>, Vec<String>)> {
700
703
fn deserialize ( file : & SourceFile ) -> TryConf {
701
704
match toml:: de:: Deserializer :: new ( file. src . as_ref ( ) . unwrap ( ) ) . deserialize_map ( ConfVisitor ( file) ) {
702
705
Ok ( mut conf) => {
703
- extend_vec_if_indicator_present ( & mut conf. conf . doc_valid_idents , DEFAULT_DOC_VALID_IDENTS ) ;
704
706
extend_vec_if_indicator_present ( & mut conf. conf . disallowed_names , DEFAULT_DISALLOWED_NAMES ) ;
705
707
extend_vec_if_indicator_present ( & mut conf. conf . allowed_prefixes , DEFAULT_ALLOWED_PREFIXES ) ;
706
708
extend_vec_if_indicator_present (
@@ -713,6 +715,11 @@ fn deserialize(file: &SourceFile) -> TryConf {
713
715
. allowed_idents_below_min_chars
714
716
. extend ( DEFAULT_ALLOWED_IDENTS_BELOW_MIN_CHARS . iter ( ) . map ( ToString :: to_string) ) ;
715
717
}
718
+ if conf. conf . doc_valid_idents . contains ( ".." ) {
719
+ conf. conf
720
+ . doc_valid_idents
721
+ . extend ( DEFAULT_DOC_VALID_IDENTS . iter ( ) . map ( ToString :: to_string) ) ;
722
+ }
716
723
717
724
conf
718
725
} ,
0 commit comments