1381 elif functionName.startswith('__') and \ |
1381 elif functionName.startswith('__') and \ |
1382 functionName.endswith('__'): |
1382 functionName.endswith('__'): |
1383 if firstWord != 'special': |
1383 if firstWord != 'special': |
1384 self.__error(docstringContext.start() + lineNumber, 0, |
1384 self.__error(docstringContext.start() + lineNumber, 0, |
1385 "D232", 'special') |
1385 "D232", 'special') |
|
1386 elif context.special() == "staticmethod": |
|
1387 if firstWord != 'static': |
|
1388 self.__error(docstringContext.start() + lineNumber, 0, |
|
1389 "D232", 'static') |
|
1390 elif arguments.startswith(('cls,', 'cls)')) or \ |
|
1391 context.special() == "classmethod": |
|
1392 secondWord = summary.strip().split(None, 2)[1].lower() |
|
1393 if firstWord != 'class' and secondWord != 'class': |
|
1394 self.__error(docstringContext.start() + lineNumber, 0, |
|
1395 "D232", 'class') |
|
1396 elif secondWord == 'class': |
|
1397 if functionName.startswith(('__', 'on_')): |
|
1398 if firstWord != 'private': |
|
1399 self.__error(docstringContext.start() + lineNumber, |
|
1400 0, "D232", 'private class') |
|
1401 elif functionName.startswith('_') or \ |
|
1402 functionName.endswith('Event'): |
|
1403 if firstWord != 'protected': |
|
1404 self.__error(docstringContext.start() + lineNumber, |
|
1405 0, "D232", 'protected class') |
|
1406 else: |
|
1407 if firstWord != 'public': |
|
1408 self.__error(docstringContext.start() + lineNumber, |
|
1409 0, "D232", 'public class') |
1386 elif functionName.startswith(('__', 'on_')): |
1410 elif functionName.startswith(('__', 'on_')): |
1387 if firstWord != 'private': |
1411 if firstWord != 'private': |
1388 self.__error(docstringContext.start() + lineNumber, 0, |
1412 self.__error(docstringContext.start() + lineNumber, 0, |
1389 "D232", 'private') |
1413 "D232", 'private') |
1390 elif functionName.startswith('_') or \ |
1414 elif functionName.startswith('_') or \ |
1391 functionName.endswith('Event'): |
1415 functionName.endswith('Event'): |
1392 if firstWord != 'protected': |
1416 if firstWord != 'protected': |
1393 self.__error(docstringContext.start() + lineNumber, 0, |
1417 self.__error(docstringContext.start() + lineNumber, 0, |
1394 "D232", 'protected') |
1418 "D232", 'protected') |
1395 elif arguments.startswith(('cls,', 'cls)')) or \ |
|
1396 context.special() == "classmethod": |
|
1397 if firstWord != 'class': |
|
1398 self.__error(docstringContext.start() + lineNumber, 0, |
|
1399 "D232", 'class') |
|
1400 elif context.special() == "staticmethod": |
|
1401 if firstWord != 'static': |
|
1402 self.__error(docstringContext.start() + lineNumber, 0, |
|
1403 "D232", 'static') |
|
1404 else: |
1419 else: |
1405 if firstWord != 'public': |
1420 if firstWord != 'public': |
1406 self.__error(docstringContext.start() + lineNumber, 0, |
1421 self.__error(docstringContext.start() + lineNumber, 0, |
1407 "D232", 'public') |
1422 "D232", 'public') |
1408 |
1423 |