From 13159ede09bc67c939493b150a8e3ecfa525b6fc Mon Sep 17 00:00:00 2001 From: Shachar Ohana Date: Sat, 14 Jan 2017 09:25:41 +0200 Subject: [PATCH] #129 - Added docs and renamed a class --- docs/release_notes.rst | 1 + src/pydocstyle/__init__.py | 2 +- src/pydocstyle/checker.py | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/release_notes.rst b/docs/release_notes.rst index 46ffe469..32a531f2 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -20,6 +20,7 @@ New Features * Decorator-based skipping via ``--ignore-decorators`` has been added (#204). * Support for using pycodestyle style wildcards has been added (#72, #209). * Superfluous opening quotes are now reported as part of D300 (#166, #225). +* Support for ``numpy`` conventions verification has been added (#129). Bug Fixes diff --git a/src/pydocstyle/__init__.py b/src/pydocstyle/__init__.py index 8ebe44ea..38232044 100644 --- a/src/pydocstyle/__init__.py +++ b/src/pydocstyle/__init__.py @@ -3,5 +3,5 @@ from .utils import __version__ # Temporary hotfix for flake8-docstrings -from .checker import PEP257Checker, tokenize_open +from .checker import ConventionChecker, tokenize_open from .parser import AllError diff --git a/src/pydocstyle/checker.py b/src/pydocstyle/checker.py index 0d057e54..c94a1cf3 100644 --- a/src/pydocstyle/checker.py +++ b/src/pydocstyle/checker.py @@ -34,8 +34,8 @@ def decorator(f): return decorator -class PEP257Checker(object): - """Checker for PEP 257. +class ConventionChecker(object): + """Checker for PEP 257 and numpy conventions. D10x: Missing docstrings D20x: Whitespace issues @@ -642,8 +642,8 @@ def check(filenames, select=None, ignore=None, ignore_decorators=None): try: with tokenize_open(filename) as file: source = file.read() - for error in PEP257Checker().check_source(source, filename, - ignore_decorators): + for error in ConventionChecker().check_source(source, filename, + ignore_decorators): code = getattr(error, 'code', None) if code in checked_codes: yield error