MCPcopy Create free account

hub / github.com/PyCQA/isort / functions

Functions829 in github.com/PyCQA/isort

↓ 27 callersMethodread
(filename: str | Path)
isort/io.py:54
↓ 14 callersMethod__init__
(self, message: str, file_path: str)
isort/exceptions.py:54
↓ 13 callersMethodseek
(self, *args, **kwargs)
tests/unit/utils.py:7
↓ 11 callersFunctionisort_test
Runs isort against the given code snippet and ensures that it gives consistent output across multiple runs, and if an expected_output is given
tests/unit/utils.py:20
↓ 10 callersFunctiongit_clone
Clones the given repository into the given directory path
tests/integration/test_projects_using_isort.py:21
↓ 10 callersFunctionrun_isort
Runs isort in diff and check mode with the given arguments
tests/integration/test_projects_using_isort.py:26
↓ 8 callersMethodis_supported_filetype
(self, file_name: str)
isort/settings.py:497
↓ 8 callersFunctionskip_chars
(src: str, pos: Pos, chars: Iterable[str])
isort/_vendored/tomli/_parser.py:322
↓ 7 callersFunction_config
( path: Path | None = None, config: Config = DEFAULT_CONFIG, **config_kwargs: Any )
isort/api.py:631
↓ 6 callersFunction_format_collection
Render already-rendered, sorted ``elements`` as ``open ... close`` honoring the config: a single line when it fits within ``line_length`` (account
isort/literal.py:103
↓ 6 callersFunction_repr_element
Render a single sorted element: strings via black's quote rule, everything else via repr() (so ints and other literals in ``# isort: list`` etc. k
isort/literal.py:94
↓ 6 callersFunctionimports_in_code
(code: str, **kwargs)
tests/unit/test_identify.py:7
↓ 6 callersFunctionmain
(argv: Sequence[str] | None = None, stdin: TextIOWrapper | None = None)
isort/main.py:1001
↓ 6 callersMethodset
(self, key: Key, flag: int, *, recursive: bool)
isort/_vendored/tomli/_parser.py:253
↓ 5 callersFunctionas_stream
(text: str)
tests/unit/utils.py:16
↓ 5 callersFunctionblack_test
Tests that the given code: - Behaves the same when formatted multiple times with isort. - Agrees with black formatting. - Matches the desi
tests/unit/profiles/test_black.py:22
↓ 5 callersMethoderror
(self, message: str)
isort/format.py:107
↓ 5 callersFunctionexists_case_sensitive
Returns if the given path exists and also matches the case on Windows. When finding files that can be imported, it is important for the cases to
isort/utils.py:63
↓ 5 callersMethodinsert
(self, config_file: str, config_data: dict[str, Any])
isort/utils.py:26
↓ 5 callersMethodsearch
Returns the closest config relative to filename by doing a depth first search on the prefix tree.
isort/utils.py:39
↓ 4 callersFunctioncreate_terminal_printer
( color: bool, output: TextIO | None = None, error: str = "", success: str = "" )
isort/format.py:140
↓ 4 callersMethoddiff_line
(self, line: str)
isort/format.py:110
↓ 4 callersMethodget_or_create_nest
( self, key: Key, *, access_lists: bool = True, )
isort/_vendored/tomli/_parser.py:287
↓ 4 callersMethodis_
(self, key: Key, flag: int)
isort/_vendored/tomli/_parser.py:264
↓ 4 callersMethodis_skipped
Returns True if the file and/or folder should be skipped based on current settings.
isort/settings.py:559
↓ 3 callersFunction_get_config_data
(file_path: str, sections: tuple[str, ...])
isort/settings.py:812
↓ 3 callersFunctionparse_args
(argv: Sequence[str] | None = None)
isort/main.py:872
↓ 3 callersFunctionparse_key
(src: str, pos: Pos)
isort/_vendored/tomli/_parser.py:457
↓ 3 callersFunctionshow_unified_diff
Shows a unified_diff for the provided input and output against the provided file path. - **file_input**: A string that represents the contents of
isort/format.py:43
↓ 3 callersFunctionskip_until
( src: str, pos: Pos, expect: str, *, error_on: frozenset[str], error_on_eof: bool, )
isort/_vendored/tomli/_parser.py:331
↓ 3 callersFunctionsort_stream
Sorts any imports within the provided code stream, outputs to the provided output stream. Returns `True` if anything is modified from the origina
isort/api.py:134
↓ 3 callersMethodsuccess
(self, message: str)
isort/format.py:104
↓ 2 callersFunction_build_arg_parser
()
isort/main.py:116
↓ 2 callersFunction_is_package
(path: Path)
isort/place.py:110
↓ 2 callersMethod_open
Open a file in read only mode using the encoding detected by detect_encoding().
isort/io.py:37
↓ 2 callersFunction_vertical_grid_common
(need_trailing_char: bool, **interface: Any)
isort/wrap_modes.py:182
↓ 2 callersFunction_write_simple_settings
(tmp_file)
tests/unit/test_settings.py:114
↓ 2 callersFunctioncheck_stream
Checks any imports within the provided code stream, returning `False` if any unsorted or incorrectly imports are found or `True` if no problems ar
isort/api.py:237
↓ 2 callersFunctioncollect_import_continuation
r"""Collect continuation lines for a multi-line import statement. Handles both parenthesised imports ``from X import (`` + newline + `` Y, Z)`
isort/_parse_utils.py:93
↓ 2 callersMethoddetect_encoding
(filename: str | Path, readline: Callable[[], bytes])
isort/io.py:21
↓ 2 callersFunctionentry_points
Call entry_point after lazy loading it. TODO: The reason for lazy loading here are unknown.
isort/settings.py:915
↓ 2 callersFunctionfind_imports_in_stream
Finds and returns all imports within the provided code stream. - **input_stream**: The stream of code with imports that need to be sorted. -
isort/api.py:527
↓ 2 callersFunctionget_output
Run a command and return raw output :param str command: the command to run :returns: the stdout output of the command
isort/hooks.py:14
↓ 2 callersFunctionimport_type
If the current line is an import line it will return its type.
isort/_parse_utils.py:169
↓ 2 callersFunctionmodule_with_reason
Returns the section placement for the given module name alongside the reasoning.
isort/place.py:22
↓ 2 callersFunctionnormalize_from_import_string
Normalize a ``from … import …`` string, handling line-continuation characters. Removes ``import(``, backslash continuations and embedded newlines
isort/_parse_utils.py:151
↓ 2 callersFunctionnormalize_line
Normalizes import related statements in the provided line.
isort/_parse_utils.py:15
↓ 2 callersFunctionparse_basic_str
(src: str, pos: Pos, *, multiline: bool)
isort/_vendored/tomli/_parser.py:642
↓ 2 callersFunctionparse_key_value_pair
( src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int )
isort/_vendored/tomli/_parser.py:441
↓ 2 callersFunctionparse_literal_str
(src: str, pos: Pos)
isort/_vendored/tomli/_parser.py:604
↓ 2 callersFunctionparse_one_line_basic_str
(src: str, pos: Pos)
isort/_vendored/tomli/_parser.py:493
↓ 2 callersFunctionparse_value
(src: str, pos: Pos, parse_float: ParseFloat, nest_lvl: int)
isort/_vendored/tomli/_parser.py:674
↓ 2 callersFunctionskip_comment
(src: str, pos: Pos)
isort/_vendored/tomli/_parser.py:353
↓ 2 callersFunctionskip_comments_and_array_ws
(src: str, pos: Pos)
isort/_vendored/tomli/_parser.py:363
↓ 2 callersFunctionskip_line
Determine if a given line should be skipped.
isort/_parse_utils.py:48
↓ 2 callersMethodstatement
(self)
isort/identify.py:33
↓ 2 callersFunctionstrip_syntax
(import_string: str)
isort/_parse_utils.py:26
↓ 2 callersMethodstyle_text
(text: str, style: str | None = None)
isort/format.py:126
↓ 1 callersMethod__init__
(self, error: str, success: str, output: TextIO | None = None)
isort/format.py:99
↓ 1 callersMethod__init__
(self)
isort/_vendored/tomli/_parser.py:233
↓ 1 callersFunction_abspaths
(cwd: str, values: Iterable[str])
isort/settings.py:734
↓ 1 callersFunction_as_bool
Given a string value that represents True or False, returns the Boolean equivalent. Heavily inspired from distutils strtobool.
isort/settings.py:905
↓ 1 callersFunction_as_list
(value: object)
isort/settings.py:727
↓ 1 callersFunction_atoi
(text: str)
isort/sorting.py:123
↓ 1 callersFunction_black_quote
Quote a string the way black does: prefer double quotes, fall back to single only when it avoids escaping. Values with backslashes or control char
isort/literal.py:79
↓ 1 callersFunction_build_as_imports
Build the import statements for a given list (`as_imports`) of aliased imports.
isort/output.py:300
↓ 1 callersFunction_build_grouped_from_imports
Build a string of imports, wrapping them across multiple lines if necessary.
isort/output.py:400
↓ 1 callersFunction_build_import_group
Build the sorted import lines for one group (eager or lazy) within a section.
isort/output.py:210
↓ 1 callersMethod_check_folder_git_ls_files
(self, folder: str)
isort/settings.py:522
↓ 1 callersFunction_ensure_newline_before_comment
(output: list[str])
isort/output.py:877
↓ 1 callersFunction_file_output_stream_context
Output stream that is written to disk, using a "temporary" `.isorted` file. If `changed` is set at exit it will replace the source file with
isort/api.py:367
↓ 1 callersFunction_find_config
(path: str)
isort/settings.py:746
↓ 1 callersFunction_forced_separate
(name: str, config: Config)
isort/place.py:33
↓ 1 callersMethod_format_option
(name: str, value: object, source: object)
isort/exceptions.py:164
↓ 1 callersFunction_get_str_to_type_converter
(setting_name: str)
isort/settings.py:720
↓ 1 callersFunction_hanging_indent_end_line
(line: str)
isort/wrap_modes.py:107
↓ 1 callersFunction_has_changed
(before: str, after: str, line_separator: str, ignore_whitespace: bool)
isort/core.py:580
↓ 1 callersFunction_has_skip_comment
Return whether an import statement carries a per-line ``isort: skip`` directive.
isort/core.py:60
↓ 1 callersFunction_in_memory_output_stream_context
Output stream that is kept in memory. If `changed` is set at exit it will copy the stream to the source file.
isort/api.py:350
↓ 1 callersFunction_indented_config
(config: Config, indent: str)
isort/core.py:566
↓ 1 callersFunction_infer_line_separator
(contents: str)
isort/parse.py:38
↓ 1 callersFunction_is_comment_or_string_start
Return whether `line` opens a comment, a docstring or any other string literal. A string prefix (`r`, `b`, `f`, `u` or a legal combination of the
isort/core.py:51
↓ 1 callersFunction_is_module
(path: Path)
isort/place.py:99
↓ 1 callersFunction_is_namespace_package
(path: Path, src_extensions: frozenset[str])
isort/place.py:114
↓ 1 callersFunction_known_pattern
(name: str, config: Config)
isort/place.py:53
↓ 1 callersFunction_local
(name: str, config: Config)
isort/place.py:46
↓ 1 callersFunction_natural_keys
(text: str)
isort/sorting.py:127
↓ 1 callersFunction_normalize_empty_lines
(lines: list[str])
isort/output.py:869
↓ 1 callersFunction_output_as_string
(lines: list[str], line_separator: str)
isort/output.py:865
↓ 1 callersMethod_parse_known_pattern
Expand pattern if identified as a directory and return found sub packages
isort/settings.py:706
↓ 1 callersFunction_print_hard_fail
Fail on unrecoverable exception with custom message.
isort/main.py:101
↓ 1 callersFunction_record_targets
(code: str, prefix: str = "")
tests/integration/test_hypothesmith.py:22
↓ 1 callersFunction_separate_packages
(section_output: list[str], config: Config)
isort/output.py:897
↓ 1 callersFunction_src_path
( name: str, config: Config, src_paths: Iterable[Path] | None = None, prefix: tuple[str, ...]
isort/place.py:64
↓ 1 callersFunction_src_path_is_module
(src_path: Path, module_name: str)
isort/place.py:143
↓ 1 callersFunction_strip_string_prefix
Return `line` without a leading Python string prefix (`r`, `b`, `f`, `u` or a legal combination of them), so quote-based heuristics see the quote
isort/core.py:39
↓ 1 callersFunction_with_from_imports
( parsed: parse.ParsedContent, config: Config, from_modules: Iterable[str], section: str,
isort/output.py:499
↓ 1 callersFunction_with_from_imports_for_module
Build the from-import lines for a given module and section.
isort/output.py:531
↓ 1 callersFunction_with_star_comments
(parsed: parse.ParsedContent, module: str, comments: list[str])
isort/output.py:890
↓ 1 callersFunction_with_straight_imports
( parsed: parse.ParsedContent, config: Config, straight_modules: Iterable[str], section: str,
isort/output.py:784
next →1–100 of 829, ranked by callers