Style checker for Launchpad doctests.
lp-lint-doctest is a style checker for Python doctests stored in text files (as opposed to doctests stored in docstrings), optimized for use in Launchpad development. It applies the following checks:
* Comments should be in the narrative part of the doctest (i.e. in unindented text) rather than in Python examples.
* Narrative text lines are limited to 78 characters.
* Source lines in examples (beginning with ">>>" or "...") are limited to 70 characters.
* Expected output lines in examples are limited to 74 characters.
* Source and expected output lines should be indented by exactly four spaces.
* There should be no trailing whitespace.
* reStructuredTex
In addition, lp-lint-doctest runs pyflakes on the accumulated source code of each doctest file.
This project was split out from Curtis Hovey's pocket-lint project. Since that was written, many other excellent linters have arisen for most of the other source types supported by pocket-lint, but there seems to be no other viable replacement for its doctest checks.
lp-lint-doctest supports pre-commit. To use it, add the following to the "repos" section of your .pre-commit-
- repo: https:/
rev: '' # pick a git tag to point to
hooks:
- id: lp-lint-doctest
Project information
- Licence:
- MIT / X / Expat Licence
View full history Series and milestones
trunk series is the current focus of development.