src/eric7/Plugins/PluginCodeStyleChecker.py

branch
eric7
changeset 10836
dc7f25f2f7e4
parent 10738
37101524dd76
child 10859
399d19fc7eb5
equal deleted inserted replaced
10835:9117c08e4707 10836:dc7f25f2f7e4
171 docType, codeComplexityArgs, miscellaneousArgs, errors, eol, 171 docType, codeComplexityArgs, miscellaneousArgs, errors, eol,
172 encoding, backup) 172 encoding, backup)
173 @type list of (str, str, bool, str, str, bool, int, list of (int, int), 173 @type list of (str, str, bool, str, str, bool, int, list of (int, int),
174 bool, str, dict, dict, list of str, str, str, bool) 174 bool, str, dict, dict, list of str, str, str, bool)
175 """ 175 """
176 if lang is None: 176 if (
177 lang = "Python{0}".format( 177 (lang is None and PythonUtilities.isPythonSource(filename, source))
178 PythonUtilities.determinePythonVersion(filename, source) 178 or (lang is not None and lang == "Python3")
179 ) 179 ):
180 if lang != "Python3": 180 data = [source, args]
181 return 181 self.backgroundService.enqueueRequest("style", "Python3", filename, data)
182
183 data = [source, args]
184 self.backgroundService.enqueueRequest("style", lang, filename, data)
185 182
186 def styleBatchCheck(self, argumentsList): 183 def styleBatchCheck(self, argumentsList):
187 """ 184 """
188 Public method to prepare a style check on multiple Python source files. 185 Public method to prepare a style check on multiple Python source files.
189 186
194 """ 191 """
195 data = { 192 data = {
196 "Python3": [], 193 "Python3": [],
197 } 194 }
198 for filename, source, args in argumentsList: 195 for filename, source, args in argumentsList:
199 lang = "Python{0}".format( 196 if PythonUtilities.isPythonSource(filename, source):
200 PythonUtilities.determinePythonVersion(filename, source) 197 data["Python3"].append((filename, source, args))
201 )
202 if lang != "Python3":
203 continue
204 else:
205 data[lang].append((filename, source, args))
206 198
207 self.queuedBatches = [] 199 self.queuedBatches = []
208 if data["Python3"]: 200 if data["Python3"]:
209 self.queuedBatches.append("Python3") 201 self.queuedBatches.append("Python3")
210 self.backgroundService.enqueueRequest( 202 self.backgroundService.enqueueRequest(

eric ide

mercurial