Skip to content

Commit c467a98

Browse files
Fixed #1781: CLI flag shouldn't take any arguments.
1 parent 2776034 commit c467a98

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/
77
### 5.9.3 TBD
88
- Improved text of skipped file message to mention gitignore feature.
99
- Fixed #1779: Pylama integration ignores pylama specific isort config overrides.
10+
- Fixed #1781: `--from-first` CLI flag shouldn't take any arguments.
1011

1112
### 5.9.2 July 8th 2021
1213
- Improved behavior of `isort --check --atomic` against Cython files.

isort/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ def _build_arg_parser() -> argparse.ArgumentParser:
462462
"--ff",
463463
"--from-first",
464464
dest="from_first",
465+
action="store_true",
465466
help="Switches the typical ordering preference, "
466467
"showing from imports first then straight ones.",
467468
)

tests/unit/test_main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_parse_args():
7878
assert main.parse_args(["--combine-straight-imports"]) == {"combine_straight_imports": True}
7979
assert main.parse_args(["--dont-follow-links"]) == {"follow_links": False}
8080
assert main.parse_args(["--overwrite-in-place"]) == {"overwrite_in_place": True}
81+
assert main.parse_args(["--from-first"]) == {"from_first": True}
8182

8283

8384
def test_ascii_art(capsys):
@@ -562,7 +563,7 @@ def test_isort_with_stdin(capsys):
562563
"""
563564
)
564565

565-
main.main(["-", "--ff", "FROM_FIRST"], stdin=input_content)
566+
main.main(["-", "--ff"], stdin=input_content)
566567
out, error = capsys.readouterr()
567568

568569
assert out == (

0 commit comments

Comments
 (0)