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
↓ 5 callers
Method
execute
(self, context)
crates/ruff_linter/resources/test/fixtures/airflow/AIR003.py:58
↓ 5 callers
Function
expand_type
Expands a type into its possible subtypes, if applicable. Returns [`None`] if the type cannot be expanded.
crates/ty_python_semantic/src/types/type_expansion.rs:19
↓ 5 callers
Method
expect_atomic
(self, storage: &ConstraintSetStorage<'_>)
crates/ty_python_semantic/src/types/constraints.rs:1800
↓ 5 callers
Method
expect_module
(mut self, name: &'a str)
crates/ty_module_resolver/src/resolve/search.rs:1550
↓ 5 callers
Method
expect_symbol
(self)
crates/ty_python_core/src/place.rs:489
↓ 5 callers
Method
expect_venv
(self)
crates/ty_site_packages/src/lib.rs:2361
↓ 5 callers
Method
expression
Compute possibly narrowed places for an expression predicate.
crates/ty_python_core/src/place.rs:629
↓ 5 callers
Function
f
()
crates/ruff_python_formatter/resources/test/fixtures/black/cases/slices.py:22
↓ 5 callers
Method
f_strings
Returns an iterator over the [`FString`] parts contained in this value. Note that this doesn't recurse into the f-string parts. For example, ```pyth
crates/ruff_python_ast/src/nodes.rs:637
↓ 5 callers
Function
field_lists
Parses all reST field lists in a docstring.
crates/ty_ide/src/docstring/document/rst.rs:12
↓ 5 callers
Method
fields
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/named_tuple.rs:476
↓ 5 callers
Method
file
Returns the underlying [`File`].
crates/ruff_db/src/files.rs:617
↓ 5 callers
Method
file
(&self)
crates/ty_python_semantic/src/suppression.rs:279
↓ 5 callers
Method
fill
Concatenates a list of [`crate::Format`] objects with spaces and line breaks to fit them on as few lines as possible. Each element introduces a concep
crates/ruff_formatter/src/formatter.rs:171
↓ 5 callers
Method
final_assignment_is_valid
( &mut self, object_ty: Type<'db>, qualifiers: TypeQualifiers, emit_diagnostic
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:516
↓ 5 callers
Method
finish
(&mut self)
crates/ruff_python_formatter/src/builders.rs:215
↓ 5 callers
Method
finish
Finalizes the lower and upper bounds that have been accumulated for this typevar. Returns `None` if the accumulated bounds are not compatible with eac
crates/ty_python_semantic/src/types/constraints.rs:3186
↓ 5 callers
Method
first_component
(&self)
crates/ty_module_resolver/src/module_name.rs:96
↓ 5 callers
Function
first_public_binding
(db: &'db TestDb, file: File, name: &str)
crates/ty_python_semantic/src/types/infer/tests.rs:1151
↓ 5 callers
Function
fits
Returns `true` if the fix fits within the maximum configured line length.
crates/ruff_linter/src/fix/edits.rs:637
↓ 5 callers
Method
fix
(diagnostic: &'a Diagnostic, uri: &str, source_code: &SourceCode)
crates/ruff_db/src/diagnostic/render/sarif.rs:339
↓ 5 callers
Function
fixture_declaration
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1309
↓ 5 callers
Method
fixture_path
(&self, filename: &str)
crates/ruff/tests/cli/main.rs:190
↓ 5 callers
Method
flatten_typevars
Flatten typevars in a union or intersection by resolving them to their upper bounds or constraints. This function is used to properly handle iteratio
crates/ty_python_semantic/src/types.rs:8797
↓ 5 callers
Method
flow_merge
(&mut self, state: FlowSnapshot)
crates/ty_python_core/src/builder.rs:1368
↓ 5 callers
Method
flow_restore
(&mut self, state: FlowSnapshot)
crates/ty_python_core/src/builder.rs:1364
↓ 5 callers
Method
fmt
(&self, pattern: &Pattern, f: &mut PyFormatter)
crates/ruff_python_formatter/src/pattern/mod.rs:43
↓ 5 callers
Method
following_lines
Returns the lines belonging to this section after the summary line.
crates/ruff_linter/src/docstrings/sections.rs:405
↓ 5 callers
Function
foo
()
crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py:3
↓ 5 callers
Function
foo
(d: dict[str, str])
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM911.py:1
↓ 5 callers
Function
foo
()
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM105_0.py:1
↓ 5 callers
Function
foo
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF059_3.py:7
↓ 5 callers
Function
format
The `format` function takes an [`Arguments`] struct and returns the resulting formatting IR. The [`Arguments`] instance can be created with the [`for
crates/ruff_formatter/src/lib.rs:898
↓ 5 callers
Method
format
(&self)
crates/ruff_python_formatter/src/pattern/mod.rs:95
↓ 5 callers
Method
format
(&self)
crates/ruff_python_formatter/src/other/identifier.rs:19
↓ 5 callers
Function
format_enumeration
Format a list of elements as a human-readable enumeration. Encloses every element in backticks (`1`, `2` and `3`).
crates/ty_python_semantic/src/diagnostic/mod.rs:150
↓ 5 callers
Function
format_module_ast
( parsed: &'a Parsed<Mod>, trivia: &'a TriviaRanges, source: &'a str, options: PyFormatOptions
crates/ruff_python_formatter/src/lib.rs:153
↓ 5 callers
Function
format_range
( document: &TextDocument, source_type: SourceType, formatter_settings: &FormatterSettings, ra
crates/ruff_server/src/format.rs:130
↓ 5 callers
Method
full_search_candidates
Returns module candidates for the full search, initializing the candidates on first access if needed.
crates/ty_module_resolver/src/resolve/search.rs:878
↓ 5 callers
Function
gen
()
crates/ruff_linter/resources/test/fixtures/syntax_errors/return_in_generator.py:1
↓ 5 callers
Function
generate_import_edit
Return the [`Fix`] that imports the new name and updates where the import is referenced. This is used for cases that member name has changed. (e.g., `
crates/ruff_linter/src/rules/airflow/helpers.rs:218
↓ 5 callers
Function
generate_remove_and_runtime_import_edit
Return the [`Fix`] that remove the original import and import the same name with new path. This is used for cases that member name has not changed. (e
crates/ruff_linter/src/rules/airflow/helpers.rs:240
↓ 5 callers
Method
generator_types
Extract the yield, send, and return types of a generator.
crates/ty_python_semantic/src/types.rs:8857
↓ 5 callers
Method
generic_context
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/type_alias.rs:292
↓ 5 callers
Method
get_argument_index
(&self, argument_index: usize)
crates/ty_python_semantic/src/types/call/bind.rs:5208
↓ 5 callers
Method
get_by_index
Returns a reference to the AST node at the given index.
crates/ruff_db/src/parsed.rs:231
↓ 5 callers
Function
get_cargo_workspace_root
()
crates/ty_python_semantic/tests/corpus.rs:20
↓ 5 callers
Function
get_cwd
Return the current working directory. On WASM this just returns `.`. Otherwise, defer to [`path_absolutize::path_dedot::CWD`].
crates/ruff_linter/src/fs.rs:11
↓ 5 callers
Method
get_for_parameter
Returns the argument type inferred for this parameter, falling back to [`Self::get_default`] or `Unknown` if that inference is unavailable.
crates/ty_python_semantic/src/types/call/arguments.rs:501
↓ 5 callers
Method
get_interior_node
(&self, id: ScopedNarrowingConstraint)
crates/ty_python_core/src/narrowing_constraints.rs:117
↓ 5 callers
Function
has_leading_content
Return `true` if the node starting the given [`TextSize`] has leading content.
crates/ruff_python_trivia/src/whitespace.rs:60
↓ 5 callers
Function
has_parentheses
Returns the [`OwnParentheses`] value for a given [`Expr`], to indicate whether it has its own parentheses or is itself parenthesized. Differs from [`
crates/ruff_python_formatter/src/expression/mod.rs:1162
↓ 5 callers
Method
has_separate_implementation
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:971
↓ 5 callers
Method
id
(&self)
crates/ruff_python_ast/src/nodes.rs:2718
↓ 5 callers
Method
identity_comparison_truthiness
Return whether values of these types always, never, or possibly identify the same object.
crates/ty_python_semantic/src/types/infer/comparisons.rs:553
↓ 5 callers
Function
if_group_breaks
(content: &Content)
crates/ruff_formatter/src/builders.rs:1871
↓ 5 callers
Function
imp
( db: &'db dyn Db, ty: Type<'db>, visitor: &CompletionKindVisitor<'db>, )
crates/ty_ide/src/completion.rs:3318
↓ 5 callers
Method
in_annotation
Return `true` if the model is in a type annotation.
crates/ruff_python_semantic/src/model.rs:2119
↓ 5 callers
Method
in_dunder_all_definition
Return `true` if the model is visiting the r.h.s. of an `__all__` definition (e.g. `"foo"` in `__all__ = ["foo"]`)
crates/ruff_python_semantic/src/model.rs:2348
↓ 5 callers
Method
in_module_scope
(&self)
crates/ruff_python_parser/tests/fixtures.rs:688
↓ 5 callers
Method
in_type_checking_block
Return `true` if the model is in a type-checking block.
crates/ruff_python_semantic/src/model.rs:2295
↓ 5 callers
Method
indent_style
(&self)
crates/ruff_formatter/src/printer/printer_options/mod.rs:51
↓ 5 callers
Method
indent_width
(&self)
crates/ruff_python_formatter/src/options.rs:240
↓ 5 callers
Method
index
(&self)
crates/ruff_server/src/edit/text_document.rs:72
↓ 5 callers
Method
index
(&self, index: InternedBindingsId)
crates/ty_python_core/src/use_def.rs:541
↓ 5 callers
Method
index_mut
Returns a mutable reference to the index. This method drops all references to the index and returns a guard that will restore the references when dro
crates/ty_server/src/session.rs:1484
↓ 5 callers
Method
infer
(&self, constraints: &ConstraintSetBuilder<'db>)
crates/ty_python_semantic/src/types/call/bind.rs:6883
↓ 5 callers
Method
infer_and_check_argument_types
( &mut self, ast_arguments: ArgumentsIter<'_>, argument_types: &'args mut CallArgument
crates/ty_python_semantic/src/types/infer/builder.rs:6059
↓ 5 callers
Method
infer_annotation_expression
Infer the type of an annotation expression with the given [`DeferredExpressionState`].
crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs:48
↓ 5 callers
Method
infer_explicit_callable_specialization
( &mut self, subscript: &ast::ExprSubscript, value_ty: Type<'db>, generic_cont
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:603
↓ 5 callers
Method
infer_region
Infers types in the given [`InferenceRegion`].
crates/ty_python_semantic/src/types/infer/builder.rs:1175
↓ 5 callers
Method
infer_target
Infer the (definition) types involved in a `target` expression. This is used for assignment statements, for statements, etc. with a single or multipl
crates/ty_python_semantic/src/types/infer/builder.rs:3130
↓ 5 callers
Method
infer_type_expression_reference
Resolve a type-expression reference once, retaining its source definition.
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:271
↓ 5 callers
Method
infer_type_expression_with_state
Similar to [`infer_type_expression`], but accepts a [`DeferredExpressionState`]. [`infer_type_expression`]: TypeInferenceBuilder::infer_type_expressi
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:247
↓ 5 callers
Method
inferable_typevars
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/signatures.rs:2348
↓ 5 callers
Function
init
Initialize the cache at the specified `Path`.
crates/ruff/src/cache.rs:374
↓ 5 callers
Method
initial_return_type
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:860
↓ 5 callers
Method
insert
Add an identifier to the set of visited names in `self` and emit a [`SemanticSyntaxError`] if `ident` has already been seen.
crates/ruff_python_parser/src/semantic_errors.rs:2499
↓ 5 callers
Method
insert_with_settings_diagnostic_path
( &mut self, path: SystemPathBuf, settings_diagnostic_path: Option<SystemPathBuf>,
crates/ty_site_packages/src/lib.rs:97
↓ 5 callers
Method
instance_member
This function roughly corresponds to looking up an attribute in the `__dict__` of an object. For instance-like types, this goes through the classes MR
crates/ty_python_semantic/src/types.rs:4923
↓ 5 callers
Method
instance_member
Returns the instance member lookup.
crates/ty_python_semantic/src/types/class.rs:1078
↓ 5 callers
Method
instance_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/newtype.rs:303
↓ 5 callers
Method
interface
Returns the protocol members of this class. A protocol's members define the interface declared by the protocol. They therefore determine how the prot
crates/ty_python_semantic/src/types/protocol_class.rs:76
↓ 5 callers
Method
intersect
(self, other: TextRange)
crates/ruff_text_size/src/range.rs:224
↓ 5 callers
Method
into_code
Consume this code example and return only the lines that have been accrued so far. This is useful when the code example being collected has been dete
crates/ruff_python_formatter/src/string/docstring.rs:823
↓ 5 callers
Method
into_diagnostic
Convert this program-settings diagnostic into a diagnostic that can be stored on a project.
crates/ty_project/src/metadata/options.rs:764
↓ 5 callers
Method
into_diagnostic
(self, context: Context, lint_context: &LintContext)
crates/ruff_linter/src/rules/ruff/rules/ambiguous_unicode_character.rs:341
↓ 5 callers
Method
into_error
(self)
crates/ruff_python_parser/src/error.rs:360
↓ 5 callers
Method
into_iter
(self)
crates/ty_ide/src/goto.rs:484
↓ 5 callers
Method
into_location
(self)
crates/ty_server/src/document/range.rs:47
↓ 5 callers
Method
into_lookup_result
Transform place and qualifiers into a [`LookupResult`], a [`Result`] type in which the `Ok` variant represents a definitely defined place and the `Err
crates/ty_python_semantic/src/place.rs:1146
↓ 5 callers
Method
into_module
This is the module we were actually interested in resolving, complete the resolution
crates/ty_module_resolver/src/resolve.rs:1370
↓ 5 callers
Method
into_result
Consumes the [`Parsed`] output and returns a [`Result`] which is [`Ok`] if it has no syntax errors, or [`Err`] containing the first [`ParseError`] enc
crates/ruff_python_parser/src/lib.rs:485
↓ 5 callers
Method
into_workspace_edit
(self)
crates/ruff_server/src/edit.rs:179
↓ 5 callers
Function
invalid_start_tag
(expected: TagKind, actual: Option<&FormatElement>)
crates/ruff_formatter/src/printer/mod.rs:1580
↓ 5 callers
Method
is_active
(self)
crates/ty_python_semantic/src/lib.rs:155
↓ 5 callers
Method
is_annotation
(self, db: &'db dyn Db)
crates/ty_python_core/src/scope.rs:38
↓ 5 callers
Method
is_any_newline
(self)
crates/ruff_python_ast/src/token.rs:348
↓ 5 callers
Method
is_boolean_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2429
↓ 5 callers
Method
is_call_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2207
← previous
next →
2,701–2,800 of 31,766, ranked by callers