Skip to main content

A limited docstring linter which checks that function/method parameters are defined in their docstrings. Darglint expects docstrings to be formatted using the Google Python Style Guide.

Darglint is in a very early stage, and fails for a lot of things. Certain features, such as a robust command-line interface, still do not exist.

Installation

To install darglint, use pip.

pip install darglint

Or, clone the repository, cd to the directory, and

pip install .

Usage

Given a python source file, serializers.py, you would check the docstrings as follows:

darglint serializers.py

You can give an optional verbosity setting to darglint. For example,

darglint -v 3 *.py

Would give the most verbose warnings for each python module in the current directory.

Features planned and implemented

The below list is all that defines the current roadmap for darglint. It is roughly sorted in order of importance.

  • [x] Function definitions can be checked.

  • [x] Methods definitions of top-level class can be checked.

  • [x] Line number printout for function/method definition.

  • [x] Add parsing of “Returns” section, and warn if differing from function definition.

  • [x] Add command line interface.

  • [x] Add multiple options for output.

  • [ ] Add checks for “Raises” section, like “Args”. Any exceptions raised in the body should be documented.

  • [ ] Add checks for “Yields” section, like “Returns”.

  • [ ] Add numbers to errors, ability to silence certain errors. (Use same formatting as pycodestyle.)

  • [ ] Add TOML configuration file (use same interface as pydoclint, etc.)

  • [ ] Add type hint integration. If an argument has a type hint, then the description of the argument, if it has a type, should match that.

  • [ ] Add support for python versions earlier than 3.6.

  • [ ] Syntastic support. (Syntastic is not accepting new checkers until their next API stabilizes, so this may take some time.)

Development

Install darglint. First, clone the repository:

git clone https://github.com/terrencepreilly/darglint.git

cd into the directory, create a virtual environment (optional), then setup:

cd darglint/
virtualenv -p python3.6 .env
source .env/bin/activate
pip install -e .

You can run the tests using

python setup.py test

Or, install pytest manually, cd to the project’s root directory, and run

pytest

Contributions welcome.

Release files for darglint 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for darglint 0.0.4
File Size Uploaded
darglint-0.0.4.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for darglint 0.0.4
File Interpreter ABI Platform
darglint-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size:27.4 kB

Release files / darglint-0.0.4.tar.gz

Download URL darglint-0.0.4.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ddf68128cacc185d77d1bf52499468488b32f454ffef3633451e6e6cafdc8844
BLAKE2b-256 checksum
How to use checksums
0b9cb209e0768bd075c16a8e72c25471f6c2f154b5ecf9674a79c1f6f70ead42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / darglint-0.0.4-py3-none-any.whl

Download URL darglint-0.0.4-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a71f114d77f84e51b7ad8d77b92302efd89644b930648c63b090946075b1d9d
BLAKE2b-256 checksum
How to use checksums
25767f9f6013fa3b4ce0a5075f483f45d164be360aadb228e58ee2df475cfc38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.0

1 release file

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

1 release file

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.1.1

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page