From 0b26361d5d8fb824db7e805f3f7c78d02fcd2613 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Tue, 28 Jul 2020 20:37:23 -0700 Subject: [PATCH] Fix CLI documentation for filter files. --- .isort.cfg | 2 +- docs/configuration/options.md | 57 +++++++++++++++++++++++++++-------- isort/main.py | 3 +- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 3f3b28ad5..1e3f216fb 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,4 @@ [settings] profile=hug src_paths=isort,test -skip=tests/example_crlf_file.py +skip=tests/example_crlf_file.py,migrations diff --git a/docs/configuration/options.md b/docs/configuration/options.md index f63debb12..60db0ace2 100644 --- a/docs/configuration/options.md +++ b/docs/configuration/options.md @@ -162,6 +162,17 @@ Force isort to recognize a module as being part of the current python project. - -p - --project +## Known Local Folder + +Force isort to recognize a module as being a local folder. Generally, this is reserved for relative imports (from . import module). + +**Type:** Frozenset +**Default:** `frozenset()` +**Python & Config File Name:** known_local_folder +**CLI Flags:** + +- --known-local-folder + ## Known Standard Library Force isort to recognize a module as part of Python's standard library. @@ -719,7 +730,7 @@ Inserts a blank line before a comment following an import. ## Profile -Base profile type to use for configuration. +Base profile type to use for configuration. Profiles include: black, django, pycharm, google, open_stack, plone, attrs, hug. As well as any shared profiles. **Type:** String **Default:** `` @@ -787,7 +798,7 @@ Causes all non indented imports to float to the top of the file having its impor ## Filter Files -Tells isort to filter files even when they are explicitly passed in as part of the CLI command. Note that while this can be set as part of the config file it only affects CLI operation. +Tells isort to filter files even when they are explicitly passed in as part of the CLI command. **Type:** Bool **Default:** `False` @@ -796,6 +807,37 @@ Tells isort to filter files even when they are explicitly passed in as part of t - --filter-files +## Formatter + +Specifies the name of a formatting plugin to use when producing output. + +**Type:** String +**Default:** `` +**Python & Config File Name:** formatter +**CLI Flags:** + +- --formatter + +## Formatting Function + +**No Description** + +**Type:** Nonetype +**Default:** `None` +**Python & Config File Name:** formatting_function +**CLI Flags:** **Not Supported** + +## Color Output + +Tells isort to use color in terminal output. + +**Type:** Bool +**Default:** `False` +**Python & Config File Name:** color_output +**CLI Flags:** + +- --color + ## Check Checks the file for unsorted / unformatted imports and prints them to the command line without modifying the file. @@ -937,17 +979,6 @@ See isort's determined config, as well as sources of config options. - --show-config -## Color Terminal Output - -Tells isort to use color in terminal output. - -**Type:** Bool -**Default:** `False` -**Python & Config File Name:** color_output -**CLI Flags:** - -- --color - ## Deprecated Flags ==SUPPRESS== diff --git a/isort/main.py b/isort/main.py index 3724bbc1b..b6583974a 100644 --- a/isort/main.py +++ b/isort/main.py @@ -555,8 +555,7 @@ def _build_arg_parser() -> argparse.ArgumentParser: dest="filter_files", action="store_true", help="Tells isort to filter files even when they are explicitly passed in as " - "part of the CLI command. Note that while this can be set as part of the config file it " - "only affects CLI operation.", + "part of the CLI command." ) parser.add_argument( "files", nargs="*", help="One or more Python source files that need their imports sorted."