Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,766 in github.com/astral-sh/ruff
⨍
Functions
31,766
◇
Types & classes
7,128
↳
Endpoints
82
↓ 2 callers
Method
comment_complexity
Determine the [`CommentComplexity`] of this multiline string sequence.
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:382
↓ 2 callers
Function
comment_strings_in_range
( checker: &'a Checker, range: TextRange, ranges_to_ignore: &[TextRange], )
crates/ruff_linter/src/rules/perflint/helpers.rs:9
↓ 2 callers
Method
commit_pending_blank_lines
(&mut self)
crates/ty_ide/src/docstring/document/numpy.rs:363
↓ 2 callers
Function
common_section
( checker: &Checker, docstring: &Docstring, context: &SectionContext, next: Option<&SectionCon
crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs:1761
↓ 2 callers
Function
compare_different_semantics
Compare types that inherit different builtin comparison implementations. A base-class annotation can contain instances of a known subclass with a dif
crates/ty_python_semantic/src/types/equality.rs:1724
↓ 2 callers
Function
comparison_truthiness
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, left: Type<'db>, right: Type<'db>, opera
crates/ty_python_semantic/src/types/equality.rs:360
↓ 2 callers
Method
components_excluding_self
Returns the components of the qualified name of this class, excluding this class itself. For example, calling this method on a class `C` in the modul
crates/ty_python_semantic/src/types/class.rs:3388
↓ 2 callers
Method
compose_thunk
Compose definition-site and use-site variance, preserving erasure in either position.
crates/ty_python_semantic/src/types/variance/equations.rs:66
↓ 2 callers
Function
comprehension_target_names
( comprehensions: &[ast::Comprehension], )
crates/ruff_python_parser/src/semantic_errors.rs:2152
↓ 2 callers
Function
compute_diagnostics
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, global_settings: &GlobalSettin
crates/ty_server/src/server/api/diagnostics.rs:382
↓ 2 callers
Function
compute_stats
(test_cases: list[TestCase], source: Source)
scripts/conformance.py:583
↓ 2 callers
Method
concat_with
Appends `other`, preserving the elements whose positions are known from either end. A literal expansion preserves every position: ```python result =
crates/ty_python_semantic/src/types/tuple.rs:3009
↓ 2 callers
Method
concrete_value_type
Returns the normalized member payload when construction is known not to transform it. Unlike [`Self::value_type`], this does not substitute a `_value
crates/ty_python_semantic/src/types/enums.rs:573
↓ 2 callers
Function
condensed_full_document_diagnostic_report
(report: FullDocumentDiagnosticReport)
crates/ty_server/tests/e2e/diagnostic_snapshots.rs:60
↓ 2 callers
Method
condition
(&self)
crates/ruff_formatter/src/format_element/tag.rs:274
↓ 2 callers
Method
conditions
Returns iterator over [`Condition`]s which must be satisfied to traverse corresponding edge
crates/ruff_python_semantic/src/cfg/graph.rs:134
↓ 2 callers
Function
config_boolean
( db: &dyn Db, definition: Definition<'_>, keyword: Option<&Keyword>, )
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:609
↓ 2 callers
Method
configuration
(&self)
crates/mdtest/src/parser.rs:151
↓ 2 callers
Function
conflicting_parent_member
( db: &'db dyn Db, program: Program<'db>, parent: ClassType<'db>, target: ClassLiteral<'db>,
crates/ty_python_semantic/src/types/overrides/attributes.rs:933
↓ 2 callers
Method
constraint_failure_from_violation
Converts a solver-reported solution violation into a diagnostic failure.
crates/ty_python_semantic/src/types/generics.rs:3674
↓ 2 callers
Method
constraint_is_substituted
(&self, constraint: AtomicConstraintId)
crates/ty_python_semantic/src/types/constraints/paths.rs:563
↓ 2 callers
Method
constraint_mentions_typevars
( &self, db: &'db dyn Db, constraint: ConstraintId, typevars: TypeVarSet<'db>,
crates/ty_python_semantic/src/types/constraints.rs:1577
↓ 2 callers
Method
constraint_source_order
(&mut self, constraint: ConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1480
↓ 2 callers
Method
constraints
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/constraints.rs:6408
↓ 2 callers
Function
construct_replacement
(elts: &[&str], flags: StringLiteralFlags)
crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs:176
↓ 2 callers
Function
construct_starmap_call
Construct the call to `itertools.starmap` for suggestion.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs:313
↓ 2 callers
Method
constructor_bindings
Build bindings for constructor calls by combining `__new__`/`__init__` signatures. Returns fallback bindings for cases that intentionally keep bespoke
crates/ty_python_semantic/src/types.rs:8105
↓ 2 callers
Method
constructor_for_typevar_bound
Selects the constructor used for a type variable's upper bound. The meta-type of `object` simplifies to permissive bare `type`, so retain the exact c
crates/ty_python_semantic/src/types.rs:3130
↓ 2 callers
Method
constructor_init_argument_matches_keyword_variadic
Return `true` if `argument_index` is matched to the keyword-variadic parameter of an `__init__` constructor.
crates/ty_python_semantic/src/types/call/bind.rs:1089
↓ 2 callers
Function
container_block_end
Returns the end of an indented Markdown or reStructuredText container block. For example, in `["- item", " first", " second", "next"]`, the block a
crates/ty_ide/src/docstring/document/syntax.rs:463
↓ 2 callers
Function
contains
()
crates/ruff_text_size/tests/main.rs:37
↓ 2 callers
Method
contains
Returns whether this union contains exact instances of `class`.
crates/ty_python_semantic/src/types/set_theoretic.rs:762
↓ 2 callers
Method
contains_comments
Returns true if the node itself or any of its descendants have comments.
crates/ruff_python_formatter/src/comments/mod.rs:441
↓ 2 callers
Method
contains_only_annotated_assignments
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/reachability.rs:2299
↓ 2 callers
Function
contains_opposite_quote
(content: &str, flags: AnyStringFlags)
crates/ruff_python_formatter/src/string/normalize.rs:1079
↓ 2 callers
Method
contains_positive
Test the underlying value without discarding an unchanged alias from the intersection.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:2067
↓ 2 callers
Method
contains_range_filter
(&self, range: TextRange)
crates/ty_ide/src/folding_range.rs:122
↓ 2 callers
Function
context_after
Returns the line number accounting for the given `len` number of following context lines. The line number returned is guaranteed to be greater than o
crates/ruff_db/src/diagnostic/render.rs:901
↓ 2 callers
Function
context_before
Returns the line number accounting for the given `len` number of preceding context lines. The line number returned is guaranteed to be less than or e
crates/ruff_db/src/diagnostic/render.rs:864
↓ 2 callers
Function
context_manager_suppresses
( db: &'db dyn Db, expression: Expression<'db>, evaluation_mode: EvaluationMode, )
crates/ty_python_semantic/src/reachability.rs:2010
↓ 2 callers
Method
continuation_line_starts
Returns the line start positions of continuations (backslash).
crates/ruff_python_index/src/indexer.rs:121
↓ 2 callers
Function
convert_to_lsp_symbol_information
Convert a `ty_ide` `SymbolInfo` to LSP `SymbolInformation` Returns `None` if the symbol's range cannot be converted to a location (e.g., if the file
crates/ty_server/src/server/api/symbols.rs:32
↓ 2 callers
Function
copy_directory_recursive
Recursively load a directory into the memory filesystem
crates/ruff_benchmark/src/real_world_projects.rs:217
↓ 2 callers
Function
core_module_scope
Get the scope of a core stdlib module. Can return `None` if a custom typeshed is used that is missing the core module in question.
crates/ty_python_semantic/src/place.rs:774
↓ 2 callers
Method
coroutine_returning_async_iterable
Recognizes coroutines whose results can be iterated over asynchronously. These can arise from async generator stubs that omit `yield`, or from corout
crates/ty_python_semantic/src/types/iteration.rs:189
↓ 2 callers
Function
could_be_short_circuit
Returns `true` if the function body has 2+ return statements with exactly one non-empty list return — indicating a short-circuit pattern.
crates/ruff_linter/src/rules/airflow/rules/task_branch_as_short_circuit.rs:182
↓ 2 callers
Method
could_coexist_in_mro_with_disjointness_checker
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self, c
crates/ty_python_semantic/src/types/class.rs:1767
↓ 2 callers
Method
could_coexist_in_mro_with_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self, c
crates/ty_python_semantic/src/types/class.rs:1798
↓ 2 callers
Method
could_exist_in_mro_of_impl
( self, db: &'db dyn Db, other: Self, specializations_are_disjoint: impl Fn(Sp
crates/ty_python_semantic/src/types/class.rs:1687
↓ 2 callers
Method
could_exist_in_mro_of_with_disjointness_checker
Like [`ClassType::could_exist_in_mro_of`], but reuses an active disjointness checker for nested specialization checks so recursive class graphs keep t
crates/ty_python_semantic/src/types/class.rs:1673
↓ 2 callers
Method
covering_node
Convenience method for `covering_node(cursor.parsed.syntax().into(), ...)`.
crates/ty_ide/src/completion.rs:1007
↓ 2 callers
Method
create_additional_definition
Create a [`Definition`] without recording it in control flow. Returns the new definition and the number of definitions now associated with its AST no
crates/ty_python_core/src/builder.rs:1584
↓ 2 callers
Function
create_all_name
Create and return a string representing a name from the given expression, or `None` if it is an invalid expression for a `__all__` element.
crates/ty_ide/src/symbols.rs:1652
↓ 2 callers
Function
create_diagnostic
Generate a [`Diagnostic`] for a non-PEP 695 type alias or type alias type.
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/non_pep695_type_alias.rs:267
↓ 2 callers
Method
create_directory_all
(&self, path: &SystemPath)
crates/ruff_mdtest/src/db.rs:25
↓ 2 callers
Method
create_error
(self, p: &Parser)
crates/ruff_python_parser/src/parser/mod.rs:1516
↓ 2 callers
Function
create_field_assignment_stmt
Generate a [`Stmt::AnnAssign`] representing the provided field definition.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs:150
↓ 2 callers
Function
create_field_assignment_stmt
Generate a [`Stmt::AnnAssign`] representing the provided field definition.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs:165
↓ 2 callers
Function
create_fix
Attempt to return `Some(fix)`, where `fix` is a `Fix` that can be set on the diagnostic to sort the user's `__all__` definition Return `None` if it's
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:230
↓ 2 callers
Function
create_lint_diagnostic
( body: B, suggestion: Option<S>, range: TextRange, fix: Option<Fix>, parent: Option<TextS
crates/ruff_linter/src/message/mod.rs:82
↓ 2 callers
Function
create_lsp_notebook
( file_path: &Path, open_uri_path: PathBuf, )
crates/ruff_server/tests/e2e/notebook.rs:408
↓ 2 callers
Function
create_name
Create and return a [`Name`] from the given expression, [`None`] if it is an invalid expression for a `__all__` element.
crates/ty_python_semantic/src/dunder_all.rs:450
↓ 2 callers
Function
create_panic_diagnostic
Create a `Diagnostic` from a panic.
crates/ruff_linter/src/message/mod.rs:32
↓ 2 callers
Method
create_printer
(&self)
crates/ruff_formatter/src/lib.rs:334
↓ 2 callers
Method
create_result
( &mut self, items: Vec<WorkspaceDocumentDiagnosticReport>, )
crates/ty_server/src/server/api/requests/workspace_diagnostic.rs:572
↓ 2 callers
Function
create_stack
( checker: &'a Checker, function_def: &'a ast::StmtFunctionDef, )
crates/ruff_linter/src/rules/flake8_return/rules/function.rs:729
↓ 2 callers
Function
create_walker_builder
(db: &dyn Db, paths: I)
crates/ty_project/src/walk.rs:344
↓ 2 callers
Method
crosses_scope_declaration
Returns whether this resolution required crossing a `global` or `nonlocal` declaration.
crates/ty_python_semantic/src/place/definitions.rs:166
↓ 2 callers
Function
curly_escape
(text: &str)
crates/ruff_linter/src/rules/pyupgrade/helpers.rs:8
↓ 2 callers
Method
current_assignment
(&self)
crates/ty_python_core/src/builder.rs:2642
↓ 2 callers
Function
current_directory
()
crates/ty/src/lib.rs:997
↓ 2 callers
Method
current_directory
(&self)
crates/ruff_db/src/system/os.rs:137
↓ 2 callers
Method
current_flags
Returns the flags for the current token.
crates/ruff_python_parser/src/token_source.rs:60
↓ 2 callers
Method
current_range
Returns the range of the current token.
crates/ruff_python_parser/src/token_source.rs:55
↓ 2 callers
Method
current_scope_info
(&self)
crates/ty_python_core/src/builder.rs:382
↓ 2 callers
Method
current_token_id
(&self)
crates/ruff_python_parser/src/parser/mod.rs:403
↓ 2 callers
Method
cursor_name
Returns the file name, relative to this project's root directory, that contains the cursor directive that we are evaluating.
crates/ty_completion_eval/src/main.rs:342
↓ 2 callers
Method
cwd
(self)
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:187
↓ 2 callers
Method
cycle_normalized
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, previous: Self,
crates/ty_python_semantic/src/types/protocol_class.rs:848
↓ 2 callers
Method
cycle_normalized
( mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, previous_inference
crates/ty_python_semantic/src/types/infer.rs:1079
↓ 2 callers
Method
d
(cls)
crates/ruff_linter/resources/test/fixtures/pyflakes/future_annotations.py:30
↓ 2 callers
Function
dangling_comments
(comments: &[SourceComment])
crates/ruff_python_formatter/src/comments/format.rs:203
↓ 2 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/unpacker.rs:71
↓ 2 callers
Function
debug
()
crates/ruff_index/src/idx.rs:55
↓ 2 callers
Method
debug
Returns a nice debug representation that prints the source code for every comment (and not just the range).
crates/ruff_python_formatter/src/comments/mod.rs:165
↓ 2 callers
Function
debug_assert_no_newlines
(text: &str)
crates/ruff_formatter/src/builders.rs:408
↓ 2 callers
Function
declared_instance_attribute_names
( db: &'db dyn Db, class_scope: ScopeId<'db>, )
crates/ty_python_semantic/src/types/overrides.rs:314
↓ 2 callers
Method
decorated_signatures
Returns the effective signatures of this overload after applying decorators.
crates/ty_python_semantic/src/types/function.rs:579
↓ 2 callers
Function
decorator
()
crates/ruff_linter/resources/test/fixtures/flake8_return/RET504.py:212
↓ 2 callers
Function
decorator_runtime_semantics
( decorator_list: &[Decorator], semantic: &SemanticModel, settings: &LinterSettings, )
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:190
↓ 2 callers
Method
decrement_call_like_count
(self)
crates/ruff_python_formatter/src/expression/mod.rs:925
↓ 2 callers
Method
decrement_indent
(mut self)
crates/ruff_formatter/src/printer/call_stack.rs:59
↓ 2 callers
Function
dedent
Removes common leading whitespace from each line. This function will look at each non-empty line and determine the maximum amount of whitespace that
crates/ruff_python_trivia/src/textwrap.rs:154
↓ 2 callers
Method
dedent_one
Dedent one level to eventually reach `new_indentation`. Returns `Err` if the `new_indentation` is greater than the new current indentation level.
crates/ruff_python_parser/src/lexer/indentation.rs:104
↓ 2 callers
Function
dedent_to
Reduce a block's indentation to match the provided indentation. This function looks at the first line in the block to determine the current indentati
crates/ruff_python_trivia/src/textwrap.rs:205
↓ 2 callers
Method
default
()
crates/ruff_linter/src/rules/isort/settings.rs:99
↓ 2 callers
Method
default
()
crates/ruff_linter/src/rules/flake8_self/settings.rs:27
↓ 2 callers
Method
default_fstring_flags
TODO(dylan) add similar method for t-strings Return the default f-string flags a generated `FString` node should use, given where we are in the AST.
crates/ruff_linter/src/checkers/ast/mod.rs:410
↓ 2 callers
Function
default_function
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF009_attrs.py:13
↓ 2 callers
Method
default_matched_type
A splatted argument supplies the type of its matched element. For an ordinary argument, if inference with one or more expected types gave the same res
crates/ty_python_semantic/src/types/call/arguments.rs:147
← previous
next →
5,301–5,400 of 31,766, ranked by callers