@@ -294,10 +294,10 @@ fn lint_std_filesystem() -> LintResult {
294294 . success ( ) ;
295295 if found {
296296 Err ( r#"
297- ^^^
298297Direct use of std::filesystem may be dangerous and buggy. Please include <util/fs.h> and use the
299298fs:: namespace, which has unsafe filesystem functions marked as deleted.
300299 "#
300+ . trim ( )
301301 . to_string ( ) )
302302 } else {
303303 Ok ( ( ) )
@@ -322,12 +322,12 @@ fn lint_rpc_assert() -> LintResult {
322322 . success ( ) ;
323323 if found {
324324 Err ( r#"
325- ^^^
326325CHECK_NONFATAL(condition) or NONFATAL_UNREACHABLE should be used instead of assert for RPC code.
327326
328327Aborting the whole process is undesirable for RPC code. So nonfatal
329328checks should be used over assert. See: src/util/check.h
330329 "#
330+ . trim ( )
331331 . to_string ( ) )
332332 } else {
333333 Ok ( ( ) )
@@ -350,10 +350,10 @@ fn lint_boost_assert() -> LintResult {
350350 . success ( ) ;
351351 if found {
352352 Err ( r#"
353- ^^^
354353BOOST_ASSERT must be replaced with Assert, BOOST_REQUIRE, or BOOST_CHECK to avoid an unnecessary
355354include of the boost/assert.hpp dependency.
356355 "#
356+ . trim ( )
357357 . to_string ( ) )
358358 } else {
359359 Ok ( ( ) )
@@ -370,17 +370,15 @@ fn lint_doc_release_note_snippets() -> LintResult {
370370 if non_release_notes. is_empty ( ) {
371371 Ok ( ( ) )
372372 } else {
373- Err ( format ! (
374- r#"
375- {}
376- ^^^
373+ println ! ( "{non_release_notes}" ) ;
374+ Err ( r#"
377375Release note snippets and other docs must be put into the doc/ folder directly.
378376
379377The doc/release-notes/ folder is for archived release notes of previous releases only. Snippets are
380378expected to follow the naming "/doc/release-notes-<PR number>.md".
381- "# ,
382- non_release_notes
383- ) )
379+ "#
380+ . trim ( )
381+ . to_string ( ) )
384382 }
385383}
386384
@@ -423,7 +421,6 @@ fn lint_trailing_whitespace() -> LintResult {
423421 . success ( ) ;
424422 if trailing_space {
425423 Err ( r#"
426- ^^^
427424Trailing whitespace (including Windows line endings [CR LF]) is problematic, because git may warn
428425about it, or editors may remove it by default, forcing developers in the future to either undo the
429426changes manually or spend time on review.
@@ -433,6 +430,7 @@ Thus, it is best to remove the trailing space now.
433430Please add any false positives, such as subtrees, Windows-related files, patch files, or externally
434431sourced files to the exclude list.
435432 "#
433+ . trim ( )
436434 . to_string ( ) )
437435 } else {
438436 Ok ( ( ) )
@@ -449,14 +447,14 @@ fn lint_tabs_whitespace() -> LintResult {
449447 . success ( ) ;
450448 if tabs {
451449 Err ( r#"
452- ^^^
453450Use of tabs in this codebase is problematic, because existing code uses spaces and tabs will cause
454451display issues and conflict with editor settings.
455452
456453Please remove the tabs.
457454
458455Please add any false positives, such as subtrees, or externally sourced files to the exclude list.
459456 "#
457+ . trim ( )
460458 . to_string ( ) )
461459 } else {
462460 Ok ( ( ) )
@@ -531,7 +529,6 @@ fn lint_includes_build_config() -> LintResult {
531529 if missing {
532530 return Err ( format ! (
533531 r#"
534- ^^^
535532One or more files use a symbol declared in the bitcoin-build-config.h header. However, they are not
536533including the header. This is problematic, because the header may or may not be indirectly
537534included. If the indirect include were to be intentionally or accidentally removed, the build could
@@ -547,12 +544,13 @@ include again.
547544#include <bitcoin-build-config.h> // IWYU pragma: keep
548545 "# ,
549546 defines_regex
550- ) ) ;
547+ )
548+ . trim ( )
549+ . to_string ( ) ) ;
551550 }
552551 let redundant = print_affected_files ( false ) ;
553552 if redundant {
554553 return Err ( r#"
555- ^^^
556554None of the files use a symbol declared in the bitcoin-build-config.h header. However, they are including
557555the header. Consider removing the unused include.
558556 "#
@@ -605,7 +603,9 @@ Markdown link errors found:
605603{}
606604 "# ,
607605 stderr
608- ) )
606+ )
607+ . trim ( )
608+ . to_string ( ) )
609609 }
610610 Err ( e) if e. kind ( ) == ErrorKind :: NotFound => {
611611 println ! ( "`mlc` was not found in $PATH, skipping markdown lint check." ) ;
@@ -657,10 +657,9 @@ fn main() -> ExitCode {
657657 env:: set_current_dir ( & git_root) . unwrap ( ) ;
658658 if let Err ( err) = ( linter. lint_fn ) ( ) {
659659 println ! (
660- "{err}\n ^---- ⚠️ Failure generated from lint check '{}'! " ,
661- linter. name
660+ "^^^ \n {err}\n ^---- ⚠️ Failure generated from lint check '{}' ({})! \n \n " ,
661+ linter. name, linter . description ,
662662 ) ;
663- println ! ( "{}\n \n " , linter. description) ;
664663 test_failed = true ;
665664 }
666665 }
0 commit comments