Module style

Source
Expand description

Tidy check to enforce various stylistic guidelines on the Rust codebase.

Example checks are:

  • No lines over 100 characters (in non-Rust files).
  • No files with over 3000 lines (in non-Rust files).
  • No tabs.
  • No trailing whitespace.
  • No CR characters.
  • No TODO or XXX directives.
  • No unexplained ```ignore or ```rust,ignore doc tests.

Note that some of these rules are excluded from Rust files because we enforce rustfmt. It is preferable to be formatted rather than tidy-clean.

A number of these checks can be opted-out of with various directives of the form: // ignore-tidy-CHECK-NAME.

MacrosΒ§

suppressible_tidy_err πŸ”’

EnumsΒ§

Directive πŸ”’
LIUState πŸ”’
Parser states for line_is_url.

ConstantsΒ§

ANNOTATIONS_TO_IGNORE πŸ”’
COLS πŸ”’
CONFIGURABLE_CHECKS πŸ”’
DOUBLE_SPACE_AFTER_DOT πŸ”’
ERROR_CODE_COLS πŸ”’
Error code markdown is restricted to 80 columns because they can be displayed on the console with –example.
GOML_COLS πŸ”’
INTERNAL_COMPILER_DOCS_LINE πŸ”’
LETTER_DIGIT πŸ”’
LINELENGTH_CHECK πŸ”’
LINES πŸ”’
LLVM_UNREACHABLE_INFO πŸ”’
ROOT_PROBLEMATIC_CONSTS πŸ”’
UNEXPLAINED_IGNORE_DOCTEST_INFO πŸ”’

StaticsΒ§

PROBLEMATIC_CONSTS_STRINGS πŸ”’

FunctionsΒ§

check
contains_ignore_directives πŸ”’
contains_problematic_const πŸ”’
generate_problematic_strings πŸ”’
generate_problems πŸ”’
is_in
is_unexplained_ignore πŸ”’
line_is_url πŸ”’
Returns true if line appears to be a line comment containing a URL, possibly with a Markdown link label in front, and nothing else. The Markdown link label, if present, may not contain whitespace. Lines of this form are allowed to be overlength, because Markdown offers no way to split a line in the middle of a URL, and the lengths of URLs to external references are beyond our control.
long_line_is_ok πŸ”’
Returns true if line is allowed to be longer than the normal limit.
should_ignore πŸ”’
Returns true if line can be ignored. This is the case when it contains an annotation that is explicitly ignored.
skip_markdown_path πŸ”’