File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -668,6 +668,25 @@ fn foo() {}
668668 ) ;
669669}
670670
671+ /// MD013 should not flag long lines inside indented code blocks in doc comments.
672+ #[ test]
673+ fn test_md013_skips_indented_code_blocks_in_doc_comments ( ) {
674+ let content = "/// # Examples\n ///\n /// let very_long_variable_name_that_exceeds_eighty_characters = some_function_with_a_long_name(argument_one, argument_two);\n ///\n fn foo() {}\n " ;
675+
676+ let rules = default_rules ( ) ;
677+ let config = Config :: default ( ) ;
678+ let warnings = check_doc_comment_blocks ( content, & rules, & config) ;
679+
680+ let md013_warnings: Vec < _ > = warnings
681+ . iter ( )
682+ . filter ( |w| w. rule_name . as_deref ( ) == Some ( "MD013" ) )
683+ . collect ( ) ;
684+ assert ! (
685+ md013_warnings. is_empty( ) ,
686+ "MD013 should not flag indented code blocks in doc comments, got: {md013_warnings:?}"
687+ ) ;
688+ }
689+
671690/// MD013 should still flag long prose lines in doc comments.
672691#[ test]
673692fn test_md013_still_flags_long_prose_in_doc_comments ( ) {
You can’t perform that action at this time.
0 commit comments