Skip to content
Snippets Groups Projects
Commit dfd3d775 authored by Amir Rachum's avatar Amir Rachum
Browse files

Merge branch 'master' into feature/nonexistent-code-warning

parents a051ee1c de24da69
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -12,6 +12,8 @@ New Features
 
* Public nested classes missing a docstring are now reported as D106 instead
of D101 (#198, #261).
* ``__init__`` methods missing a docstring are now reported as D107 instead of
D102 (#273, #277).
* Added support for Python 3.6 (#270).
* Specifying an invalid error code prefix (e.g., ``--select=D9``) will print
a warning message to ``stderr`` (#253, #279).
Loading
Loading
Loading
Loading
@@ -116,7 +116,8 @@ class ConventionChecker(object):
Class: violations.D101,
NestedClass: violations.D106,
Method: (lambda: violations.D105() if definition.is_magic
else violations.D102()),
else (violations.D107() if definition.is_init
else violations.D102())),
Function: violations.D103,
NestedFunction: violations.D103,
Package: violations.D104}
Loading
Loading
Loading
Loading
@@ -166,6 +166,11 @@ class Method(Function):
self.name.endswith('__') and
self.name not in VARIADIC_MAGIC_METHODS)
 
@property
def is_init(self):
"""Return True iff this method is `__init__`."""
return self.name == '__init__'
@property
def is_public(self):
"""Return True iff this method should be considered public."""
Loading
Loading
Loading
Loading
@@ -159,6 +159,7 @@ D103 = D1xx.create_error('D103', 'Missing docstring in public function')
D104 = D1xx.create_error('D104', 'Missing docstring in public package')
D105 = D1xx.create_error('D105', 'Missing docstring in magic method')
D106 = D1xx.create_error('D106', 'Missing docstring in public nested class')
D107 = D1xx.create_error('D107', 'Missing docstring in __init__')
 
D2xx = ErrorRegistry.create_group('D2', 'Whitespace Issues')
D200 = D2xx.create_error('D200', 'One-line docstring should fit on one line '
Loading
Loading
Loading
Loading
@@ -27,6 +27,10 @@ class class_:
pass
 
@expect('D102: Missing docstring in public method')
def __new__(self=None):
pass
@expect('D107: Missing docstring in __init__')
def __init__(self=None):
pass
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment