diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-15 21:44:59 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-12-15 21:44:59 -0800 |
commit | 8517840952c3cff5eff61f4d4bd1092f830e9ff8 (patch) | |
tree | 10c29b94d1c3f483f7d6cd5d38036358424651c4 | |
parent | bbfea1a2551c1d2c7f5f53983936895f81f0fa7a (diff) | |
download | isort-8517840952c3cff5eff61f4d4bd1092f830e9ff8.tar.gz |
Start removal of comment start and end from parse and output
-rw-r--r-- | isort/output.py | 4 | ||||
-rw-r--r-- | isort/parse.py | 8 |
2 files changed, 1 insertions, 11 deletions
diff --git a/isort/output.py b/isort/output.py index 846dfc4b..cf02e7b4 100644 --- a/isort/output.py +++ b/isort/output.py @@ -145,8 +145,6 @@ def sorted_imports( output_at = 0 if parsed.import_index < parsed.original_line_count: output_at = parsed.import_index - elif parsed.first_comment_index_end != -1 and parsed.first_comment_index_start <= 2: - output_at = parsed.first_comment_index_end formatted_output[output_at:0] = output imports_tail = output_at + len(output) @@ -168,8 +166,6 @@ def sorted_imports( in_top_comment=False, index=len(formatted_output), section_comments=parsed.section_comments, - first_comment_index_start=parsed.first_comment_index_start, - first_comment_index_end=parsed.first_comment_index_end, ) if not should_skip and line.strip(): if ( diff --git a/isort/parse.py b/isort/parse.py index c2a835d5..03eefa97 100644 --- a/isort/parse.py +++ b/isort/parse.py @@ -91,9 +91,7 @@ def skip_line( (skip_line: bool, in_quote: str, - in_top_comment: bool, - first_comment_index_start: int, - first_comment_index_end: int) + in_top_comment: bool) """ skip_line = bool(in_quote) if index == 1 and line.startswith("#"): @@ -150,8 +148,6 @@ class ParsedContent(NamedTuple): as_map: Dict[str, List[str]] imports: Dict[str, Dict[str, Any]] categorized_comments: "CommentsDict" - first_comment_index_start: int - first_comment_index_end: int change_count: int original_line_count: int line_separator: str @@ -448,8 +444,6 @@ def file_contents(contents: str, config: Config = DEFAULT_CONFIG) -> ParsedConte as_map=as_map, imports=imports, categorized_comments=categorized_comments, - first_comment_index_start=first_comment_index_start, - first_comment_index_end=first_comment_index_end, change_count=change_count, original_line_count=original_line_count, line_separator=line_separator, |