././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1616115410.9758306 flake8-docstrings-1.6.0/0000755000175000017500000000000000000000000016540 5ustar00asottileasottile00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115366.0 flake8-docstrings-1.6.0/HISTORY.rst0000644000175000017500000000525600000000000020443 0ustar00asottileasottile00000000000000History/Changelog ================= 1.6.0 ----- - Fix ``--ignore-noqa`` by disabling ``pydocstyle``'s ``noqa`` handling. 1.5.0 ----- - Add ``--ignore-decorators`` option which allows functions with a specific decorator to ignore error codes. 1.4.0 ----- - Add ``--docstring-convention`` option which allows selection of conventions besides the default ``pep257``. Available options are based on those available from ``pydocstyle`` and are currently ``pep257``, ``google``, and ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring convention which will enable all rules from ``pydocstyle``. Note that ``pydocstyle`` defines some conflicting rules so you'll want to use ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` - Bump minimum flake8 version to 3 - Fix proper handling of ``stdin`` via ``--stdin-display-name`` 1.3.1 ----- - Fix incompatibility with pydocstyle 4.x 1.3.0 ----- - Bump minimum pydocstyle version to 2.1.0 1.2.0 ----- - Fix EnvironError and AllError invocations - Avoid Flake8 warning for requesting ``builtins`` 1.1.0 ----- - Upgrade dependency on pydocstyle to 2.0.0 1.0.3 ----- - Use flake8-polyfill to get standard-in to handle Flake8 3.x and 2.x 1.0.2 ----- - Use pycodestyle to get standard-in. 1.0.1 ----- - Make sure this works out of the box (is enabled by default) with Flake8 3.0 1.0.0 ----- - Switch dependency name to pydocstyle. pep257 was renamed to pydocstyle, this update switches the requirement to that new package name. Since we're swapping out dependencies, we've issued a major version bump. 0.2.7 ----- - Try to import pydocstyle (not pycodestyle) as pep257 0.2.6 ----- - Respect pep257's default ignore list - Handle AllError and other exceptions from pep257 0.2.5 ----- - Use pep257's ``tokenize_open`` function to pass input to the tool. - Use pep257's conventions so any error codes that are ignored by default using ``pep257`` are also ignored by default with this plugin. 0.2.4 ----- - Fix bug introduced in 0.2.2 where the file source was always None causing D100 and D104 errors for all files and no other errors to be found. 0.2.3 ----- - Remove extraneous space in error message. - Fix up how the plugin displays with ``flake8 --version``. 0.2.2 ----- - Better support for input provided via stdin. 0.2.1 ----- - Prevent AllError or EnvironmentErrors from being raised. Thanks Alex Pyrgiotis. 0.2.0 ----- - Upgrade to pep257 0.3.0 0.1.4 ----- - Stop truncating error messages 0.1.3 ----- - Really fix the installation issue this time. 0.1.2 ----- - Actually fix the PyPI release. **Ugh** 0.1.1 ----- - Fix the PyPI release. 0.1.0 ----- - Initial Release! ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616113669.0 flake8-docstrings-1.6.0/LICENSE0000644000175000017500000000205500000000000017547 0ustar00asottileasottile00000000000000Copyright (c) 2013 Simon Andre, Ian Cordasco Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616113669.0 flake8-docstrings-1.6.0/MANIFEST.in0000644000175000017500000000016600000000000020301 0ustar00asottileasottile00000000000000include HISTORY.rst include LICENSE include README.rst include flake8_docstrings.py include setup.cfg include tox.ini ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1616115410.9758306 flake8-docstrings-1.6.0/PKG-INFO0000644000175000017500000001356100000000000017643 0ustar00asottileasottile00000000000000Metadata-Version: 1.2 Name: flake8-docstrings Version: 1.6.0 Summary: Extension for flake8 which uses pydocstyle to check docstrings Home-page: https://gitlab.com/pycqa/flake8-docstrings Author: Simon ANDRÉ Author-email: sandre@anybox.fr Maintainer: Ian Cordasco Maintainer-email: graffatcolmingov@gmail.com License: MIT License Description: flake8-docstrings ================= A simple module that adds an extension for the fantastic pydocstyle_ tool to flake8_. Simply install this extension:: pip install flake8-docstrings and run flake8. You can set the pydocstyle convention_ at the command line using:: $ flake8 --docstring-convention numpy ... Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. The available set of conventions depends on the version of pydocstyle installed. The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc standard), while pydocstyle v4.0.0 added ``google``. In order to choose a custom list of error codes, use the special value ``docstring-convention=all``, then choose the codes you want checked using flake8_'s built-in ``--ignore``/``--select`` functionality. Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 .. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues History/Changelog ================= 1.6.0 ----- - Fix ``--ignore-noqa`` by disabling ``pydocstyle``'s ``noqa`` handling. 1.5.0 ----- - Add ``--ignore-decorators`` option which allows functions with a specific decorator to ignore error codes. 1.4.0 ----- - Add ``--docstring-convention`` option which allows selection of conventions besides the default ``pep257``. Available options are based on those available from ``pydocstyle`` and are currently ``pep257``, ``google``, and ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring convention which will enable all rules from ``pydocstyle``. Note that ``pydocstyle`` defines some conflicting rules so you'll want to use ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` - Bump minimum flake8 version to 3 - Fix proper handling of ``stdin`` via ``--stdin-display-name`` 1.3.1 ----- - Fix incompatibility with pydocstyle 4.x 1.3.0 ----- - Bump minimum pydocstyle version to 2.1.0 1.2.0 ----- - Fix EnvironError and AllError invocations - Avoid Flake8 warning for requesting ``builtins`` 1.1.0 ----- - Upgrade dependency on pydocstyle to 2.0.0 1.0.3 ----- - Use flake8-polyfill to get standard-in to handle Flake8 3.x and 2.x 1.0.2 ----- - Use pycodestyle to get standard-in. 1.0.1 ----- - Make sure this works out of the box (is enabled by default) with Flake8 3.0 1.0.0 ----- - Switch dependency name to pydocstyle. pep257 was renamed to pydocstyle, this update switches the requirement to that new package name. Since we're swapping out dependencies, we've issued a major version bump. 0.2.7 ----- - Try to import pydocstyle (not pycodestyle) as pep257 0.2.6 ----- - Respect pep257's default ignore list - Handle AllError and other exceptions from pep257 0.2.5 ----- - Use pep257's ``tokenize_open`` function to pass input to the tool. - Use pep257's conventions so any error codes that are ignored by default using ``pep257`` are also ignored by default with this plugin. 0.2.4 ----- - Fix bug introduced in 0.2.2 where the file source was always None causing D100 and D104 errors for all files and no other errors to be found. 0.2.3 ----- - Remove extraneous space in error message. - Fix up how the plugin displays with ``flake8 --version``. 0.2.2 ----- - Better support for input provided via stdin. 0.2.1 ----- - Prevent AllError or EnvironmentErrors from being raised. Thanks Alex Pyrgiotis. 0.2.0 ----- - Upgrade to pep257 0.3.0 0.1.4 ----- - Stop truncating error messages 0.1.3 ----- - Really fix the installation issue this time. 0.1.2 ----- - Actually fix the PyPI release. **Ugh** 0.1.1 ----- - Fix the PyPI release. 0.1.0 ----- - Initial Release! Keywords: PEP 257,pydocstyle,pep257,docstrings,flake8 Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Environment :: Console Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License Provides: flake8_docstrings ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616113669.0 flake8-docstrings-1.6.0/README.rst0000644000175000017500000000213400000000000020227 0ustar00asottileasottile00000000000000flake8-docstrings ================= A simple module that adds an extension for the fantastic pydocstyle_ tool to flake8_. Simply install this extension:: pip install flake8-docstrings and run flake8. You can set the pydocstyle convention_ at the command line using:: $ flake8 --docstring-convention numpy ... Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. The available set of conventions depends on the version of pydocstyle installed. The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc standard), while pydocstyle v4.0.0 added ``google``. In order to choose a custom list of error codes, use the special value ``docstring-convention=all``, then choose the codes you want checked using flake8_'s built-in ``--ignore``/``--select`` functionality. Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 .. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1616115410.9758306 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/0000755000175000017500000000000000000000000023643 5ustar00asottileasottile00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/PKG-INFO0000644000175000017500000001356100000000000024746 0ustar00asottileasottile00000000000000Metadata-Version: 1.2 Name: flake8-docstrings Version: 1.6.0 Summary: Extension for flake8 which uses pydocstyle to check docstrings Home-page: https://gitlab.com/pycqa/flake8-docstrings Author: Simon ANDRÉ Author-email: sandre@anybox.fr Maintainer: Ian Cordasco Maintainer-email: graffatcolmingov@gmail.com License: MIT License Description: flake8-docstrings ================= A simple module that adds an extension for the fantastic pydocstyle_ tool to flake8_. Simply install this extension:: pip install flake8-docstrings and run flake8. You can set the pydocstyle convention_ at the command line using:: $ flake8 --docstring-convention numpy ... Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. The available set of conventions depends on the version of pydocstyle installed. The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc standard), while pydocstyle v4.0.0 added ``google``. In order to choose a custom list of error codes, use the special value ``docstring-convention=all``, then choose the codes you want checked using flake8_'s built-in ``--ignore``/``--select`` functionality. Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 .. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues History/Changelog ================= 1.6.0 ----- - Fix ``--ignore-noqa`` by disabling ``pydocstyle``'s ``noqa`` handling. 1.5.0 ----- - Add ``--ignore-decorators`` option which allows functions with a specific decorator to ignore error codes. 1.4.0 ----- - Add ``--docstring-convention`` option which allows selection of conventions besides the default ``pep257``. Available options are based on those available from ``pydocstyle`` and are currently ``pep257``, ``google``, and ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring convention which will enable all rules from ``pydocstyle``. Note that ``pydocstyle`` defines some conflicting rules so you'll want to use ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` - Bump minimum flake8 version to 3 - Fix proper handling of ``stdin`` via ``--stdin-display-name`` 1.3.1 ----- - Fix incompatibility with pydocstyle 4.x 1.3.0 ----- - Bump minimum pydocstyle version to 2.1.0 1.2.0 ----- - Fix EnvironError and AllError invocations - Avoid Flake8 warning for requesting ``builtins`` 1.1.0 ----- - Upgrade dependency on pydocstyle to 2.0.0 1.0.3 ----- - Use flake8-polyfill to get standard-in to handle Flake8 3.x and 2.x 1.0.2 ----- - Use pycodestyle to get standard-in. 1.0.1 ----- - Make sure this works out of the box (is enabled by default) with Flake8 3.0 1.0.0 ----- - Switch dependency name to pydocstyle. pep257 was renamed to pydocstyle, this update switches the requirement to that new package name. Since we're swapping out dependencies, we've issued a major version bump. 0.2.7 ----- - Try to import pydocstyle (not pycodestyle) as pep257 0.2.6 ----- - Respect pep257's default ignore list - Handle AllError and other exceptions from pep257 0.2.5 ----- - Use pep257's ``tokenize_open`` function to pass input to the tool. - Use pep257's conventions so any error codes that are ignored by default using ``pep257`` are also ignored by default with this plugin. 0.2.4 ----- - Fix bug introduced in 0.2.2 where the file source was always None causing D100 and D104 errors for all files and no other errors to be found. 0.2.3 ----- - Remove extraneous space in error message. - Fix up how the plugin displays with ``flake8 --version``. 0.2.2 ----- - Better support for input provided via stdin. 0.2.1 ----- - Prevent AllError or EnvironmentErrors from being raised. Thanks Alex Pyrgiotis. 0.2.0 ----- - Upgrade to pep257 0.3.0 0.1.4 ----- - Stop truncating error messages 0.1.3 ----- - Really fix the installation issue this time. 0.1.2 ----- - Actually fix the PyPI release. **Ugh** 0.1.1 ----- - Fix the PyPI release. 0.1.0 ----- - Initial Release! Keywords: PEP 257,pydocstyle,pep257,docstrings,flake8 Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Environment :: Console Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License Provides: flake8_docstrings ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/SOURCES.txt0000644000175000017500000000052200000000000025526 0ustar00asottileasottile00000000000000HISTORY.rst LICENSE MANIFEST.in README.rst flake8_docstrings.py setup.cfg setup.py tox.ini flake8_docstrings.egg-info/PKG-INFO flake8_docstrings.egg-info/SOURCES.txt flake8_docstrings.egg-info/dependency_links.txt flake8_docstrings.egg-info/entry_points.txt flake8_docstrings.egg-info/requires.txt flake8_docstrings.egg-info/top_level.txt././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/dependency_links.txt0000644000175000017500000000000100000000000027711 0ustar00asottileasottile00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/entry_points.txt0000644000175000017500000000007000000000000027136 0ustar00asottileasottile00000000000000[flake8.extension] D = flake8_docstrings:pep257Checker ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/requires.txt0000644000175000017500000000003200000000000026236 0ustar00asottileasottile00000000000000flake8>=3 pydocstyle>=2.1 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616115410.0 flake8-docstrings-1.6.0/flake8_docstrings.egg-info/top_level.txt0000644000175000017500000000002200000000000026367 0ustar00asottileasottile00000000000000flake8_docstrings ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616114960.0 flake8-docstrings-1.6.0/flake8_docstrings.py0000644000175000017500000001063400000000000022527 0ustar00asottileasottile00000000000000# -*- coding: utf-8 -*- """Implementation of pydocstyle integration with Flake8. pydocstyle docstrings convention needs error code and class parser for be included as module into flake8 """ import re import sys try: import pydocstyle as pep257 module_name = 'pydocstyle' except ImportError: import pep257 module_name = 'pep257' if sys.version_info >= (3, 2): from tokenize import open as tokenize_open else: tokenize_open = open __version__ = '1.6.0' __all__ = ('pep257Checker',) class _ContainsAll(object): def __contains__(self, code): # type: (str) -> bool return True class EnvironError(pep257.Error): def __init__(self, err): super(EnvironError, self).__init__( code='D998', short_desc='EnvironmentError: ' + str(err), context=None, ) @property def line(self): """Return 0 as line number for EnvironmentError.""" return 0 class AllError(pep257.Error): def __init__(self, err): super(AllError, self).__init__( code='D999', short_desc=str(err).partition('\n')[0], context=None, ) @property def line(self): """pep257.AllError does not contain line number. Return 0 instead.""" return 0 class pep257Checker(object): """Flake8 needs a class to check python file.""" name = 'flake8-docstrings' version = '{}, {}: {}'.format(__version__, module_name, pep257.__version__) def __init__(self, tree, filename, lines): """Initialize the checker.""" self.tree = tree self.filename = filename self.checker = pep257.ConventionChecker() self.source = ''.join(lines) @classmethod def add_options(cls, parser): """Add plugin configuration option to flake8.""" parser.add_option( '--docstring-convention', action='store', parse_from_config=True, default="pep257", choices=sorted(pep257.conventions) + ['all'], help=( "pydocstyle docstring convention, default 'pep257'. " "Use the special value 'all' to enable all codes (note: " "some codes are conflicting so you'll need to then exclude " "those)." ) ) parser.add_option( "--ignore-decorators", action="store", parse_from_config=True, default=None, help=( "pydocstyle ignore-decorators regular expression, " "default None. " "Ignore any functions or methods that are decorated by " "a function with a name fitting this regular expression. " "The default is not ignore any decorated functions. " ), ) @classmethod def parse_options(cls, options): """Parse the configuration options given to flake8.""" cls.convention = options.docstring_convention cls.ignore_decorators = ( re.compile(options.ignore_decorators) if options.ignore_decorators else None ) def _call_check_source(self): try: return self.checker.check_source( self.source, self.filename, ignore_decorators=self.ignore_decorators, ignore_inline_noqa=True, ) except TypeError: # for versions of pydocstyle 5.1.1 and below return self.checker.check_source( self.source, self.filename, ignore_decorators=self.ignore_decorators, ) def _check_source(self): try: for err in self._call_check_source(): yield err except pep257.AllError as err: yield AllError(err) except EnvironmentError as err: yield EnvironError(err) def run(self): """Use directly check() api from pydocstyle.""" if self.convention == 'all': checked_codes = _ContainsAll() else: checked_codes = ( pep257.conventions[self.convention] | {'D998', 'D999'} ) for error in self._check_source(): if isinstance(error, pep257.Error) and error.code in checked_codes: # NOTE(sigmavirus24): Fixes GitLab#3 message = '%s %s' % (error.code, error.short_desc) yield (error.line, 0, message, type(self)) ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1616115410.9758306 flake8-docstrings-1.6.0/setup.cfg0000644000175000017500000000007500000000000020363 0ustar00asottileasottile00000000000000[wheel] universal = 1 [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616113669.0 flake8-docstrings-1.6.0/setup.py0000644000175000017500000000306600000000000020257 0ustar00asottileasottile00000000000000# -*- coding: utf-8 -*- """``flake8-docstring`` lives on `GitLab `_. """ from setuptools import setup def get_version(fname="flake8_docstrings.py"): with open(fname) as f: for line in f: if line.startswith('__version__'): return eval(line.split('=')[-1]) def get_long_description(): descr = [] for fname in ('README.rst', 'HISTORY.rst'): with open(fname) as f: descr.append(f.read()) return '\n\n'.join(descr) setup( name='flake8-docstrings', version=get_version(), description="Extension for flake8 which uses pydocstyle to check docstrings", long_description=get_long_description(), license='MIT License', author='Simon ANDRÉ', author_email='sandre@anybox.fr', maintainer='Ian Cordasco', maintainer_email='graffatcolmingov@gmail.com', url='https://gitlab.com/pycqa/flake8-docstrings', classifiers=['Intended Audience :: Developers', 'Environment :: Console', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Operating System :: OS Independent', 'License :: OSI Approved :: MIT License'], keywords='PEP 257, pydocstyle, pep257, docstrings, flake8', entry_points={ 'flake8.extension': [ 'D = flake8_docstrings:pep257Checker', ], }, install_requires=['flake8 >= 3', 'pydocstyle >= 2.1'], provides=['flake8_docstrings'], py_modules=['flake8_docstrings'], ) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1616114152.0 flake8-docstrings-1.6.0/tox.ini0000644000175000017500000000062400000000000020055 0ustar00asottileasottile00000000000000[tox] minversion = 1.6 envlist = py27,py35,py36,py37,py38,pypy,pypy3 [testenv] deps = flake8 commands = flake8 {posargs} flake8_docstrings.py [testenv:release] basepython = python2.7 deps = twine >= 1.5.0 wheel commands = python setup.py sdist bdist_wheel twine upload --skip-existing {posargs} dist/* [flake8] ignore = D203 max_line_length = 79 exclude = .git,.tox,dist,docs,*egg