159 def styleCheck(self, lang, filename, source, args): |
159 def styleCheck(self, lang, filename, source, args): |
160 """ |
160 """ |
161 Public method to prepare a style check on one Python source file. |
161 Public method to prepare a style check on one Python source file. |
162 |
162 |
163 @param lang language of the file or None to determine by internal |
163 @param lang language of the file or None to determine by internal |
164 algorithm (str or None) |
164 algorithm |
165 @param filename source filename (string) |
165 @type str or None |
166 @param source string containing the code to check (string) |
166 @param filename source filename |
|
167 @type str |
|
168 @param source string containing the code to check |
|
169 @type str |
167 @param args arguments used by the codeStyleCheck function (list of |
170 @param args arguments used by the codeStyleCheck function (list of |
168 excludeMessages (str), includeMessages (str), repeatMessages |
171 excludeMessages, includeMessages, repeatMessages, fixCodes, |
169 (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), |
172 noFixCodes, fixIssues, maxLineLength, blankLines, hangClosing, |
170 maxLineLength (int), hangClosing (bool), docType (str), errors |
173 docType, codeComplexityArgs, miscellaneousArgs, errors, eol, |
171 (list of str), eol (str), encoding (str)) |
174 encoding, backup) |
|
175 @type list of (str, str, bool, str, str, bool, int, list of (int, int), |
|
176 bool, str, dict, dict, list of str, str, str, bool) |
172 """ |
177 """ |
173 if lang is None: |
178 if lang is None: |
174 lang = 'Python{0}'.format(determinePythonVersion(filename, source)) |
179 lang = 'Python{0}'.format(determinePythonVersion(filename, source)) |
175 if lang not in ['Python2', 'Python3']: |
180 if lang not in ['Python2', 'Python3']: |
176 return |
181 return |