eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py

changeset 7247
bf9379f964f3
parent 7246
c32a350d2414
child 7256
4ef3b78ebb4e
equal deleted inserted replaced
7246:c32a350d2414 7247:bf9379f964f3
252 @param source string containing the code to check 252 @param source string containing the code to check
253 @type str 253 @type str
254 @param args arguments used by the codeStyleCheck function (list of 254 @param args arguments used by the codeStyleCheck function (list of
255 excludeMessages, includeMessages, repeatMessages, fixCodes, 255 excludeMessages, includeMessages, repeatMessages, fixCodes,
256 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines, 256 noFixCodes, fixIssues, maxLineLength, maxDocLineLength, blankLines,
257 hangClosing, docType, codeComplexityArgs, miscellaneousArgs, errors, 257 hangClosing, docType, codeComplexityArgs, miscellaneousArgs,
258 eol, encoding, backup) 258 annotationArgs, errors, eol, encoding, backup)
259 @type list of (str, str, bool, str, str, bool, int, list of (int, int), 259 @type list of (str, str, bool, str, str, bool, int, list of (int, int),
260 bool, str, dict, dict, list of str, str, str, bool) 260 bool, str, dict, dict, list of str, str, str, bool)
261 @return tuple of statistics (dict) and list of results (tuple for each 261 @return tuple of statistics (dict) and list of results (tuple for each
262 found violation of style (lineno, position, text, ignored, fixed, 262 found violation of style (lineno, position, text, ignored, fixed,
263 autofixing, fixedMsg)) 263 autofixing, fixedMsg))
264 @rtype tuple of (dict, list of tuples of (int, int, str, bool, bool, bool, 264 @rtype tuple of (dict, list of tuples of (int, int, str, bool, bool, bool,
265 str)) 265 str))
266 """ 266 """
267 (excludeMessages, includeMessages, repeatMessages, fixCodes, noFixCodes, 267 (excludeMessages, includeMessages, repeatMessages, fixCodes, noFixCodes,
268 fixIssues, maxLineLength, maxDocLineLength, blankLines, hangClosing, 268 fixIssues, maxLineLength, maxDocLineLength, blankLines, hangClosing,
269 docType, codeComplexityArgs, miscellaneousArgs, errors, eol, encoding, 269 docType, codeComplexityArgs, miscellaneousArgs, annotationArgs, errors,
270 backup) = args 270 eol, encoding, backup) = args
271 271
272 stats = {} 272 stats = {}
273 273
274 if fixIssues: 274 if fixIssues:
275 from CodeStyleFixer import CodeStyleFixer 275 from CodeStyleFixer import CodeStyleFixer
346 # check function annotations 346 # check function annotations
347 if sys.version_info >= (3, 5, 0): 347 if sys.version_info >= (3, 5, 0):
348 # annotations are supported from Python 3.5 on 348 # annotations are supported from Python 3.5 on
349 from AnnotationsChecker import AnnotationsChecker 349 from AnnotationsChecker import AnnotationsChecker
350 annotationsChecker = AnnotationsChecker( 350 annotationsChecker = AnnotationsChecker(
351 source, filename, select, ignore, [], repeatMessages) 351 source, filename, select, ignore, [], repeatMessages,
352 annotationArgs)
352 annotationsChecker.run() 353 annotationsChecker.run()
353 stats.update(annotationsChecker.counters) 354 stats.update(annotationsChecker.counters)
354 errors += annotationsChecker.errors 355 errors += annotationsChecker.errors
355 356
356 errorsDict = {} 357 errorsDict = {}

eric ide

mercurial