Using Docsweeper As A Flake8 Plugin#
Upon installation, Docsweeper will register itself automatically as a plugin for Flake8 if it is installed. See configuration instructions for instructions on how to configure the plugin.
Error/Violation Codes#
Docsweeper employs the following Flake8 error codes:
DOC100 Potentially Outdated Docstring#
The code of this token has changed more times than allowed since the docstring that references it has been updated.
The amount of allowed code changes until this violation triggers is determined by the
--max_changes command line option or max_changes
option in the Flake8 configuration file.
Configuration Of Docsweeper As A Flake8 Plugin#
The Flake8 plugin can be configured via a configuration section in the Flake8
configuration file
or by passing specific command line options to the flake8 command.
Important
The Flake8 plugin is disabled by default. Add docsweeper to your
enabled extensions in your Flake8 configuration to use it:
[flake8]
enable-extensions=docsweeper
Plugin Configuration In The Flake8 Configuration File#
The following options are respected by Docsweeper if set by the user:
max_changesintegerAmount of code changes that are allowed since the last docstring update before code violation DOC100 triggers.
Default value:
0no_follow_renametrue|falseFollow version control history along renames of files.
Default value:
falsevcsstringVersion control system that is used. Currently supported values are
gitandhg.Default value:
gitvcs_executablestringLocation of the version control system executable.
Default value: see the output of
docsweeper -h
Plugin Configuration With Command Line Options#
The following command line options are available:
- --max-changes MAX_CHANGES
Code violation DOC100 triggers when more than
MAX_CHANGESchanges to the source code have been made since the last docstring change.- --no-follow-rename
Follow version control history along renames of files.
- --vcs VCS_TYPE
VCS_TYPEis the type of version control system used.Allowed values:
git|hg- --vcs-executable VCS_EXECUTABLE
The version control system located at
VCS_EXECUTABLEwill be used.