@@ -143,7 +143,6 @@ def __str__(self):
143143
144144
145145class Package (Module ):
146-
147146 """A package is a __init__.py module."""
148147
149148
@@ -190,7 +189,6 @@ class NestedClass(Class):
190189
191190
192191class Decorator (Value ):
193-
194192 """A decorator for function, method or class."""
195193
196194 _fields = 'name arguments' .split ()
@@ -252,7 +250,6 @@ def __call__(self, filelike, filename):
252250 self .stream = TokenStream (StringIO (src ))
253251 self .filename = filename
254252 self .all = None
255- # TODO: what about Python 3.x?
256253 self .future_imports = defaultdict (lambda : False )
257254 self ._accumulated_decorators = []
258255 return self .parse_module ()
@@ -506,7 +503,6 @@ def parse_from_import_statement(self):
506503
507504
508505class Error (object ):
509-
510506 """Error in docstring style."""
511507
512508 # should be overridden by inheriting classes
@@ -655,6 +651,8 @@ def to_rst(cls):
655651 'be on a separate line' )
656652D210 = D2xx .create_error ('D210' , 'No whitespaces allowed surrounding '
657653 'docstring text' )
654+ D211 = D2xx .create_error ('D211' , 'No blank lines allowed before class '
655+ 'docstring' , 'found %s' )
658656
659657D3xx = ErrorRegistry .create_group ('D3' , 'Quotes Issues' )
660658D300 = D3xx .create_error ('D300' , 'Use """triple double quotes"""' ,
@@ -677,7 +675,7 @@ def __getattr__(self, item):
677675
678676
679677conventions = AttrDict ({
680- 'pep257' : set (ErrorRegistry .get_error_codes ()),
678+ 'pep257' : set (ErrorRegistry .get_error_codes ()) - set ([ 'D203' ]) ,
681679})
682680
683681
@@ -934,7 +932,6 @@ def decorator(f):
934932
935933
936934class PEP257Checker (object ):
937-
938935 """Checker for PEP 257.
939936
940937 D10x: Missing docstrings
@@ -1053,6 +1050,8 @@ def check_blank_before_after_class(slef, class_, docstring):
10531050 blanks_after = list (map (is_blank , after .split ('\n ' )[1 :]))
10541051 blanks_before_count = sum (takewhile (bool , reversed (blanks_before )))
10551052 blanks_after_count = sum (takewhile (bool , blanks_after ))
1053+ if blanks_before_count != 0 :
1054+ yield D211 (blanks_before_count )
10561055 if blanks_before_count != 1 :
10571056 yield D203 (blanks_before_count )
10581057 if not all (blanks_after ) and blanks_after_count != 1 :
0 commit comments