@@ -18,23 +18,26 @@ use std::{cmp, env, fmt, fs, io};
1818#[ rustfmt:: skip]
1919const DEFAULT_DOC_VALID_IDENTS : & [ & str ] = & [
2020 "KiB" , "MiB" , "GiB" , "TiB" , "PiB" , "EiB" ,
21+ "AccessKit" ,
22+ "CoreFoundation" , "CoreGraphics" , "CoreText" ,
2123 "DevOps" ,
22- "DirectX" ,
24+ "Direct2D" , "Direct3D" , "DirectWrite" , " DirectX",
2325 "ECMAScript" ,
2426 "GPLv2" , "GPLv3" ,
2527 "GitHub" , "GitLab" ,
2628 "IPv4" , "IPv6" ,
27- "ClojureScript" , "CoffeeScript" , "JavaScript" , "PureScript" , "TypeScript" ,
29+ "ClojureScript" , "CoffeeScript" , "JavaScript" , "PostScript" , " PureScript", "TypeScript" ,
2830 "WebAssembly" ,
2931 "NaN" , "NaNs" ,
3032 "OAuth" , "GraphQL" ,
3133 "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" ,
3437 "WebP" , "OpenExr" , "YCbCr" , "sRGB" ,
3538 "TensorFlow" ,
3639 "TrueType" ,
37- "iOS" , "macOS" , "FreeBSD" ,
40+ "iOS" , "macOS" , "FreeBSD" , "NetBSD" , "OpenBSD" ,
3841 "TeX" , "LaTeX" , "BibTeX" , "BibLaTeX" ,
3942 "MinGW" ,
4043 "CamelCase" ,
@@ -235,7 +238,7 @@ define_Conf! {
235238 ///
236239 /// A type, say `SomeType`, listed in this configuration has the same behavior of
237240 /// `["SomeType" , "*"], ["*", "SomeType"]` in `arithmetic_side_effects_allowed_binary`.
238- ( arithmetic_side_effects_allowed: FxHashSet <String > = <_>:: default ( ) ) ,
241+ ( arithmetic_side_effects_allowed: Vec <String > = <_>:: default ( ) ) ,
239242 /// Lint: ARITHMETIC_SIDE_EFFECTS.
240243 ///
241244 /// Suppress checking of the passed type pair names in binary operations like addition or
@@ -262,12 +265,12 @@ define_Conf! {
262265 /// ```toml
263266 /// arithmetic-side-effects-allowed-unary = ["SomeType", "AnotherType"]
264267 /// ```
265- ( arithmetic_side_effects_allowed_unary: FxHashSet <String > = <_>:: default ( ) ) ,
268+ ( arithmetic_side_effects_allowed_unary: Vec <String > = <_>:: default ( ) ) ,
266269 /// 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.
267270 ///
268271 /// Suppress lints whenever the suggested change would cause breakage for other crates.
269272 ( 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.
271274 ///
272275 /// The minimum rust version that the project supports. Defaults to the `rust-version` field in `Cargo.toml`
273276 #[ default_text = "" ]
@@ -311,7 +314,7 @@ define_Conf! {
311314 /// default configuration of Clippy. By default, any configuration will replace the default value. For example:
312315 /// * `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
313316 /// * `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( ) ) ,
315318 /// Lint: TOO_MANY_ARGUMENTS.
316319 ///
317320 /// The maximum number of argument a function or method can have
@@ -547,7 +550,7 @@ define_Conf! {
547550 /// Lint: PATH_ENDS_WITH_EXT.
548551 ///
549552 /// 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 ( ) ) ,
551554 /// Lint: MULTIPLE_CRATE_VERSIONS.
552555 ///
553556 /// A list of crate names to allow duplicates of
@@ -700,7 +703,6 @@ pub fn lookup_conf_file() -> io::Result<(Option<PathBuf>, Vec<String>)> {
700703fn deserialize ( file : & SourceFile ) -> TryConf {
701704 match toml:: de:: Deserializer :: new ( file. src . as_ref ( ) . unwrap ( ) ) . deserialize_map ( ConfVisitor ( file) ) {
702705 Ok ( mut conf) => {
703- extend_vec_if_indicator_present ( & mut conf. conf . doc_valid_idents , DEFAULT_DOC_VALID_IDENTS ) ;
704706 extend_vec_if_indicator_present ( & mut conf. conf . disallowed_names , DEFAULT_DISALLOWED_NAMES ) ;
705707 extend_vec_if_indicator_present ( & mut conf. conf . allowed_prefixes , DEFAULT_ALLOWED_PREFIXES ) ;
706708 extend_vec_if_indicator_present (
@@ -713,6 +715,11 @@ fn deserialize(file: &SourceFile) -> TryConf {
713715 . allowed_idents_below_min_chars
714716 . extend ( DEFAULT_ALLOWED_IDENTS_BELOW_MIN_CHARS . iter ( ) . map ( ToString :: to_string) ) ;
715717 }
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+ }
716723
717724 conf
718725 } ,
0 commit comments