Skip to content

Commit

Permalink
Improve formatting of config option documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Nov 23, 2021
1 parent 0ea444f commit 4a8d2f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
44 changes: 22 additions & 22 deletions docs/configuration/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ NOTE: wrap_length must be LOWER than or equal to line_length.
Forces line endings to the specified value. If not set, values will be guessed per-file.

**Type:** String
**Default:** ``
**Config default:** ``
**Default:** ` `
**Config default:** ` `
**Python & Config File Name:** line_ending
**CLI Flags:**

Expand All @@ -213,7 +213,7 @@ Forces line endings to the specified value. If not set, values will be guessed p

What sections isort should display imports for and in what order

**Type:** Tuple
**Type:** List of Strings
**Default:** `('FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER')`
**Config default:** `['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']`
**Python & Config File Name:** sections
Expand Down Expand Up @@ -459,7 +459,7 @@ multi_line_output = 3

Force certain sub modules to show separately

**Type:** Tuple
**Type:** List of Strings
**Default:** `()`
**Config default:** `[]`
**Python & Config File Name:** forced_separate
Expand Down Expand Up @@ -665,7 +665,7 @@ Forces all from imports to appear on their own line

One or more modules to exclude from the single line rule.

**Type:** Tuple
**Type:** List of Strings
**Default:** `()`
**Config default:** `[]`
**Python & Config File Name:** single_line_exclusions
Expand Down Expand Up @@ -1076,8 +1076,8 @@ Tells isort to include casing when sorting module names
Virtual environment to use for determining whether a package is third-party

**Type:** String
**Default:** ``
**Config default:** ``
**Default:** ` `
**Config default:** ` `
**Python & Config File Name:** virtual_env
**CLI Flags:**

Expand All @@ -1088,8 +1088,8 @@ Virtual environment to use for determining whether a package is third-party
Conda environment to use for determining whether a package is third-party

**Type:** String
**Default:** ``
**Config default:** ``
**Default:** ` `
**Config default:** ` `
**Python & Config File Name:** conda_env
**CLI Flags:**

Expand All @@ -1113,8 +1113,8 @@ Inserts a blank line before a comment following an import.
Base profile type to use for configuration. Profiles include: black, django, pycharm, google, open_stack, plone, attrs, hug, wemake, appnexus. As well as any shared profiles.

**Type:** String
**Default:** ``
**Config default:** ``
**Default:** ` `
**Config default:** ` `
**Python & Config File Name:** profile
**CLI Flags:**

Expand All @@ -1136,7 +1136,7 @@ Tells isort to honor noqa comments to enforce skipping those comments.

Add an explicitly defined source path (modules within src paths have their imports automatically categorized as first_party). Glob expansion (`*` and `**`) is supported for this option.

**Type:** Tuple
**Type:** List of Strings
**Default:** `()`
**Config default:** `[]`
**Python & Config File Name:** src_paths
Expand Down Expand Up @@ -1220,8 +1220,8 @@ Tells isort to filter files even when they are explicitly passed in as part of t
Specifies the name of a formatting plugin to use when producing output.

**Type:** String
**Default:** ``
**Config default:** ``
**Default:** ` `
**Config default:** ` `
**Python & Config File Name:** formatter
**CLI Flags:**

Expand All @@ -1233,7 +1233,7 @@ The fully qualified Python path of a function to apply to format code sorted by

**Type:** Nonetype
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** formatting_function
**CLI Flags:** **Not Supported**

Expand Down Expand Up @@ -1684,7 +1684,7 @@ Explicitly set the settings path or file instead of auto determining based on fi

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand All @@ -1699,7 +1699,7 @@ Explicitly set the config root for resolving all configs. When used with the --r

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand All @@ -1724,7 +1724,7 @@ Number of files to process in parallel. Negative value means use number of CPUs.

**Type:** Int
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand All @@ -1749,7 +1749,7 @@ One or more Python source files that need their imports sorted.

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand All @@ -1773,7 +1773,7 @@ Provide the filename associated with a stream.

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand Down Expand Up @@ -1825,7 +1825,7 @@ Tells isort to format the given files according to an extensions formatting rule

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand All @@ -1837,7 +1837,7 @@ Tells isort to format the given files according to an extensions formatting rule

**Type:** String
**Default:** `None`
**Config default:** ``
**Config default:** ` `
**Python & Config File Name:** **Not Supported**
**CLI Flags:**

Expand Down
6 changes: 3 additions & 3 deletions scripts/build_config_option_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
os.path.join(os.path.dirname(os.path.abspath(__file__)), "../docs/configuration/options.md")
)
MD_NEWLINE = " "
HUMAN_NAME = {"py_version": "Python Version", "vn": "Version Number", "str": "String", "frozenset": "List of Strings", }
HUMAN_NAME = {"py_version": "Python Version", "vn": "Version Number", "str": "String", "frozenset": "List of Strings", "tuple": "List of Strings"}
CONFIG_DEFAULTS = {"False": "false", "True": "true", "None": ""}
DESCRIPTIONS = {}
IGNORED = {"source", "help", "sources", "directory"}
Expand Down Expand Up @@ -321,8 +321,8 @@ def __str__(self):
{self.description}
**Type:** {human(self.type.__name__)}{MD_NEWLINE}
**Default:** `{self.default}`{MD_NEWLINE}
**Config default:** `{config_default(self.default)}`{MD_NEWLINE}
**Default:** `{str(self.default) or " "}`{MD_NEWLINE}
**Config default:** `{config_default(self.default) or " "}`{MD_NEWLINE}
**Python & Config File Name:** {self.config_name}{MD_NEWLINE}
**CLI Flags:**{cli_options}
{example}"""
Expand Down

0 comments on commit 4a8d2f6

Please sign in to comment.