Skip to content

Commit

Permalink
Fixed #1781: CLI flag shouldn't take any arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 15, 2021
1 parent 2776034 commit c467a98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/
### 5.9.3 TBD
- Improved text of skipped file message to mention gitignore feature.
- Fixed #1779: Pylama integration ignores pylama specific isort config overrides.
- Fixed #1781: `--from-first` CLI flag shouldn't take any arguments.

### 5.9.2 July 8th 2021
- Improved behavior of `isort --check --atomic` against Cython files.
Expand Down
1 change: 1 addition & 0 deletions isort/main.py
Expand Up @@ -462,6 +462,7 @@ def _build_arg_parser() -> argparse.ArgumentParser:
"--ff",
"--from-first",
dest="from_first",
action="store_true",
help="Switches the typical ordering preference, "
"showing from imports first then straight ones.",
)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_main.py
Expand Up @@ -78,6 +78,7 @@ def test_parse_args():
assert main.parse_args(["--combine-straight-imports"]) == {"combine_straight_imports": True}
assert main.parse_args(["--dont-follow-links"]) == {"follow_links": False}
assert main.parse_args(["--overwrite-in-place"]) == {"overwrite_in_place": True}
assert main.parse_args(["--from-first"]) == {"from_first": True}


def test_ascii_art(capsys):
Expand Down Expand Up @@ -562,7 +563,7 @@ def test_isort_with_stdin(capsys):
"""
)

main.main(["-", "--ff", "FROM_FIRST"], stdin=input_content)
main.main(["-", "--ff"], stdin=input_content)
out, error = capsys.readouterr()

assert out == (
Expand Down

0 comments on commit c467a98

Please sign in to comment.