src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
13 import queue 13 import queue
14 import sys 14 import sys
15 15
16 import pycodestyle 16 import pycodestyle
17 17
18 from CodeStyleFixer import CodeStyleFixer
18 from Complexity.ComplexityChecker import ComplexityChecker 19 from Complexity.ComplexityChecker import ComplexityChecker
19 from DocStyle.DocStyleChecker import DocStyleChecker 20 from DocStyle.DocStyleChecker import DocStyleChecker
20 from Imports.ImportsChecker import ImportsChecker 21 from Imports.ImportsChecker import ImportsChecker
21 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker 22 from Miscellaneous.MiscellaneousChecker import MiscellaneousChecker
22 from Naming.NamingStyleChecker import NamingStyleChecker 23 from Naming.NamingStyleChecker import NamingStyleChecker
388 backup, 389 backup,
389 ) = args 390 ) = args
390 391
391 stats = {} 392 stats = {}
392 393
393 if fixIssues: 394 fixer = (
394 from CodeStyleFixer import CodeStyleFixer 395 CodeStyleFixer(
395
396 fixer = CodeStyleFixer(
397 filename, 396 filename,
398 source, 397 source,
399 fixCodes, 398 fixCodes,
400 noFixCodes, 399 noFixCodes,
401 maxLineLength, 400 maxLineLength,
402 blankLines, 401 blankLines,
403 True, 402 True,
404 eol, 403 eol,
405 backup, 404 backup,
406 ) 405 )
407 # always fix in place 406 if fixIssues
408 else: 407 else None
409 fixer = None 408 )
410 409
411 if not errors: 410 if not errors:
412 if includeMessages: 411 if includeMessages:
413 select = [s.strip() for s in includeMessages.split(",") if s.strip()] 412 select = [s.strip() for s in includeMessages.split(",") if s.strip()]
414 else: 413 else:
482 481
483 # check function annotations 482 # check function annotations
484 if sys.version_info >= (3, 8, 0): 483 if sys.version_info >= (3, 8, 0):
485 # annotations with type comments are supported from 484 # annotations with type comments are supported from
486 # Python 3.8 on 485 # Python 3.8 on
487 from Annotations.AnnotationsChecker import AnnotationsChecker 486 from Annotations.AnnotationsChecker import ( # __IGNORE_WARNING_I10__
487 AnnotationsChecker,
488 )
488 489
489 annotationsChecker = AnnotationsChecker( 490 annotationsChecker = AnnotationsChecker(
490 source, 491 source,
491 filename, 492 filename,
492 tree, 493 tree,

eric ide

mercurial