Skip to content

Commit

Permalink
Explain check_docs_formatted.py error message (#6125)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
konstin authored and charliermarsh committed Jul 27, 2023
1 parent 13af912 commit 2a65e6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/check_docs_formatted.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a65e6f

Please sign in to comment.