424 # skip suck imports because its already handled by pycodestyle |
424 # skip suck imports because its already handled by pycodestyle |
425 continue |
425 continue |
426 |
426 |
427 imports.append( |
427 imports.append( |
428 ImportNode( |
428 ImportNode( |
429 self.__args.get("ApplicationPackageNames", []), importNode, self |
429 self.__args.get("ApplicationPackageNames", []), |
|
430 importNode, |
|
431 self, |
|
432 self.__args.get("SortIgnoringStyle", False), |
|
433 self.__args.get("SortFromFirst", False), |
430 ) |
434 ) |
431 ) |
435 ) |
432 |
436 |
433 lenImports = len(imports) |
437 lenImports = len(imports) |
434 if lenImports > 0: |
438 if lenImports > 0: |
440 for n in imports[1:]: |
444 for n in imports[1:]: |
441 if n.error is not None: |
445 if n.error is not None: |
442 errors.append(n.error) |
446 errors.append(n.error) |
443 |
447 |
444 if n == p: |
448 if n == p: |
445 errors.append((n.node, "I203", str(p), str(n))) |
449 if ( |
|
450 self.__args.get("CombinedAsImports", False) |
|
451 or (not n.asImport and not p.asImport) |
|
452 ): |
|
453 errors.append((n.node, "I203", str(p), str(n))) |
446 elif n < p: |
454 elif n < p: |
447 errors.append((n.node, "I201", str(n), str(p))) |
455 errors.append((n.node, "I201", str(n), str(p))) |
448 |
456 |
449 p = n |
457 p = n |
450 |
458 |