diff options
author | Oskar Hahn <mail@oshahn.de> | 2013-10-30 08:53:51 +0100 |
---|---|---|
committer | Oskar Hahn <mail@oshahn.de> | 2013-10-30 08:53:51 +0100 |
commit | a8dd93bcdf8c035c4af6150203eec40797de6c61 (patch) | |
tree | cfe6f595869cfe019ae567aae24637b86ce4bbb4 /scripts | |
parent | e3ed1cb2ba1042660088233b4bf7762632ec00b2 (diff) | |
download | isort-a8dd93bcdf8c035c4af6150203eec40797de6c61.tar.gz |
The isort script returns the status code '1' in case of incorrectly sorted files
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/isort | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/isort b/scripts/isort index 56707b99..05394d63 100755 --- a/scripts/isort +++ b/scripts/isort @@ -47,5 +47,10 @@ file_names = arguments.pop('files', []) if file_names == ['-']: SortImports(file_contents=sys.stdin.read(), write_to_stdout=True, **arguments) else: + wrong_sorted_files = False for file_name in file_names: - SortImports(file_name, **arguments) + incorrectly_sorted = SortImports(file_name, **arguments).incorrectly_sorted + if arguments.get('check', False) and incorrectly_sorted: + wrong_sorted_files = True + if wrong_sorted_files: + exit(1) |