Skip to main content

Style checker for Launchpad doctests.

Project description

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

NEWS for lp-lint-doctest

0.1 (2021-07-24)

  • Initial release, split out from pocket-lint.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lp-lint-doctest-0.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

lp_lint_doctest-0.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file lp-lint-doctest-0.1.tar.gz.

File metadata

  • Download URL: lp-lint-doctest-0.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.10

File hashes

Hashes for lp-lint-doctest-0.1.tar.gz
Algorithm Hash digest
SHA256 04d636a4090a7a53bab4c47eb1cb6dbc6af78bb8eadfb0d0e7b54e7d936e7d1d
MD5 7a212cc322369632e32deae9f2e7b8b5
BLAKE2b-256 f229fb3d3bff10fcef11095f8d7a10cecaed0123df6d1dfe08e1a96604345667

See more details on using hashes here.

File details

Details for the file lp_lint_doctest-0.1-py3-none-any.whl.

File metadata

  • Download URL: lp_lint_doctest-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.10

File hashes

Hashes for lp_lint_doctest-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 727b4dbcc798be3ae057ea647e9db092ca4097f39e199bac0461aa5096f57e89
MD5 49433d399b4ddebde1a008d13c2bf785
BLAKE2b-256 8a50b3a249e1344f860733fba06fc1e3a8d2ee6a87ad34c06af01ca5d2d8687b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page