Skip to content


rstfmt documentation

rstfmt - GitHub

Configuration in Mega-Linter

Variable Description Default value
RST_RSTFMT_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
RST_RSTFMT_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Include every file
RST_RSTFMT_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
RST_RSTFMT_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
RST_RSTFMT_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
RST_RSTFMT_DISABLE_ERRORS Run linter but consider errors as warnings true
RST_RSTFMT_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0

Mega-Linter Flavours

This linter is available in the following flavours

Flavor Description Embedded linters Info
all Default Mega-Linter Flavor 91 Docker Image Size (tag) Docker Pulls
python Optimized for PYTHON based projects 47 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • File extensions: .rst

Example calls

rstfmt --check myfile.rst
rstfmt myfile.rst

Help content

usage: rstfmt [-h] [-v] [-w WIDTH] [--check] [--test] [--version] [files ...]

positional arguments:

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  -w WIDTH, --width WIDTH

Installation on mega-linter Docker image

Example success log

Results of rstfmt linter (version 0.0.0)
See documentation on

[SUCCESS] .automation/test/rst_rstfmt/rst_good_1.rst