Let's say I have this file:
import asyncio
from json.decoder import JSONDecodeError
import json
from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor
from contextlib import contextmanager
from datetime import datetime
from enum import Enum
import io
from multiprocessing import Manager, freeze_support
import os
from pathlib import Path
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
import re
import signal
import sys
import tokenize
import traceback
from typing import (
Any,
Dict,
Generator,
Iterator,
List,
MutableMapping,
Optional,
Pattern,
Sequence,
Set,
Sized,
Tuple,
Union,
)
If I run orderPythonImports
on it, it changes to this:
import io
import os
import re
import sys
import json
import signal
import asyncio
import tokenize
import traceback
from typing import ( # See, there's a bit of a problem here
from enum import Enum
from pathlib import Path
from datetime import datetime
from contextlib import contextmanager
from json.decoder import JSONDecodeError
from multiprocessing import Manager, freeze_support
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor
Any,
Dict,
Generator,
Iterator,
List,
MutableMapping,
Optional,
Pattern,
Sequence,
Set,
Sized,
Tuple,
Union,
)
The from import
tuple was totally slaughtered. Please fix this!