Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderPythonImports doesn't properly handle multiple imports in one from stmt #1

Open
noahbroyles opened this issue Jul 11, 2022 · 0 comments
Assignees

Comments

@noahbroyles
Copy link
Owner

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!

@noahbroyles noahbroyles self-assigned this Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant