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
↓ 7 callers
Method
to_diagnostic
(&self, severity: Severity)
crates/ty_project/src/uv/metadata.rs:131
↓ 7 callers
Method
to_merged_options
Returns all option layers merged according to their precedence.
crates/ty_project/src/metadata.rs:532
↓ 7 callers
Method
to_specialized_class_type
Look up a generic [`KnownClass`] in its canonical module and return a [`Type`] representing a specialization of that class. If the class cannot be fo
crates/ty_python_semantic/src/types/class/known.rs:1302
↓ 7 callers
Method
to_u32
Returns current raw `offset` as u32. # Examples ```rust # use ruff_text_size::*; assert_eq!(TextSize::from(4).to_u32(), 4); ```
crates/ruff_text_size/src/size.rs:78
↓ 7 callers
Method
tokens
(&self, contents: &str)
crates/ruff_wasm/src/lib.rs:512
↓ 7 callers
Method
top
(self, db: &dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:1673
↓ 7 callers
Function
traverse_union
Traverse a "union" type annotation, applying `func` to each union member. Supports traversal of `Union` and `|` union expressions. The function is c
crates/ruff_python_semantic/src/analyze/typing.rs:477
↓ 7 callers
Method
trim_whitespace_end
(&self)
crates/ruff_python_trivia/src/whitespace.rs:121
↓ 7 callers
Method
try_call_dunder_get
Looks up `__get__` on the meta-type of `self` and calls it with `self`, `instance`, and `owner`. Unlike other dunder methods, `__get__` is not itself
crates/ty_python_semantic/src/types.rs:5176
↓ 7 callers
Method
try_metaclass
Return the selected metaclass or protocol fallback, or an error if it cannot be inferred.
crates/ty_python_semantic/src/types/class/static_literal.rs:1313
↓ 7 callers
Method
typevar_data
(&self, typevar: TypeVarId)
crates/ty_python_semantic/src/types/constraints.rs:1606
↓ 7 callers
Method
unpack
Matches the source sequence `self` to the target shape specified by `length`. For `a, b = (1, "two")`, `length` is `TupleLength::Fixed(2)`, and each
crates/ty_python_semantic/src/types/tuple.rs:2412
↓ 7 callers
Method
unpack_keys_and_items
Returns the key and value types of this object if it was unpacked using `**`, or `None` if the object does not support unpacking.
crates/ty_python_semantic/src/types.rs:6992
↓ 7 callers
Function
uv_workspace
(root: &SystemPathBuf, system: &TestSystem)
crates/ty_project/src/metadata.rs:2149
↓ 7 callers
Method
value
(&self)
crates/ty_project/src/metadata/value.rs:149
↓ 7 callers
Method
version
Get the version of document selected by this query.
crates/ruff_server/src/session/index.rs:615
↓ 7 callers
Method
visit
( &self, db: &'db dyn Db, ty: Type<'db>, type_mapping: &TypeMapping<'_, 'db>,
crates/ty_python_semantic/src/types.rs:580
↓ 7 callers
Method
visit_body
(&mut self, body: &'a [Stmt])
crates/ruff_python_ast/src/visitor.rs:93
↓ 7 callers
Method
visit_expr
(&mut self, expr: &Expr)
crates/ty_ide/src/semantic_tokens.rs:1079
↓ 7 callers
Method
watcher_registration_request
( &mut self, )
crates/ty_server/tests/e2e/main.rs:622
↓ 7 callers
Function
watcher_registrations
(server: &mut TestServer)
crates/ty_server/tests/e2e/file_watching.rs:535
↓ 7 callers
Method
with_definedness
(mut self, definedness: Definedness)
crates/ty_python_semantic/src/place.rs:175
↓ 7 callers
Function
with_escaped_paths
(f: impl FnOnce() -> R)
crates/ty_project/src/metadata.rs:2164
↓ 7 callers
Method
with_library_root
Add a "library" root to this test case.
crates/ty_module_resolver/src/testing.rs:161
↓ 7 callers
Method
with_optional_default_type
(self, default: Option<Type<'db>>)
crates/ty_python_semantic/src/types/signatures.rs:6189
↓ 7 callers
Method
with_polarity
Creates a `VarianceInferable` that applies `polarity` (see `TypeVarVariance::compose`) to the result of variance inference on the underlying value. I
crates/ty_python_semantic/src/types/variance.rs:256
↓ 7 callers
Method
with_print_mode
(mut self, mode: PrintMode)
crates/ruff_formatter/src/printer/call_stack.rs:74
↓ 7 callers
Method
with_recursion
(&mut self, f: impl FnOnce(&mut Self) -> T)
crates/ruff_python_parser/src/parser/mod.rs:965
↓ 7 callers
Method
with_transformed_parameters
Rebuild this parameter list after transforming its existing parameters. Unlike [`Self::from_annotation`], this preserves the provenance of the origin
crates/ty_python_semantic/src/types/signatures.rs:5279
↓ 7 callers
Method
with_use_uv
(mut self, use_uv: UseUv)
crates/ty_project/src/metadata.rs:353
↓ 7 callers
Method
with_vendored_typeshed
Use the vendored stdlib stubs included in the Ruff binary for this test case
crates/ty_module_resolver/src/testing.rs:197
↓ 6 callers
Method
accepted_type
Which type is accepted in a write to this protocol member? Returns `None` if that type cannot be represented directly (if the protocol member is a cu
crates/ty_python_semantic/src/types/attribute_write.rs:103
↓ 6 callers
Method
add_binding
Add a [`Binding`] to the current scope, bound to the given name.
crates/ruff_linter/src/checkers/ast/mod.rs:2813
↓ 6 callers
Method
add_clause
(&mut self, provenance: ConstraintProvenance, ty: Type<'db>)
crates/ty_python_semantic/src/types/constraints.rs:2029
↓ 6 callers
Method
add_future_import
Add a `from __future__ import annotations` import.
crates/ruff_linter/src/importer/mod.rs:565
↓ 6 callers
Function
add_inferred_python_version_hint_to_diagnostic
Add a subdiagnostic to `diagnostic` that explains why a certain Python version was inferred. ty can infer the Python version from various sources, su
crates/ty_python_semantic/src/diagnostic/mod.rs:50
↓ 6 callers
Method
add_place
Add a place to the place table and the use-def map. Return the [`ScopedPlaceId`] that uniquely identifies the place in both.
crates/ty_python_core/src/builder.rs:1384
↓ 6 callers
Method
add_predicate
Adds a new predicate to the list of all predicates, but does not record it. Returns the predicate ID for later recording using [`SemanticIndexBuilder:
crates/ty_python_core/src/builder.rs:2326
↓ 6 callers
Method
add_range
Add the given folding range if it spans multiple lines.
crates/ty_ide/src/folding_range.rs:128
↓ 6 callers
Method
add_str
(self, text: &str)
crates/ruff_linter/src/line_width.rs:219
↓ 6 callers
Function
adjust_indentation
Safely adjust the indentation of the indented block at [`TextRange`]. The [`TextRange`] is assumed to represent an entire indented block, including t
crates/ruff_linter/src/fix/edits.rs:433
↓ 6 callers
Method
advance
Returns a new search which has been advanced by one component of a module name. The previous search object can be reused for searching sibling module
crates/ty_module_resolver/src/resolve/search.rs:271
↓ 6 callers
Function
all
(x)
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C419_2.py:2
↓ 6 callers
Method
analyze_constraint_set
Solves one relation without recording it or changing the legacy type mappings.
crates/ty_python_semantic/src/types/generics.rs:3598
↓ 6 callers
Method
analyze_successful_pattern
Compute the subject and binding types produced by a successful pattern. `subject_ty` is the type of the value reaching this pattern node. Structural
crates/ty_python_semantic/src/types/narrow.rs:2232
↓ 6 callers
Method
annotations
(&self, workspace: &Workspace)
crates/ty_wasm/src/lib.rs:913
↓ 6 callers
Function
any_over_type_including_alias_arguments
Searches through the arguments of [`Type::TypeAlias`] without evaluating alias bodies or other lazy attributes. This also visits arguments that the al
crates/ty_python_semantic/src/types/visitor.rs:1080
↓ 6 callers
Method
apply_changes
( &mut self, client: &Client, path: &AnySystemPath, changes: &[ChangeEvent],
crates/ty_server/src/session.rs:549
↓ 6 callers
Method
apply_configuration_files
Loads the lower-precedence options from the user-level configuration file.
crates/ty_project/src/metadata.rs:508
↓ 6 callers
Method
apply_specialization
Apply a specialization to this class.
crates/ty_python_semantic/src/types/class.rs:1044
↓ 6 callers
Method
as_atomic
(self, storage: &ConstraintSetStorage<'_>)
crates/ty_python_semantic/src/types/constraints.rs:1862
↓ 6 callers
Method
as_compare_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2199
↓ 6 callers
Method
as_enum
(self)
crates/ty_python_semantic/src/types/literal.rs:197
↓ 6 callers
Method
as_instance_attribute
Return `Some(<ATTRIBUTE>)` if the place expression is an instance attribute.
crates/ty_python_core/src/member.rs:113
↓ 6 callers
Method
as_paramspec
Returns the bound `ParamSpec` type variable if the parameter list is exactly `P`. For either `P` or `Concatenate[<prefix-params>, P]`, use [`as_param
crates/ty_python_semantic/src/types/signatures.rs:5392
↓ 6 callers
Method
as_paramspec_value
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:3168
↓ 6 callers
Method
as_ptr
(&self)
crates/ruff_python_ast/src/generated.rs:7088
↓ 6 callers
Method
as_relation_checker
( &'a self, materialization_visitor: &'a ApplyTypeMappingVisitor<'a, 'db>, )
crates/ty_python_semantic/src/types/relation.rs:3409
↓ 6 callers
Method
as_str
The full debug text between the `{` and the conversion / `format_spec` / `}`.
crates/ruff_python_ast/src/nodes.rs:513
↓ 6 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_pie/rules/reimplemented_container_builtin.rs:100
↓ 6 callers
Method
as_u8
Return the [`Int`] as an u8, if it can be represented as that data type.
crates/ruff_python_ast/src/int.rs:69
↓ 6 callers
Function
assert_comparable
(left: &str, right: &str)
crates/ruff_python_ast_integration_tests/tests/comparable.rs:11
↓ 6 callers
Function
assert_logical_lines
(contents: &str, expected: &[&str])
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:663
↓ 6 callers
Function
assert_section_is_structurally_ambiguous
(raw: &str)
crates/ty_ide/src/docstring/document/numpy.rs:1351
↓ 6 callers
Function
assignment_attribute_members
Return the members considered by attribute assignment in lookup-precedence order. The type member comes from class-member lookup. A member found dire
crates/ty_python_semantic/src/types/attribute_write.rs:1055
↓ 6 callers
Method
at_soft_keyword
Returns `true` if the parser is at a soft keyword token.
crates/ruff_python_parser/src/parser/expression.rs:131
↓ 6 callers
Function
bind_markdown_snapshot_filters
()
crates/ty_ide/src/docstring/markdown/structured/numpy.rs:365
↓ 6 callers
Function
binding
( bound_typevar: BoundTypeVarInstance<'db>, solution: Type<'db>, )
crates/ty_python_semantic/src/types/constraints/resolution.rs:273
↓ 6 callers
Method
build
(self)
crates/ty_project/src/glob/exclude.rs:90
↓ 6 callers
Method
build
(self)
crates/ty_python_core/src/db.rs:159
↓ 6 callers
Method
bump_any
Bumps the current token regardless of its kind and advances to the next token. # Panics If the parser is at end of file.
crates/ruff_python_parser/src/parser/mod.rs:588
↓ 6 callers
Method
bump_revision
Bumps the revision. The revision is used to track when workspace diagnostics may have changed and need to be re-run. It's okay if a bump doesn't nece
crates/ty_server/src/session.rs:415
↓ 6 callers
Method
cache_key
(&self)
crates/ty_project/src/uv/service.rs:180
↓ 6 callers
Method
call
(param)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/fmtonoff5.py:52
↓ 6 callers
Method
cell_offsets
Return the [`CellOffsets`] for the concatenated source code corresponding the Jupyter notebook.
crates/ruff_notebook/src/notebook.rs:396
↓ 6 callers
Method
charge_type
Charges the set-theoretic terms that a type constructor may flatten or inspect. Aliases are included so a large union cannot evade the limit by being
crates/ty_python_semantic/src/types/constraints/projection.rs:73
↓ 6 callers
Function
check
()
crates/ty_wasm/tests/api.rs:7
↓ 6 callers
Function
check_file
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/lib.rs:235
↓ 6 callers
Method
clear_salsa_events
Clears the emitted salsa events.
crates/ruff_db/src/lib.rs:181
↓ 6 callers
Method
clone
(self, checkout_dir: Path)
scripts/ty_benchmark/src/benchmark/projects.py:43
↓ 6 callers
Method
cmp
(&self, other: &Self)
crates/ty_python_semantic/src/types/constraints/paths.rs:179
↓ 6 callers
Method
cmp
(&self, other: &Self)
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:613
↓ 6 callers
Method
codes_as_str
Return the suppressed codes as strings
crates/ruff_linter/src/suppression.rs:79
↓ 6 callers
Function
command
()
crates/ruff/tests/analyze_graph.rs:15
↓ 6 callers
Method
comments_in_range
Returns the comments who are within the range
crates/ruff_python_trivia/src/comment_ranges.rs:94
↓ 6 callers
Function
completion
( db: &'db dyn Db, settings: &CompletionSettings, capabilities: CompletionCapabilities, file:
crates/ty_ide/src/completion.rs:36
↓ 6 callers
Method
compose_thunk
(self, other: F)
crates/ty_python_semantic/src/types/variance.rs:154
↓ 6 callers
Method
constructed_instance_type
(&self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:77
↓ 6 callers
Method
contents
(&self)
crates/ty_server/src/document/text_document.rs:77
↓ 6 callers
Method
context
Set the number of contextual lines to include for each snippet in diagnostic rendering.
crates/ruff_db/src/diagnostic/render.rs:2531
↓ 6 callers
Function
create_diagnostics
( filename: &str, source: &str, edit: impl IntoIterator<Item = Edit>, )
crates/ruff_linter/src/fix/mod.rs:184
↓ 6 callers
Function
create_notebook_diagnostics
Create Ruff-style diagnostics for testing the various output formats for a notebook.
crates/ruff_db/src/diagnostic/render.rs:3111
↓ 6 callers
Method
current_scope_id
(&self)
crates/ty_python_core/src/builder.rs:398
↓ 6 callers
Method
current_token_text
(&self)
crates/ruff_python_parser/src/parser/mod.rs:497
↓ 6 callers
Function
custom_enum_method
Returns the enum method defined in `scope`, including opaque bindings.
crates/ty_python_semantic/src/types/enums.rs:1504
↓ 6 callers
Function
dataclass_kind
Return the kind of dataclass this class definition is (stdlib or `attrs`), or `None` if the class is not a dataclass.
crates/ruff_linter/src/rules/ruff/helpers.rs:108
↓ 6 callers
Method
declarations_id
(self)
crates/ty_python_core/src/use_def.rs:342
↓ 6 callers
Method
dedent
(&mut self)
crates/ruff_python_parser/src/lexer/indentation.rs:121
↓ 6 callers
Method
defer_annotations
Are we currently inferring types in file with deferred types? This is true for stub files, for files with `__future__.annotations`, and by default for
crates/ty_python_semantic/src/types/infer/builder.rs:1028
↓ 6 callers
Method
definition
Returns where this type is defined. It's the foundation for the editor's "Go to type definition" feature where the user clicks on a value and it take
crates/ty_python_semantic/src/types.rs:10854
← previous
next →
2,201–2,300 of 31,562, ranked by callers