Trim trailing whitespace when extracting isort directives (#1715)

This commit is contained in:
Harutaka Kawamura 2023-01-08 02:39:31 +09:00 committed by GitHub
parent 07f72990a9
commit 76a366e05a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,10 @@ import f
# isort: split
import a
import b
import c
import d
# isort: split
import a
import b

View File

@ -104,6 +104,7 @@ pub fn extract_isort_directives(lxr: &[LexResult]) -> IsortDirectives {
continue;
};
let comment_text = comment_text.trim_end();
if comment_text == "# isort: split" {
splits.push(start.row());
} else if comment_text == "# isort: skip_file" {