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
↓ 3 callers
Method
apply_type_mapping_impl
Resolve or remap graph references while preserving their arguments.
crates/ty_python_semantic/src/types/recursive.rs:106
↓ 3 callers
Method
apply_type_mapping_impl
Applies a type mapping to every constraint in this constraint set.
crates/ty_python_semantic/src/types/constraints.rs:870
↓ 3 callers
Method
arbitrary_key_initialization_type
Returns the type that a value must be assignable to when initializing an arbitrary string key. The runtime key may name either an extra item or any d
crates/ty_python_semantic/src/types/typed_dict.rs:432
↓ 3 callers
Function
arbitrary_type
Constructs an arbitrary type. The `size` parameter controls the depth of the type tree. For example, a simple type like `int` has a size of 0, `Union
crates/ty_python_semantic/src/types/property_tests/type_generation.rs:543
↓ 3 callers
Method
archive_reader
Creates a reader with its own cursor over the shared archive data. `ZipArchive` stores the current seek position in its reader. Cloning it gives each
crates/ruff_db/src/vendored.rs:187
↓ 3 callers
Method
are_shadowed
(self)
crates/ty_python_core/src/use_def/place_state.rs:176
↓ 3 callers
Method
argument_alternatives
Returns the expanded alternatives of an argument, computing them at most once.
crates/ty_python_semantic/src/types/call/arguments.rs:939
↓ 3 callers
Method
argument_type_context_specialization
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, generic_context: Gene
crates/ty_python_semantic/src/types/call/bind.rs:9285
↓ 3 callers
Method
as_binary_operator
Returns the binary [`Operator`] that corresponds to the current token, if it's a binary operator, otherwise return [None]. Use [`as_augmented_assign_
crates/ruff_python_ast/src/token.rs:554
↓ 3 callers
Method
as_boolean_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2458
↓ 3 callers
Method
as_disjointness_checker
(&self)
crates/ty_python_semantic/src/types/relation.rs:3412
↓ 3 callers
Method
as_generator_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2051
↓ 3 callers
Method
as_mut_slice
(&mut self)
crates/ruff_index/src/vec.rs:57
↓ 3 callers
Method
as_override
Returns `Some(true)` for [`Self::Always`], `Some(false)` for [`Self::Never`], and `None` for [`Self::Auto`].
crates/ruff_command_line/src/color.rs:67
↓ 3 callers
Method
as_ref
(&self)
crates/ruff_python_ast/src/nodes.rs:4083
↓ 3 callers
Method
as_slice
Borrows the available solution paths, including fallback bindings if solving was incomplete. Match the outcome directly when completeness matters.
crates/ty_python_semantic/src/types/constraints.rs:4895
↓ 3 callers
Method
as_slice_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2791
↓ 3 callers
Method
as_specialization
Convert this specialization mapping to a concrete specialization over its own generic context.
crates/ty_python_semantic/src/types/generics.rs:2442
↓ 3 callers
Method
as_star_import
(&self)
crates/ty_python_core/src/definition.rs:972
↓ 3 callers
Method
as_str
(self)
crates/ty_python_semantic/src/types/signatures.rs:5936
↓ 3 callers
Method
as_str
(self)
crates/ty_python_semantic/src/types/subscript.rs:39
↓ 3 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_comprehension.rs:247
↓ 3 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_pyi/rules/exit_annotations.rs:108
↓ 3 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_use_pathlib/rules/os_stat.rs:96
↓ 3 callers
Method
as_system
(&self)
crates/ty_server/src/system.rs:46
↓ 3 callers
Method
as_u16
Return the [`Int`] as an u16, if it can be represented as that data type.
crates/ruff_python_ast/src/int.rs:77
↓ 3 callers
Method
as_u64
Return the [`Int`] as an u64, if it can be represented as that data type.
crates/ruff_python_ast/src/int.rs:93
↓ 3 callers
Method
as_unary_operator
(self)
crates/ruff_python_ast/src/token.rs:527
↓ 3 callers
Function
assert_hashable_unequal
(left: &str, right: &str)
crates/ruff_python_ast_integration_tests/tests/comparable.rs:50
↓ 3 callers
Function
assert_hover
(server: &mut TestServer, path: &SystemPath, position: Position, expected: &str)
crates/ty_server/tests/e2e/closed_documents.rs:380
↓ 3 callers
Function
assert_hover
(server: &mut TestServer, path: &SystemPath, position: Position, expected: &str)
crates/ty_server/tests/e2e/workspace_folders.rs:1020
↓ 3 callers
Method
assert_not_recursive_var
Reject a bare recursive variable at a semantic-operation boundary.
crates/ty_python_semantic/src/types/recursive.rs:914
↓ 3 callers
Function
assert_rendered
(cases: &[(&str, &str)])
crates/ty_ide/src/docstring/markdown/general/inline.rs:873
↓ 3 callers
Function
assert_resolves_to
( db: &TestDb, search: &ModuleSearchCursor, component: &str, expected: &str,
crates/ty_module_resolver/src/resolve/search.rs:1508
↓ 3 callers
Function
assert_single_exposure
( exposures: &'a [FixtureExposure<'db>], name: &str, local_binding: Definition<'db>,
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:4460
↓ 3 callers
Method
at_compound_stmt
Returns `true` if the current token is the start of a compound statement.
crates/ruff_python_parser/src/parser/statement.rs:82
↓ 3 callers
Method
at_simple_stmt
Returns `true` if the current token is the start of a simple statement, including expressions.
crates/ruff_python_parser/src/parser/statement.rs:88
↓ 3 callers
Function
atom_diagnostic
Create a [`Diagnostic`] for a single target, like an [`Expr::Name`].
crates/ruff_linter/src/rules/pyupgrade/rules/os_error_alias.rs:78
↓ 3 callers
Function
atom_diagnostic
Create a [`Diagnostic`] for a single target, like an [`Expr::Name`].
crates/ruff_linter/src/rules/pyupgrade/rules/timeout_error_alias.rs:96
↓ 3 callers
Function
attribute_assignments
Returns all attribute assignments (and their method scope IDs) with a symbol name matching the one given for a specific class body scope. Loop header
crates/ty_python_semantic/src/lib.rs:172
↓ 3 callers
Function
attribute_setattr_member
Resolve `__setattr__` on the selected lookup alternative, preserving the original receiver for `Self` while checking the method's receiver parameter a
crates/ty_python_semantic/src/types/attribute_write.rs:150
↓ 3 callers
Function
attribute_violation
Find the first read or write that the overriding contract fails to preserve. Both contracts are bound to the subclass receiver. `target_receiver` is
crates/ty_python_semantic/src/types/overrides/attributes.rs:457
↓ 3 callers
Method
b
(self)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/trailing_comma_optional_parens1.py:19
↓ 3 callers
Function
bar
()
crates/ruff_python_parser/resources/inline/ok/decorator_expression_py39.py:5
↓ 3 callers
Function
baz
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF059_3.py:16
↓ 3 callers
Method
begin_visit
(&self, db: &'db dyn Db, item: T)
crates/ty_python_semantic/src/types/cyclic.rs:961
↓ 3 callers
Function
benchmark_linter
(mut group: BenchmarkGroup, settings: &LinterSettings)
crates/ruff_benchmark/benches/linter.rs:65
↓ 3 callers
Method
best_failing_overload_index
Chooses which overload to use as the source for diagnostics when no overload fully matches. If step 1 of overload resolution identified a single arit
crates/ty_python_semantic/src/types/call/bind.rs:3727
↓ 3 callers
Function
best_fit_parenthesize
( content: &impl Format<Context>, )
crates/ruff_formatter/src/builders.rs:1568
↓ 3 callers
Method
binding
Returns the definition that binds the test's collected name.
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:133
↓ 3 callers
Method
binding_context
(&self)
crates/ty_python_semantic/src/types.rs:11651
↓ 3 callers
Function
binding_reachability
( db: &'db dyn Db, use_def: &'map UseDefMap<'db>, binding: &BindingWithConstraints<'map, 'db>, )
crates/ty_python_semantic/src/reachability.rs:2139
↓ 3 callers
Method
bindings_for_call
Attaches the call site's scope so generic argument matching can detect recursive calls.
crates/ty_python_semantic/src/types/infer/builder.rs:954
↓ 3 callers
Method
bindings_id
(self)
crates/ty_python_core/src/use_def.rs:338
↓ 3 callers
Method
bindings_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, recursion_guard: &Acti
crates/ty_python_semantic/src/types.rs:7151
↓ 3 callers
Method
body
(&mut self, stmts: &[Stmt])
crates/ruff_python_codegen/src/generator.rs:163
↓ 3 callers
Method
body
The contents of the docstring, excluding the opening and closing quotes.
crates/ruff_linter/src/docstrings/mod.rs:35
↓ 3 callers
Method
bom_start_offset
(&self)
crates/ruff_linter/src/locator.rs:152
↓ 3 callers
Method
bound_name
Returns the name under which the member is bound (e.g., given `from foo import bar as baz`, returns `baz`).
crates/ruff_python_semantic/src/imports.rs:47
↓ 3 callers
Method
bound_signatures
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/method.rs:306
↓ 3 callers
Method
build_merged_with
Build a merged specialization, using a caller-provided hook to select the solution for each typevar. This compatibility API discards correlations and
crates/ty_python_semantic/src/types/generics.rs:2843
↓ 3 callers
Method
build_predicate
( &mut self, predicate_node: &'ast ast::Expr, context: ExpressionContext, regi
crates/ty_python_core/src/builder.rs:2200
↓ 3 callers
Function
builtin_variable_shadowing
A001
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_variable_shadowing.rs:63
↓ 3 callers
Function
builtins_module_scope
Get the `builtins` module scope. Can return `None` if a custom typeshed is used that is missing `builtins.pyi`.
crates/ty_python_semantic/src/place.rs:764
↓ 3 callers
Function
builtins_symbol
Lookup the type of `symbol` in the builtins namespace. Returns `Place::Undefined` if the `builtins` module isn't available for some reason. Note tha
crates/ty_python_semantic/src/place.rs:618
↓ 3 callers
Function
builtins_symbol_impl
Resolves project-level builtins before standard builtins and optionally hides typing-only names. Returns the supplying module's scope together with t
crates/ty_python_semantic/src/place.rs:670
↓ 3 callers
Function
bytes
()
crates/ruff_linter/resources/test/fixtures/flake8_builtins/A001.py:13
↓ 3 callers
Method
c
(*args, **kwargs)
crates/ruff_linter/resources/test/fixtures/mccabe/C901.py:126
↓ 3 callers
Function
cache_dir
Return the cache directory for a given project root.
crates/ruff_cache/src/lib.rs:12
↓ 3 callers
Method
cache_key
A key for changes to the watched paths.
crates/ty_project/src/watch/project_watcher.rs:172
↓ 3 callers
Function
call_argument_node
( call_expression: &'a ast::ExprCall, name: &str, position: usize, )
crates/ty_python_semantic/src/types/infer/builder/function.rs:2164
↓ 3 callers
Method
can_be_shadowed
(self)
crates/ty_python_core/src/use_def/place_state.rs:391
↓ 3 callers
Function
can_omit_optional_parentheses
Tests if it is safe to omit the optional parentheses. We prefer parentheses at least in the following cases: The expression contains more than one un
crates/ruff_python_formatter/src/expression/mod.rs:518
↓ 3 callers
Function
categorize
( module_name: &str, is_relative: bool, src: &[PathBuf], package: Option<PackageRoot<'_>>,
crates/ruff_linter/src/rules/isort/categorize.rs:93
↓ 3 callers
Method
cells
Return a slice of [`Cell`] in the Jupyter notebook.
crates/ruff_notebook/src/notebook.rs:461
↓ 3 callers
Function
check
Pushes a diagnostic and fix depending on escape characters seen so far. If we have not seen any valid escape characters, we convert to a raw string.
crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs:262
↓ 3 callers
Method
check_argument_type
( &mut self, constraints: &ConstraintSetBuilder<'db>, argument: Argument<'a>,
crates/ty_python_semantic/src/types/call/bind.rs:7754
↓ 3 callers
Method
check_attribute_type_violations
(self)
crates/ty_python_semantic/src/types/overrides.rs:2034
↓ 3 callers
Method
check_callable_pair
Check whether one callable type has the given relation to another callable type. See [`Type::is_subtype_of`] and [`Type::is_assignable_to`] for more
crates/ty_python_semantic/src/types/callable.rs:1192
↓ 3 callers
Method
check_default_for_outer_scope_typevars
Check if a PEP 695 type parameter's default references type variables from an outer scope. Returns `true` if such a reference was found and a diagnos
crates/ty_python_semantic/src/types/infer/builder/typevar.rs:471
↓ 3 callers
Method
check_file
(&self, file: File)
crates/ty_project/src/db.rs:256
↓ 3 callers
Method
check_method_liskov_violations
(self)
crates/ty_python_semantic/src/types/overrides.rs:2026
↓ 3 callers
Function
check_os_pathlib_two_arg_calls
( checker: &Checker, call: &ExprCall, attr: &str, path_arg: &str, second_arg: &str, fi
crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs:146
↓ 3 callers
Method
check_property_instance_pair
( &self, db: &'db dyn Db, source: PropertyInstanceType<'db>, target: PropertyI
crates/ty_python_semantic/src/types/relation.rs:3365
↓ 3 callers
Method
check_protocol_interface_pair
( &self, db: &'db dyn Db, source_type: Type<'db>, source: ProtocolInterfaceVie
crates/ty_python_semantic/src/types/protocol_class.rs:3267
↓ 3 callers
Method
check_signature_pair
Implementation of subtyping and assignability for signature.
crates/ty_python_semantic/src/types/signatures.rs:2912
↓ 3 callers
Method
check_signature_return_pair
( &self, db: &'db dyn Db, source: &Signature<'db>, target: &Signature<'db>,
crates/ty_python_semantic/src/types/signatures.rs:3091
↓ 3 callers
Method
check_subtyping_in_invariant_position
( &self, db: &'db dyn Db, source_type: Type<'db>, source_materialization: Mate
crates/ty_python_semantic/src/types/generics.rs:2071
↓ 3 callers
Method
check_tuple_unpacking
Report [`UnsupportedSyntaxError`]s for each starred element in `expr` if it is an unparenthesized tuple. This method can be used to check for tuple u
crates/ruff_python_parser/src/parser/statement.rs:504
↓ 3 callers
Method
choose_quotes
Computes the strings preferred quotes.
crates/ruff_python_formatter/src/string/normalize.rs:193
↓ 3 callers
Method
class
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/known_instance.rs:151
↓ 3 callers
Method
class
Return the [`KnownClass`] which this symbol is an instance of
crates/ty_python_semantic/src/types/special_form.rs:138
↓ 3 callers
Function
class_literal_to_hierarchy_info
Convert a `ClassLiteral` to `TypeHierarchyClass` info. For the most part, this is about extracting the right text ranges.
crates/ty_python_semantic/src/types/ide_support.rs:2082
↓ 3 callers
Method
class_member
Returns the class member of this class named `name`. The member resolves to a member on the class itself or any of its proper superclasses. TODO: Sh
crates/ty_python_semantic/src/types/class/static_literal.rs:1505
↓ 3 callers
Method
class_member_from_mro
Look up a class-level member using a provided MRO iterator. This is used by `super()` to start the MRO lookup after the pivot class.
crates/ty_python_semantic/src/types/class.rs:776
↓ 3 callers
Method
class_member_from_mro
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, name: &str, po
crates/ty_python_semantic/src/types/class/static_literal.rs:1559
↓ 3 callers
Method
class_specialization
If this type is a class instance or class-backed `TypedDict`, returns its specialization.
crates/ty_python_semantic/src/types.rs:2883
↓ 3 callers
Function
clean_space
Replace any non-whitespace characters from an indentation string within a Python docstring.
crates/ruff_python_ast/src/docstrings.rs:10
↓ 3 callers
Method
clear
(&mut self)
crates/ruff_db/src/system/command.rs:126
↓ 3 callers
Method
clear_imported_qualifiers
(&mut self)
crates/ty_python_core/src/use_def/place_state.rs:245
← previous
next →
3,801–3,900 of 31,766, ranked by callers