eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py

changeset 8186
655b658aa7ee
parent 8166
bd5cd5858503
child 8194
b925628bf91f
equal deleted inserted replaced
8185:c9acf46b54ce 8186:655b658aa7ee
21 from DocStyle.DocStyleChecker import DocStyleChecker 21 from DocStyle.DocStyleChecker import DocStyleChecker
22 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker 22 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker
23 from Complexity.ComplexityChecker import ComplexityChecker 23 from Complexity.ComplexityChecker import ComplexityChecker
24 from Security.SecurityChecker import SecurityChecker 24 from Security.SecurityChecker import SecurityChecker
25 from PathLib.PathlibChecker import PathlibChecker 25 from PathLib.PathlibChecker import PathlibChecker
26 from Simplify.SimplifyChecker import SimplifyChecker
26 27
27 28
28 def initService(): 29 def initService():
29 """ 30 """
30 Initialize the service and return the entry point. 31 Initialize the service and return the entry point.
425 annotationArgs) 426 annotationArgs)
426 annotationsChecker.run() 427 annotationsChecker.run()
427 stats.update(annotationsChecker.counters) 428 stats.update(annotationsChecker.counters)
428 errors += annotationsChecker.errors 429 errors += annotationsChecker.errors
429 430
431 # check for security issues
430 securityChecker = SecurityChecker( 432 securityChecker = SecurityChecker(
431 source, filename, select, ignore, [], repeatMessages, 433 source, filename, select, ignore, [], repeatMessages,
432 securityArgs) 434 securityArgs)
433 securityChecker.run() 435 securityChecker.run()
434 stats.update(securityChecker.counters) 436 stats.update(securityChecker.counters)
435 errors += securityChecker.errors 437 errors += securityChecker.errors
436 438
439 # check for pathlib usage
437 pathlibChecker = PathlibChecker( 440 pathlibChecker = PathlibChecker(
438 source, filename, select, ignore, [], repeatMessages) 441 source, filename, select, ignore, [], repeatMessages)
439 pathlibChecker.run() 442 pathlibChecker.run()
440 stats.update(pathlibChecker.counters) 443 stats.update(pathlibChecker.counters)
441 errors += pathlibChecker.errors 444 errors += pathlibChecker.errors
445
446 # check for code simplifications
447 simplifyChecker =SimplifyChecker(
448 source, filename, select, ignore, [], repeatMessages)
449 simplifyChecker.run()
450 stats.update(simplifyChecker.counters)
451 errors += simplifyChecker.errors
442 452
443 errorsDict = {} 453 errorsDict = {}
444 for error in errors: 454 for error in errors:
445 if error["line"] > len(source): 455 if error["line"] > len(source):
446 error["line"] = len(source) 456 error["line"] = len(source)

eric ide

mercurial