18 from CodeStyleFixer import CodeStyleFixer |
18 from CodeStyleFixer import CodeStyleFixer |
19 from Complexity.ComplexityChecker import ComplexityChecker |
19 from Complexity.ComplexityChecker import ComplexityChecker |
20 from DocStyle.DocStyleChecker import DocStyleChecker |
20 from DocStyle.DocStyleChecker import DocStyleChecker |
21 from Imports.ImportsChecker import ImportsChecker |
21 from Imports.ImportsChecker import ImportsChecker |
22 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker |
22 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker |
|
23 from NameOrder.NameOrderChecker import NameOrderChecker |
23 from Naming.NamingStyleChecker import NamingStyleChecker |
24 from Naming.NamingStyleChecker import NamingStyleChecker |
24 from PathLib.PathlibChecker import PathlibChecker |
25 from PathLib.PathlibChecker import PathlibChecker |
25 from Security.SecurityChecker import SecurityChecker |
26 from Security.SecurityChecker import SecurityChecker |
26 from Simplify.SimplifyChecker import SimplifyChecker |
27 from Simplify.SimplifyChecker import SimplifyChecker |
27 |
28 |
189 @type str |
190 @type str |
190 @param args arguments used by the codeStyleCheck function (list of |
191 @param args arguments used by the codeStyleCheck function (list of |
191 excludeMessages, includeMessages, repeatMessages, fixCodes, |
192 excludeMessages, includeMessages, repeatMessages, fixCodes, |
192 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines, |
193 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines, |
193 hangClosing, docType, codeComplexityArgs, miscellaneousArgs, |
194 hangClosing, docType, codeComplexityArgs, miscellaneousArgs, |
194 annotationArgs, securityArgs, importsArgs, errors, eol, encoding, |
195 annotationArgs, securityArgs, importsArgs, nameOrderArgs, errors, eol, encoding, |
195 backup) |
196 backup) |
196 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
197 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
197 bool, str, dict, dict, dict, dict, list of str, str, str, bool) |
198 bool, str, dict, dict, dict, dict, dict, list of str, str, str, bool) |
198 @return tuple of statistics (dict) and list of results (tuple for each |
199 @return tuple of statistics (dict) and list of results (tuple for each |
199 found violation of style (lineno, position, text, ignored, fixed, |
200 found violation of style (lineno, position, text, ignored, fixed, |
200 autofixing, fixedMsg)) |
201 autofixing, fixedMsg)) |
201 @rtype tuple of (dict, list of tuples of (int, int, str, bool, bool, bool, |
202 @rtype tuple of (dict, list of tuples of (int, int, str, bool, bool, bool, |
202 str)) |
203 str)) |
353 @type str |
354 @type str |
354 @param args arguments used by the codeStyleCheck function (list of |
355 @param args arguments used by the codeStyleCheck function (list of |
355 excludeMessages, includeMessages, repeatMessages, fixCodes, |
356 excludeMessages, includeMessages, repeatMessages, fixCodes, |
356 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines, |
357 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines, |
357 hangClosing, docType, codeComplexityArgs, miscellaneousArgs, |
358 hangClosing, docType, codeComplexityArgs, miscellaneousArgs, |
358 annotationArgs, securityArgs, importsArgs, errors, eol, encoding, |
359 annotationArgs, securityArgs, importsArgs, nameOrderArgs, errors, eol, encoding, |
359 backup) |
360 backup) |
360 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
361 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
361 bool, str, dict, dict, dict, dict, list of str, str, str, bool) |
362 bool, str, dict, dict, dict, dict, dict, list of str, str, str, bool) |
362 @return tuple of statistics data and list of result dictionaries with |
363 @return tuple of statistics data and list of result dictionaries with |
363 keys: |
364 keys: |
364 <ul> |
365 <ul> |
365 <li>file: file name</li> |
366 <li>file: file name</li> |
366 <li>line: line_number</li> |
367 <li>line: line_number</li> |
539 source, filename, tree, select, ignore, [], repeatMessages, importsArgs |
541 source, filename, tree, select, ignore, [], repeatMessages, importsArgs |
540 ) |
542 ) |
541 importsChecker.run() |
543 importsChecker.run() |
542 stats.update(importsChecker.counters) |
544 stats.update(importsChecker.counters) |
543 errors += importsChecker.errors |
545 errors += importsChecker.errors |
|
546 |
|
547 # check name ordering |
|
548 nameOrderChecker = NameOrderChecker( |
|
549 source, |
|
550 filename, |
|
551 tree, |
|
552 select, |
|
553 ignore, |
|
554 [], |
|
555 repeatMessages, |
|
556 nameOrderArgs, |
|
557 ) |
|
558 nameOrderChecker.run() |
|
559 stats.update(nameOrderChecker.counters) |
|
560 errors += nameOrderChecker.errors |
544 |
561 |
545 elif syntaxError: |
562 elif syntaxError: |
546 errors = [syntaxError] |
563 errors = [syntaxError] |
547 stats.update(syntaxStats) |
564 stats.update(syntaxStats) |
548 |
565 |