From d4907b936e03a313c2b0305f63fe57a6c333cb52 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 16 Mar 2021 21:03:38 -0700 Subject: [PATCH] Add config option for reversing sort order --- isort/main.py | 6 ++++++ isort/settings.py | 1 + 2 files changed, 7 insertions(+) diff --git a/isort/main.py b/isort/main.py index 5ed22cc26..d16626f5f 100644 --- a/isort/main.py +++ b/isort/main.py @@ -562,6 +562,12 @@ def _build_arg_parser() -> argparse.ArgumentParser: action="store_true", help="Reverse order of relative imports.", ) + output_group.add_argument( + "--reverse-sort", + dest="reverse_sort", + action="store_true", + help="Reverses the ordering of imports.", + ) inline_args_group.add_argument( "--sl", "--force-single-line-imports", diff --git a/isort/settings.py b/isort/settings.py index a62c27bf6..dc3754ef8 100644 --- a/isort/settings.py +++ b/isort/settings.py @@ -210,6 +210,7 @@ class _Config: honor_case_in_force_sorted_sections: bool = False sort_relative_in_force_sorted_sections: bool = False overwrite_in_place: bool = False + reverse_sort: bool = False def __post_init__(self): py_version = self.py_version