Skip to content

Commit 41fa290

Browse files
Update configuration docs
1 parent 6bb47b7 commit 41fa290

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

docs/configuration/options.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Force isort to recognize a module as being a local folder. Generally, this is re
179179
Force isort to recognize a module as part of Python's standard library.
180180

181181
**Type:** Frozenset
182-
**Default:** `('_dummy_thread', '_thread', 'abc', 'aifc', 'argparse', 'array', 'ast', 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'base64', 'bdb', 'binascii', 'binhex', 'bisect', 'builtins', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', 'configparser', 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', 'csv', 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbm', 'decimal', 'difflib', 'dis', 'distutils', 'doctest', 'dummy_threading', 'email', 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fpectl', 'fractions', 'ftplib', 'functools', 'gc', 'getopt', 'getpass', 'gettext', 'glob', 'grp', 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http', 'imaplib', 'imghdr', 'imp', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools', 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'macpath', 'mailbox', 'mailcap', 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', 'msilib', 'msvcrt', 'multiprocessing', 'netrc', 'nis', 'nntplib', 'ntpath', 'numbers', 'operator', 'optparse', 'os', 'ossaudiodev', 'parser', 'pathlib', 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'poplib', 'posix', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource', 'rlcompleter', 'runpy', 'sched', 'secrets', 'select', 'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3', 'sre', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', 'string', 'stringprep', 'struct', 'subprocess', 'sunau', 'symbol', 'symtable', 'sys', 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 'test', 'textwrap', 'threading', 'time', 'timeit', 'tkinter', 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'tty', 'turtle', 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'uu', 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg', 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', 'zipimport', 'zlib')`
182+
**Default:** `('_dummy_thread', '_thread', 'abc', 'aifc', 'argparse', 'array', 'ast', 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'base64', 'bdb', 'binascii', 'binhex', 'bisect', 'builtins', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', 'configparser', 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', 'csv', 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbm', 'decimal', 'difflib', 'dis', 'distutils', 'doctest', 'dummy_threading', 'email', 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fpectl', 'fractions', 'ftplib', 'functools', 'gc', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib', 'grp', 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http', 'imaplib', 'imghdr', 'imp', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools', 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'macpath', 'mailbox', 'mailcap', 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', 'msilib', 'msvcrt', 'multiprocessing', 'netrc', 'nis', 'nntplib', 'ntpath', 'numbers', 'operator', 'optparse', 'os', 'ossaudiodev', 'parser', 'pathlib', 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'poplib', 'posix', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource', 'rlcompleter', 'runpy', 'sched', 'secrets', 'select', 'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3', 'sre', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', 'string', 'stringprep', 'struct', 'subprocess', 'sunau', 'symbol', 'symtable', 'sys', 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 'test', 'textwrap', 'threading', 'time', 'timeit', 'tkinter', 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'tty', 'turtle', 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'uu', 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg', 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', 'zipimport', 'zlib', 'zoneinfo')`
183183
**Python & Config File Name:** known_standard_library
184184
**CLI Flags:**
185185

@@ -296,7 +296,7 @@ Sort imports by their string length.
296296

297297
## Length Sort Straight
298298

299-
Sort straight imports by their string length.
299+
Sort straight imports by their string length. Similar to `length_sort` but applies only to straight imports and doesn't affect from imports.
300300

301301
**Type:** Bool
302302
**Default:** `False`
@@ -602,7 +602,7 @@ Force all imports to be sorted as a single section
602602

603603
## Force Grid Wrap
604604

605-
Force number of from imports (defaults to 2 when passed as CLI flag without value) to be grid wrapped regardless of line length. If 0 is passed in (the global default) only line length is considered.
605+
Force number of from imports (defaults to 2 when passed as CLI flag without value)to be grid wrapped regardless of line length. If 0 is passed in (the global default) only line length is considered.
606606

607607
**Type:** Int
608608
**Default:** `0`
@@ -633,6 +633,15 @@ Don't sort straight-style imports (like import sys) before from-style imports (l
633633
**Python & Config File Name:** lexicographical
634634
**CLI Flags:** **Not Supported**
635635

636+
## Group By Package
637+
638+
**No Description**
639+
640+
**Type:** Bool
641+
**Default:** `False`
642+
**Python & Config File Name:** group_by_package
643+
**CLI Flags:** **Not Supported**
644+
636645
## Ignore Whitespace
637646

638647
Tells isort to ignore whitespace differences when --check-only is being used.
@@ -767,8 +776,8 @@ Tells isort to honor noqa comments to enforce skipping those comments.
767776

768777
Add an explicitly defined source path (modules within src paths have their imports automatically categorized as first_party).
769778

770-
**Type:** Frozenset
771-
**Default:** `frozenset()`
779+
**Type:** Tuple
780+
**Default:** `()`
772781
**Python & Config File Name:** src_paths
773782
**CLI Flags:**
774783

@@ -800,7 +809,8 @@ Tells isort to remove redundant aliases from imports, such as `import os as os`.
800809

801810
## Float To Top
802811

803-
Causes all non-indented imports to float to the top of the file having its imports sorted. It can be an excellent shortcut for collecting imports every once in a while when you place them in the middle of a file to avoid context switching.
812+
Causes all non-indented imports to float to the top of the file having its imports sorted (immediately below the top of file comment).
813+
This can be an excellent shortcut for collecting imports every once in a while when you place them in the middle of a file to avoid context switching.
804814

805815
*NOTE*: It currently doesn't work with cimports and introduces some extra over-head and a performance penalty.
806816

@@ -880,7 +890,7 @@ Tells isort to treat all single line comments as if they are code.
880890
Specifies what extensions isort can be ran against.
881891

882892
**Type:** Frozenset
883-
**Default:** `('py', 'pyi', 'pyx')`
893+
**Default:** `('pxd', 'py', 'pyi', 'pyx')`
884894
**Python & Config File Name:** supported_extensions
885895
**CLI Flags:**
886896

@@ -949,6 +959,36 @@ Causes imports to be sorted only based on their sections like STDLIB,THIRDPARTY
949959
- --only-sections
950960
- --os
951961

962+
## Only Modified
963+
964+
Suppresses verbose output for non-modified files.
965+
966+
**Type:** Bool
967+
**Default:** `False`
968+
**Python & Config File Name:** only_modified
969+
**CLI Flags:**
970+
971+
- --only-modified
972+
- --om
973+
974+
## Auto Identify Namespace Packages
975+
976+
**No Description**
977+
978+
**Type:** Bool
979+
**Default:** `True`
980+
**Python & Config File Name:** auto_identify_namespace_packages
981+
**CLI Flags:** **Not Supported**
982+
983+
## Namespace Packages
984+
985+
**No Description**
986+
987+
**Type:** Frozenset
988+
**Default:** `frozenset()`
989+
**Python & Config File Name:** namespace_packages
990+
**CLI Flags:** **Not Supported**
991+
952992
## Check
953993

954994
Checks the file for unsorted / unformatted imports and prints them to the command line without modifying the file.
@@ -1090,6 +1130,17 @@ See isort's determined config, as well as sources of config options.
10901130

10911131
- --show-config
10921132

1133+
## Show Files
1134+
1135+
See the files isort will be ran against with the current config options.
1136+
1137+
**Type:** Bool
1138+
**Default:** `False`
1139+
**Python & Config File Name:** **Not Supported**
1140+
**CLI Flags:**
1141+
1142+
- --show-files
1143+
10931144
## Deprecated Flags
10941145

10951146
==SUPPRESS==

0 commit comments

Comments
 (0)