319 @return tuple giving line number, offset within line and error code |
319 @return tuple giving line number, offset within line and error code |
320 (integer, integer, string) |
320 (integer, integer, string) |
321 """ |
321 """ |
322 functionType = getattr(node, "function_type", "function") |
322 functionType = getattr(node, "function_type", "function") |
323 name = node.name |
323 name = node.name |
324 if (functionType == "function" and "__" in (name[:2], name[-2:])) or \ |
324 if ( |
325 not self.LowercaseRegex.match(name): |
325 (functionType == "function" and "__" in (name[:2], name[-2:])) or |
|
326 not self.LowercaseRegex.match(name) |
|
327 ): |
326 yield self.__error(node, "N802") |
328 yield self.__error(node, "N802") |
327 |
329 |
328 def __checkFunctionArgumentNames(self, node, parents): |
330 def __checkFunctionArgumentNames(self, node, parents): |
329 """ |
331 """ |
330 Private class to check the argument names of functions |
332 Private class to check the argument names of functions |
423 if moduleName.lower() != moduleName: |
425 if moduleName.lower() != moduleName: |
424 yield self.__error(node, "N807") |
426 yield self.__error(node, "N807") |
425 |
427 |
426 if moduleName == "__init__": |
428 if moduleName == "__init__": |
427 # we got a package |
429 # we got a package |
428 packageName = \ |
430 packageName = ( |
429 os.path.split(os.path.dirname(self.__filename))[1] |
431 os.path.split(os.path.dirname(self.__filename))[1] |
|
432 ) |
430 if packageName.lower() != packageName: |
433 if packageName.lower() != packageName: |
431 yield self.__error(node, "N808") |
434 yield self.__error(node, "N808") |
432 |
435 |
433 def __checkImportAs(self, node, parents): |
436 def __checkImportAs(self, node, parents): |
434 """ |
437 """ |