rstfmt
rstfmt documentation
- Visit Official Web Site
Configuration in Mega-Linter
- Enable rstfmt by adding
RST_RSTFMT
in ENABLE_LINTERS variable - Disable rstfmt by adding
RST_RSTFMT
in DISABLE_LINTERS variable
- Enable auto-fixes by adding
RST_RSTFMT
in APPLY_FIXES variable
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 filesEx: [".py", ""] |
[".rst"] |
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 |
Mega-Linter Flavours
This linter is available in the following flavours
Flavor | Description | Embedded linters | Info | |
---|---|---|---|---|
![]() |
all | Default Mega-Linter Flavor | 83 | |
python | Optimized for PYTHON based projects | 43 |
Behind the scenes
How are identified applicable files
- File extensions:
.rst
Example calls
rstfmt myfile.rst
rstfmt -i myfile.rst
Help content
usage: rstfmt [-h] [-v] [-w WIDTH] [--check] [--test] [files [files ...]]
positional arguments:
files
optional arguments:
-h, --help show this help message and exit
-v, --verbose
-w WIDTH, --width WIDTH
--check
--test
Installation on mega-linter Docker image
- PIP packages (Python):
Example success log
Results of rstfmt linter (version 0.0.0)
See documentation on https://nvuillam.github.io/mega-linter/descriptors/rst_rstfmt/
-----------------------------------------------
[SUCCESS] .automation/test/rst_rstfmt/rst_good_1.rst