A framework for style checking and linting
Project description
Monostyle
Monostyle is a framework for documentation style checking and linting covering all parts of a style guide.
Its tools are applied on new or changed content which makes it fast and it allows a wider range of tools, because they can have false positives. For example style guide rules that have exceptions which can't be filtered out. Supported for versioning are SVN and Git (experimental).
Monostyle is build as a framework and not as a ready-made tool because the tools require customization like markup filtering or you might not want to use Chicago style title case. It includes its own RST parser and a port of the Reflow line wrapper. Its utilities can also be used for text editing with scripts.
Setup
Requirements: When using SVN the command line client tools need to be installed.
For spell checking a dictionary has to build. On first run you have to confirm to start this (or also if the dictionary file is not found).
The dictionary has to be updated from time to time or after a new topic has been added
to include new words (of cause the whole project has to be spell-checked).
To do this run the spelling
script:
python -m monostyle.spelling
Running Monostyle
Monostyle has four modes:
- -i, --internal
- To check your own changes (the default).
- -e, --external
- To check changes made to the repository by others. Run this before you update your working copy with Git or SVN.
- -p, --patch
- To check changes in a patch-file.
- -f, --file
- To check a file or directory.
- -r, --root
- The root is the absolute path to the project directory or where the patch file was created. If not set the directory where Monostyle is run from is used as the root.
- --cached, --staged
- Set the diff cached option (Git only).
Post processing:
- -u, --update
- Update the working copy.
- -a, --autofix
- Apply autofixes. This also does an update if the changes are external.
- -o, --open
- Open a file in a text editor if the report has a severity higher than specified. Please check if your editor of choice is available (else please make a I/PR to add it).
For more info on command line arguments use the --help
command.
The tools can be applied individually by executing the script files. Then the tools will loop over the whole project.
Running Monostyle does not replace building the project with Sphinx. Markup errors can lead to false negatives, so Monostyle has to be run again or the affected section has to be checked manually.
Advanced
You can set a commit/revision for internal, external and update (SVN only). With Git these are passed unaltered to diff. However, with SVN these can be colon separated or dash separated for the "change" syntax. When a side is omitted e.g. ":ARG" it will default to BASE (your working copy) on the left and on the right to HEAD (the latest revision in the repository). For external revisions the "change" syntax is used for single arguments "ARG".
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for monostyle-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 777089e2906c5787db2513412b7df7e85ab04c30ce097214930b45979f259fac |
|
MD5 | 8b57a3df5450dc51867aced00e7569aa |
|
BLAKE2b-256 | 819006c047586b687f13522f126b6b5ad65441cde019df999bcbaad22a33eb76 |