Registered by Colin Watson

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.
 * reStructuredText-style headings should be used, not MoinMoin-style.

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-config.yaml file:

    - repo: https://git.launchpad.net/lp-lint-doctest
        rev: '' # pick a git tag to point to
        hooks:
        - id: lp-lint-doctest

Project information

Part of:
Launchpad Suite
Maintainer:
LAZR Developers
Driver:
Not yet selected
Licence:
MIT / X / Expat Licence

RDF metadata

View full history Series and milestones

trunk series is the current focus of development.

All code Code

Version control system:
Git
Programming languages:
Python

All bugs Latest bugs reported

Get Involved

Downloads

Latest version is 0.4
released

All downloads

Announcements