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
↓ 7 callers
Method
reachable_symbol_declarations
( &self, symbol: ScopedSymbolId, )
crates/ty_python_core/src/use_def.rs:1376
↓ 7 callers
Method
read_only
(mut self, yes: bool)
crates/ty_python_semantic/src/types/typed_dict.rs:3339
↓ 7 callers
Method
relative_to
(&self, parent: &ModuleName)
crates/ty_module_resolver/src/module_name.rs:211
↓ 7 callers
Method
remaining_literal_types
Expand this complement to the enum literals that remain possible.
crates/ty_python_semantic/src/types/enums.rs:784
↓ 7 callers
Method
resolve
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/protocol_class.rs:1406
↓ 7 callers
Function
resolve_definition
Resolve import definitions to their targets. Returns resolved definitions which can be either specific definitions or module files. For non-import def
crates/ty_python_semantic/src/types/definition_resolution.rs:592
↓ 7 callers
Method
resolve_module
Resolve the given import made in this file to a Module
crates/ty_python_semantic/src/semantic_model.rs:175
↓ 7 callers
Function
resolve_real_module_confident
Resolves a module name to a module, without desperate resolution available (stubs not allowed). This is appropriate for resolving a `KnownModule`, or
crates/ty_module_resolver/src/resolve.rs:180
↓ 7 callers
Function
resolve_root_settings
Extract the [`Settings`] from a given `pyproject.toml` and process the configuration with the given [`ConfigurationTransformer`].
crates/ruff_workspace/src/resolver.rs:426
↓ 7 callers
Method
resolve_target_version
Resolve the [`TargetVersion`] to use for linting. This method respects the per-file version overrides in [`LinterSettings::per_file_target_version`]
crates/ruff_linter/src/settings/mod.rs:879
↓ 7 callers
Method
root
(&self)
crates/ty_server/tests/e2e/main.rs:1731
↓ 7 callers
Method
run
Runs the directory traversal and calls the passed `builder` to create visitors that do the visiting. The walker may run multiple threads to visit the
crates/ruff_db/src/system/walk_directory.rs:86
↓ 7 callers
Method
save_text_document
Send a `textDocument/didSave` notification
crates/ty_server/tests/e2e/main.rs:928
↓ 7 callers
Method
scope_id
The scope in which the reference is defined.
crates/ruff_python_semantic/src/reference.rs:36
↓ 7 callers
Method
set_message
Sets the message on this annotation. If one was already set, then this overwrites it. This is useful if one needs to set the message on an annotatio
crates/ruff_db/src/diagnostic/mod.rs:843
↓ 7 callers
Method
signature_receiver
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/method.rs:79
↓ 7 callers
Method
single_element
Returns the single `CallableBinding` if this is not a union or intersection.
crates/ty_python_semantic/src/types/call/bind.rs:1501
↓ 7 callers
Method
source_file
(&self)
crates/ruff_linter/src/checkers/ast/mod.rs:3781
↓ 7 callers
Method
source_text
(&self)
crates/ruff_source_file/src/lib.rs:177
↓ 7 callers
Function
space
Return a [`ParenthesizableWhitespace`] containing a single space.
crates/ruff_linter/src/cst/helpers.rs:7
↓ 7 callers
Method
specialization
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/type_alias.rs:763
↓ 7 callers
Method
specialize_partial
Creates a specialization of this generic context. Panics if the length of `types` does not match the number of typevars in the generic context. If any
crates/ty_python_semantic/src/types/generics.rs:1177
↓ 7 callers
Method
standard_filters
Enables all the standard ignore filters. This toggles, as a group, all the filters that are enabled by default: [`hidden`](Self::ignore_hidden) Any [
crates/ruff_db/src/system/walk_directory.rs:67
↓ 7 callers
Method
sub_end
(&self, amount: TextSize)
crates/ruff_text_size/src/range.rs:449
↓ 7 callers
Function
syntax_error
()
crates/ruff_wasm/tests/api.rs:90
↓ 7 callers
Method
system
(&self)
crates/ty/tests/file_watching.rs:360
↓ 7 callers
Method
take_salsa_events
Takes the salsa events.
crates/ty_project/src/db.rs:842
↓ 7 callers
Method
take_salsa_events
Takes the salsa events.
crates/ty_module_resolver/src/db.rs:78
↓ 7 callers
Method
text
(name: string)
playground/ty/src/Playground.tsx:730
↓ 7 callers
Method
to_class_literal
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types.rs:1566
↓ 7 callers
Method
to_merged_options
Returns all option layers merged according to their precedence.
crates/ty_project/src/metadata.rs:540
↓ 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:1721
↓ 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
truncate
(&mut self, snapshot: &PathSnapshot)
crates/ty_python_semantic/src/types/constraints/paths.rs:455
↓ 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:5198
↓ 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:1312
↓ 7 callers
Method
typevar_data
(&self, typevar: TypeVarId)
crates/ty_python_semantic/src/types/constraints.rs:1535
↓ 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:7053
↓ 7 callers
Function
uv_workspace
(root: &SystemPathBuf, system: &TestSystem)
crates/ty_project/src/metadata.rs:2161
↓ 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:581
↓ 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
visit_type
(&self, db: &'db dyn Db, ty: Type<'db>)
crates/ty_python_semantic/src/types/typevar.rs:1013
↓ 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
when_false
(self)
crates/ty_python_semantic/src/types/constraints.rs:1822
↓ 7 callers
Method
with_definedness
(mut self, definedness: Definedness)
crates/ty_python_semantic/src/place.rs:170
↓ 7 callers
Function
with_escaped_paths
(f: impl FnOnce() -> R)
crates/ty_project/src/metadata.rs:2176
↓ 7 callers
Method
with_expanded_typevars_and_newtypes
Return a version of this intersection type where any type variables in the positive elements have been replaced by their bounds or constraints, and wh
crates/ty_python_semantic/src/types/set_theoretic.rs:1488
↓ 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:6092
↓ 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
↓ 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:104
↓ 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:2823
↓ 6 callers
Method
add_clause
(&mut self, provenance: ConstraintProvenance, ty: Type<'db>)
crates/ty_python_semantic/src/types/constraints.rs:1958
↓ 6 callers
Method
add_future_import
Add a `from __future__ import annotations` import.
crates/ruff_linter/src/importer/mod.rs:569
↓ 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:442
↓ 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:270
↓ 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:3619
↓ 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:2234
↓ 6 callers
Method
annotations
(&self, workspace: &Workspace)
crates/ty_wasm/src/lib.rs:913
↓ 6 callers
Method
apply_changes
( &mut self, client: &Client, path: &AnySystemPath, changes: &[ChangeEvent],
crates/ty_server/src/session.rs:548
↓ 6 callers
Method
apply_configuration_files
Loads the lower-precedence options from the user-level configuration file.
crates/ty_project/src/metadata.rs:516
↓ 6 callers
Method
apply_specialization
Apply a specialization to this class.
crates/ty_python_semantic/src/types/class.rs:1063
↓ 6 callers
Method
argument_context_type
(&self)
crates/ty_python_semantic/src/types/signatures.rs:6326
↓ 6 callers
Method
as_compare_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2199
↓ 6 callers
Method
as_import_from_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:1028
↓ 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:5305
↓ 6 callers
Method
as_paramspec_value
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:3167
↓ 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:3466
↓ 6 callers
Method
as_str
(&self)
crates/ruff_python_trivia/src/cursor.rs:45
↓ 6 callers
Method
as_str
The full debug text between the `{` and the conversion / `format_spec` / `}`.
crates/ruff_python_ast/src/nodes.rs:526
↓ 6 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_pie/rules/reimplemented_container_builtin.rs:102
↓ 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
Method
assert_package_directories
( &self, name: &str, mode: ModuleResolveMode, expected: Option
crates/ty_module_resolver/src/resolve.rs:3573
↓ 6 callers
Function
assert_section_is_structurally_ambiguous
(raw: &str)
crates/ty_ide/src/docstring/document/numpy.rs:1349
↓ 6 callers
Method
assert_work_done_progress
( &mut self, expected_title: &str, )
crates/ty_server/tests/e2e/main.rs:656
↓ 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:1195
↓ 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:272
← previous
next →
2,201–2,300 of 31,766, ranked by callers