diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-08 23:37:33 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-08 23:37:33 -0800 |
commit | 34f8e8bb56a3e92504d991ea1f852c29e5b04efa (patch) | |
tree | e82e1744c53071dbb4b3a816e9981bf72611ff45 | |
parent | 8c758856c69de5412f6e4daa551b79cc7f3c1bfb (diff) | |
download | isort-34f8e8bb56a3e92504d991ea1f852c29e5b04efa.tar.gz |
Update documentation for sort_imports
-rw-r--r-- | isort/parse.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/isort/parse.py b/isort/parse.py index 1681c6e3..6acf0158 100644 --- a/isort/parse.py +++ b/isort/parse.py @@ -469,10 +469,18 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte ) -def identify_contiguous_imports( +def sort_imports( input_stream: TextIO, output_stream: TextIO, config: Config = DEFAULT_CONFIG ) -> None: - """Parses stream identifying sections of contiguous imports""" + """Parses stream identifying sections of contiguous imports and sorting them + + Code with unsorted imports is read from the provided `input_stream`, sorted and then + outputted to the specified output_stream. + + - `input_stream`: Text stream with unsorted import sections. + - `output_stream`: Text stream to output sorted inputs into. + - `config`: Config settings to use when sorting imports. Defaults settings.DEFAULT_CONFIG. + """ import_section: str = "" in_quote: str = "" first_comment_index_start: int = -1 |