From 2a65e6fc38610bcfac7154207d2e885f004b2b19 Mon Sep 17 00:00:00 2001 From: konsti Date: Thu, 27 Jul 2023 15:53:52 +0200 Subject: [PATCH] Explain check_docs_formatted.py error message (#6125) ## Summary This is an error message only change to lead an implementor of a new rule that has an unformatted or invalid bad example to the right code. ## Test Plan n/a --- scripts/check_docs_formatted.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/check_docs_formatted.py b/scripts/check_docs_formatted.py index 256e2b33944b3..e6ad2cbbc4488 100755 --- a/scripts/check_docs_formatted.py +++ b/scripts/check_docs_formatted.py @@ -146,15 +146,19 @@ def format_file( if errors and not args.skip_errors and not error_known: for error in errors: rule_name = file.name.split(".")[0] - print(f"Docs parse error for `{rule_name}` docs: {error}") + print( + f"Docs parse error for `{rule_name}` docs. Either fix or add to " + f"`KNOWN_PARSE_ERRORS`. {error}", + ) return 2 if contents != new_contents: rule_name = file.name.split(".")[0] print( - f"Rule `{rule_name}` docs are not formatted. The example section " - f"should be rewritten to:", + f"Rule `{rule_name}` docs are not formatted. Either format the rule or add " + f"to `KNOWN_FORMATTING_VIOLATIONS`. The example section should be " + f"rewritten to:", ) # Add indentation so that snipped can be copied directly to docs