diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2013-11-14 00:14:01 -0500 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2013-11-14 00:14:01 -0500 |
commit | 0bdb5c32f66f6530f60a567e5089bb183a78ee63 (patch) | |
tree | 6b6f3443e8eb9c095fce58dc402cebb9549b9629 /scripts | |
parent | 764d27d5536075dfd66be2e3ee9accf1e9408c6f (diff) | |
download | isort-0bdb5c32f66f6530f60a567e5089bb183a78ee63.tar.gz |
Fix issue 77: Add support for changing the default section for unknown imports
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/isort | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/isort b/scripts/isort index aed9b585..a70b4ddf 100755 --- a/scripts/isort +++ b/scripts/isort @@ -8,7 +8,7 @@ import argparse from pies.overrides import * -from isort import __version__, SortImports +from isort import __version__, SortImports, SECTION_NAMES parser = argparse.ArgumentParser(description='Sort Python import definitions alphabetically within logical sections.') parser.add_argument('files', nargs='+', help='One or more Python source files that need their imports sorted.') @@ -39,6 +39,8 @@ parser.add_argument('-d', '--stdout', help='Force resulting output to stdout, in parser.add_argument('-c', '--check-only', action='store_true', default=False, dest="check", help='Checks the file for unsorted imports and prints them to the command line without modifying ' 'the file.') +parser.add_argument('-sd', '--section-default', dest='default_section', + help='Sets the default section for imports (by default FIRSTPARTY) options: ' + str(SECTION_NAMES)) parser.add_argument('-v', '--version', action='version', version='isort {0}'.format(__version__)) arguments = dict((key, value) for (key, value) in itemsview(vars(parser.parse_args())) if value) |