diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2016-03-28 04:51:32 -0700 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2016-03-28 04:51:32 -0700 |
commit | e6c2d1ddf0fd998cb2655b38acfba8136590f2c7 (patch) | |
tree | 84f652a70a280e373bed2460dd701fea64ad22ca | |
parent | e6c339e49eaa5d3341cfd8a90d20c88804b790ce (diff) | |
download | isort-e6c2d1ddf0fd998cb2655b38acfba8136590f2c7.tar.gz |
Implement support for dont-order-by-type
-rwxr-xr-x | isort/main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/isort/main.py b/isort/main.py index 42aa6db1..2a99da4a 100755 --- a/isort/main.py +++ b/isort/main.py @@ -197,6 +197,8 @@ def create_parser(): help='Recursively look for Python files of which to sort imports') parser.add_argument('-ot', '--order-by-type', dest='order_by_type', action='store_true', help='Order imports by type in addition to alphabetically') + parser.add_argument('-dt', '--dont-order-by-type', dest='dont_order_by_type', + action='store_true', help='Only order imports alphabetically, do not attempt type ordering') parser.add_argument('-ac', '--atomic', dest='atomic', action='store_true', help="Ensures the output doesn't save if the resulting file contains syntax errors.") parser.add_argument('-cs', '--combine-star', dest='combine_star', action='store_true', @@ -225,6 +227,8 @@ def create_parser(): arguments = dict((key, value) for (key, value) in itemsview(vars(parser.parse_args())) if value) + if 'dont_order_by_type' in arguments: + arguments['order_by_type'] = False return arguments |