Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,562 in github.com/astral-sh/ruff
⨍
Functions
31,562
◇
Types & classes
7,116
↳
Endpoints
82
↓ 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:3720
↓ 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:11591
↓ 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:943
↓ 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:7090
↓ 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:46
↓ 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:2817
↓ 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:763
↓ 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:615
↓ 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:669
↓ 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:2166
↓ 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
catch
(db: &dyn Db, file: File, f: F)
crates/ty_project/src/lib.rs:1115
↓ 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:458
↓ 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:7637
↓ 3 callers
Method
check_attribute_type_violations
(self)
crates/ty_python_semantic/src/types/overrides.rs:2035
↓ 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:1211
↓ 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
Function
check_file
(db: &dyn Db, file: File)
crates/ty_project/src/lib.rs:894
↓ 3 callers
Method
check_method_liskov_violations
(self)
crates/ty_python_semantic/src/types/overrides.rs:2027
↓ 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:147
↓ 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:3308
↓ 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:3180
↓ 3 callers
Method
check_signature_pair
Implementation of subtyping and assignability for signature.
crates/ty_python_semantic/src/types/signatures.rs:2901
↓ 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:2053
↓ 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:1506
↓ 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:757
↓ 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:2884
↓ 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
↓ 3 callers
Method
closeDocument
(name: string)
playground/ty/src/Playground.tsx:720
↓ 3 callers
Method
closing_kind
Returns the token kind that closes the parentheses.
crates/ruff_python_parser/src/parser/mod.rs:1034
↓ 3 callers
Method
cmp
(&self, other: &Self)
crates/ruff_linter/src/rules/isort/sorting.rs:45
↓ 3 callers
Function
code_actions
( db: &dyn Db, file: ProgramFile<'_>, diagnostic_range: TextRange, diagnostic_id: &str, )
crates/ty_ide/src/code_action.rs:22
↓ 3 callers
Method
code_prefix
In a `type: ignore` comment, only codes prefixed with `ty:` belong to ty.
crates/ty_python_semantic/src/suppression.rs:551
↓ 3 callers
Function
collect_for_loop_place_names
(code: &str)
crates/ty_python_core/src/builder/loop_bindings_visitor.rs:269
↓ 3 callers
Function
collect_specs
(formats: &[CFormatStrOrBytes<String>])
crates/ruff_linter/src/rules/pylint/rules/bad_string_format_type.rs:108
↓ 3 callers
Method
combine
(self, other: Self)
crates/ruff_server/src/session/options.rs:426
↓ 3 callers
Method
command_with_subcommand
(&self, subcommand: &str)
crates/ty/tests/common/mod.rs:153
↓ 3 callers
Function
compare
(lhs: &ComparableExpr, rhs: &ComparableExpr)
crates/ruff_linter/src/rules/refurb/rules/check_and_remove_from_set.rs:129
↓ 3 callers
Function
compare
YTT103, YTT201, YTT203, YTT204, YTT302
crates/ruff_linter/src/rules/flake8_2020/rules/compare.rs:241
↓ 3 callers
Method
compatibility_inference_with
Builds a recovery mapping from the already accumulated per-relation solutions. This must not rerun the call-wide solver or present a merged legacy map
crates/ty_python_semantic/src/types/generics.rs:2944
↓ 3 callers
Method
completions
Requests completions after `QUERY` in the client file, using default settings.
crates/ruff_benchmark/benches/ty_ide.rs:373
↓ 3 callers
Method
compose
(self, other: Self)
crates/ty_python_semantic/src/types/variance.rs:147
↓ 3 callers
Method
compute_line_index
(&self, offset: TextSize)
crates/ruff_linter/src/locator.rs:25
↓ 3 callers
Method
compute_position
(&self, cursor: usize)
crates/ruff_python_parser/src/string.rs:127
↓ 3 callers
Method
compute_possibly_narrowed_places
Computes the conservative set of places that could possibly be narrowed by a predicate. This uses the closure-based approach to avoid calling Salsa q
crates/ty_python_core/src/builder.rs:2366
↓ 3 callers
Function
condition_definition_info
Resolves definitions that reach this read, falling back to member lookup for attributes without a definite assignment. The receiver type comes from th
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:378
↓ 3 callers
Method
configuration_root
(self)
crates/ty_project/src/metadata/options.rs:643
↓ 3 callers
Method
constraint
(self)
crates/ty_python_semantic/src/types/constraints.rs:4918
↓ 3 callers
Method
constraint_for_relation
Returns the assignability constraints required by this comparison's polarity.
crates/ty_python_semantic/src/types/generics.rs:3709
↓ 3 callers
Method
constraint_support_id
(&self, constraint: ConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1631
↓ 3 callers
Method
constructor_kind
(&self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:748
↓ 3 callers
Function
constructor_returns_instance
Classify a return type as either being an instance of the given `class_literal` or not, for purposes of deciding whether downstream constructors shoul
crates/ty_python_semantic/src/types/call/bind/constructor.rs:803
↓ 3 callers
Function
consume_quoted_string
Advances past a quoted string after its opening quote has been consumed. For example, after the opening quote in `"value" trailing` has been consumed
crates/ty_ide/src/docstring/document/syntax.rs:556
↓ 3 callers
Method
containing_range
Returns the range of the cell containing the given offset, if any.
crates/ruff_notebook/src/cell.rs:284
↓ 3 callers
Function
contains_only_an_ellipsis
Returns `true` if a function or class body contains only an ellipsis with no comments.
crates/ruff_python_formatter/src/statement/suite.rs:742
↓ 3 callers
Function
contains_quote
Return `true` if the haystack contains the quote.
crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs:384
↓ 3 callers
Method
content_ranges
Returns an iterator over the concatenated source ranges covered by each cell's actual contents, excluding Ruff's synthetic trailing newline separator.
crates/ruff_notebook/src/cell.rs:332
↓ 3 callers
Method
context
Set the number of contextual lines to show around each snippet.
crates/ruff_db/src/diagnostic/mod.rs:1500
↓ 3 callers
Method
context_expr
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1565
↓ 3 callers
Method
context_specific
(mut self, yes: bool)
crates/ty_ide/src/completion.rs:624
↓ 3 callers
Function
convert_symbol_kind
Convert `ty_ide` `SymbolKind` to LSP `SymbolKind`
crates/ty_server/src/server/api/symbols.rs:11
↓ 3 callers
Method
could_coexist_in_mro_with
Return `true` if this class could coexist in an MRO with `other`. For two given classes `A` and `B`, it is often possible to say for sure that there
crates/ty_python_semantic/src/types/class.rs:1724
↓ 3 callers
Function
count
()
crates/ruff_linter/resources/test/fixtures/pylint/nonlocal_and_global.py:6
↓ 3 callers
Function
create_a005_module_structure
construct a directory tree with this structure: . ├── abc │ └── __init__.py ├── collections │ ├── __init__.py │ ├── abc │ │ └── __init__.py │ └─
crates/ruff/tests/cli/lint.rs:4016
↓ 3 callers
Function
create_constraint
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, bound_typevar: BoundTypeVar
crates/ty_python_semantic/src/types/constraints/paths.rs:1235
↓ 3 callers
Method
create_definition
Create a definition without making its declaration or binding visible in control flow.
crates/ty_python_core/src/builder.rs:1531
↓ 3 callers
Function
create_filter
(patterns: impl IntoIterator<Item = &'static str>)
crates/ty_project/src/glob/include.rs:326
↓ 3 callers
Function
create_typevar
(db: &'db TestDb, name: &'static str)
crates/ty_python_semantic/src/types/constraints/paths.rs:1226
↓ 3 callers
Method
current_bindings
Get the current live bindings for a place.
crates/ty_python_core/src/use_def.rs:3186
↓ 3 callers
Method
current_range
(&self)
crates/ruff_python_parser/src/lexer.rs:125
↓ 3 callers
Method
current_statement_ids
Returns an [`Iterator`] over the current statement hierarchy represented as [`NodeId`], from the current [`NodeId`] through to any parents.
crates/ruff_python_semantic/src/model.rs:1512
↓ 3 callers
Function
custom
()
crates/ruff_linter/src/rules/flake8_errmsg/mod.rs:30
↓ 3 callers
Function
custom_value_annotation
Returns the `_value_` annotation type if one is declared in the given scope.
crates/ty_python_semantic/src/types/enums.rs:1397
↓ 3 callers
Method
cycle_normalized
( mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, previous_cycle_res
crates/ty_python_semantic/src/types/unpacker.rs:414
↓ 3 callers
Method
db
(&self)
crates/ty_python_semantic/src/semantic_model.rs:66
↓ 3 callers
Method
declarations
(&self)
crates/ty_python_core/src/use_def/place_state.rs:767
↓ 3 callers
Method
declarations_at_binding
( &self, binding: Definition<'db>, )
crates/ty_python_core/src/use_def.rs:1316
← previous
next →
3,801–3,900 of 31,562, ranked by callers