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
This commit is contained in:
konsti 2023-07-27 15:53:52 +02:00 committed by GitHub
parent 0c2abf8316
commit e87032d57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -146,15 +146,19 @@ def format_file(
if errors and not args.skip_errors and not error_known: if errors and not args.skip_errors and not error_known:
for error in errors: for error in errors:
rule_name = file.name.split(".")[0] 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 return 2
if contents != new_contents: if contents != new_contents:
rule_name = file.name.split(".")[0] rule_name = file.name.split(".")[0]
print( print(
f"Rule `{rule_name}` docs are not formatted. The example section " f"Rule `{rule_name}` docs are not formatted. Either format the rule or add "
f"should be rewritten to:", f"to `KNOWN_FORMATTING_VIOLATIONS`. The example section should be "
f"rewritten to:",
) )
# Add indentation so that snipped can be copied directly to docs # Add indentation so that snipped can be copied directly to docs