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
↓ 2 callers
Method
annotated_lambda_parameter_type
Returns the annotated type of the lambda parameter at the given index in the provided lambda expression, based on a `Callable` type annotation, if pre
crates/ty_python_semantic/src/types/infer/builder/function.rs:1472
↓ 2 callers
Method
annotated_lines
( &self, annotations: Vec<Annotation<'a>>, fold: bool, )
crates/ruff_annotate_snippets/src/renderer/source_map.rs:171
↓ 2 callers
Method
annotation
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1363
↓ 2 callers
Method
annotation_parent_scope_id
Returns the scope enclosing the syntactic annotation containing `expression`, if any. `module` must correspond to the same file and revision as this
crates/ty_python_core/src/lib.rs:459
↓ 2 callers
Method
annotations
Returns all annotations in the order in which they were added.
crates/ruff_db/src/diagnostic/mod.rs:319
↓ 2 callers
Method
annotations_mut
Returns a mutable borrow of all annotations of this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:324
↓ 2 callers
Method
another_method
Gets the value.
crates/ruff_linter/resources/test/fixtures/pydocstyle/D421.py:102
↓ 2 callers
Method
any_enabled
(&self, rules: &[Rule])
crates/ruff_linter/src/settings/rule_table.rs:33
↓ 2 callers
Function
any_infinite_iterables
Return `true` if any expression in the iterator appears to be an infinite iterator.
crates/ruff_linter/src/rules/flake8_bugbear/helpers.rs:75
↓ 2 callers
Function
any_over_stmt
(stmt: &Stmt, mut func: F)
crates/ruff_python_ast/src/helpers.rs:533
↓ 2 callers
Function
api
(endpoint: str, *, data: dict[str, object] | None = None)
scripts/pull_request_reviewers.py:35
↓ 2 callers
Method
append
(self, x)
crates/ruff_linter/resources/test/fixtures/perflint/PERF402.py:30
↓ 2 callers
Method
applies_to
Returns whether this suppression covers either endpoint of `range`. Requiring endpoint containment, rather than any intersection, prevents a suppress
crates/ty_python_semantic/src/suppression.rs:525
↓ 2 callers
Method
applies_to_diagnostic
Returns whether the suppression's range applies to a diagnostic. `ruff: ignore` comments only need to contain the start of the diagnostic range (or i
crates/ruff_linter/src/suppression.rs:154
↓ 2 callers
Function
apply_accumulated_narrowing
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, base_ty: Type<'db>, accumulated: Option<Narr
crates/ty_python_semantic/src/reachability.rs:1032
↓ 2 callers
Method
apply_change_in_databases
( &self, session: &mut Session, client: &Client, change: ChangeEvent, )
crates/ty_server/src/session.rs:2146
↓ 2 callers
Method
apply_specialization
Applies a specialization to this type, replacing any typevars with the types that they are specialized to. Note that this does not specialize generic
crates/ty_python_semantic/src/types.rs:9795
↓ 2 callers
Method
apply_specialization
( mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, specialization: Op
crates/ty_python_semantic/src/types/protocol_class.rs:3523
↓ 2 callers
Method
apply_specialization_impl
Applies either an ordinary specialization or an enclosing-owner specialization. Both modes share the same leaf fast paths. They differ only in whethe
crates/ty_python_semantic/src/types.rs:9807
↓ 2 callers
Method
apply_specialization_impl
Compose specializations while preserving the enclosing transformation's recursion guard.
crates/ty_python_semantic/src/types/generics.rs:1428
↓ 2 callers
Function
apply_sync_result
Applies a completed synchronization to the existing [`ScriptEnvironment`] input. Stores the returned metadata or initialization error and records the
crates/ty_project/src/uv/environments.rs:736
↓ 2 callers
Method
apply_to_current_thread
(self)
crates/ty_server/src/server/schedule/thread/priority.rs:25
↓ 2 callers
Method
apply_to_current_thread
(self)
crates/ruff_server/src/server/schedule/thread/priority.rs:25
↓ 2 callers
Method
apply_type_mapping_impl
( self, db: &'db dyn Db, type_mapping: &TypeMapping<'a, 'db>, visitor: &ApplyT
crates/ty_python_semantic/src/types/typevar.rs:1421
↓ 2 callers
Method
apply_type_mapping_impl
Apply a mapping, retaining the alias's identity when its mapped body is unchanged.
crates/ty_python_semantic/src/types/type_alias.rs:779
↓ 2 callers
Method
apply_type_mapping_impl
( self, db: &'db dyn Db, type_mapping: &TypeMapping<'a, 'db>, tcx: TypeContext
crates/ty_python_semantic/src/types/class_base.rs:415
↓ 2 callers
Method
apply_type_mapping_impl
( &self, db: &'db dyn Db, builder: &ConstraintSetBuilder<'db>, type_mapping: &
crates/ty_python_semantic/src/types/constraints/variables.rs:157
↓ 2 callers
Method
arbitrary_key_initialization_type_excluding
Returns the arbitrary-key initialization type after excluding keys that are known to be shadowed. This is used while validating merged dictionary lit
crates/ty_python_semantic/src/types/typed_dict.rs:445
↓ 2 callers
Function
arbitrary_name
(g: &mut Gen)
crates/ty_python_semantic/src/types/property_tests/type_generation.rs:658
↓ 2 callers
Function
are_same_optional
Returns `true` if `right` is `Some` and `left` and `right` are referentially equal.
crates/ruff_python_ast/src/node.rs:754
↓ 2 callers
Method
as_abstract_method
Return `Some()` if this function is an abstract method. A method can be abstract if it is explicitly decorated with `@abstractmethod`, or if it is an
crates/ty_python_semantic/src/types/function.rs:1061
↓ 2 callers
Method
as_any_mut
(&mut self)
crates/ty_server/src/system.rs:288
↓ 2 callers
Method
as_constrained
(self)
crates/ty_python_semantic/src/types/constraints.rs:5002
↓ 2 callers
Method
as_constructor_mut
(&mut self)
crates/ty_python_semantic/src/types/call/bind.rs:393
↓ 2 callers
Method
as_dict_expr
(&self)
crates/ruff_python_ast/src/generated.rs:1866
↓ 2 callers
Method
as_dynamic
(self)
crates/ty_python_semantic/src/types.rs:3153
↓ 2 callers
Method
as_except_handler
(&self)
crates/ruff_python_ast/src/generated.rs:2894
↓ 2 callers
Method
as_expression_ref
(self)
crates/ruff_python_ast/src/expression.rs:117
↓ 2 callers
Method
as_i32
Return the [`Int`] as an i32, if it can be represented as that data type.
crates/ruff_python_ast/src/int.rs:125
↓ 2 callers
Method
as_i8
Return the [`Int`] as an i8, if it can be represented as that data type.
crates/ruff_python_ast/src/int.rs:109
↓ 2 callers
Method
as_if_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:769
↓ 2 callers
Method
as_instance_attribute_candidate
If the place expression has the form `<NAME>.<MEMBER>` (meaning it *may* be an instance attribute), return `Some(<MEMBER>)`. Else, return `None`. Thi
crates/ty_python_core/src/member.rs:83
↓ 2 callers
Method
as_interpolation
(&self)
crates/ruff_python_ast/src/generated.rs:2970
↓ 2 callers
Method
as_intersection
(self)
crates/ty_python_semantic/src/types.rs:2548
↓ 2 callers
Method
as_list_comp_expr
(&self)
crates/ruff_python_ast/src/generated.rs:1940
↓ 2 callers
Method
as_lsp_concept
Converts this semantic token type to its LSP string representation. Some of these are standardized terms in the LSP specification, while others are sp
crates/ty_ide/src/semantic_tokens.rs:112
↓ 2 callers
Function
as_non_finite_float_string_literal
Returns `true` if `expr` is a string literal that represents a non-finite float. E.g., `"NaN"`, "-inf", `"Infinity"`, or even `" +Inf \n \t"`. Return
crates/ruff_linter/src/linter/float.rs:14
↓ 2 callers
Function
as_only_an_ellipsis
Returns `Some(Stmt::Ellipsis)` if a function or class body contains only an ellipsis with no comments.
crates/ruff_python_formatter/src/statement/suite.rs:748
↓ 2 callers
Method
as_output
Borrow this input docstring line as an output docstring line.
crates/ruff_python_formatter/src/string/docstring.rs:620
↓ 2 callers
Function
as_pep_585_generic
Given a typing member, returns the module and member name for a generic from the Python standard library (e.g., `list` for `typing.List`), if such a g
crates/ruff_python_stdlib/src/typing.rs:362
↓ 2 callers
Method
as_ref
(&self)
crates/ruff_ranged_value/src/lib.rs:294
↓ 2 callers
Method
as_ruff_file
Returns the [`SourceFile`] attached to this [`Span`].
crates/ruff_db/src/diagnostic/mod.rs:1252
↓ 2 callers
Method
as_rule
Returns the rule if this prefix matches a single rule exactly (e.g., `E225`, as opposed to `E2`).
crates/ruff_linter/src/rule_selector.rs:202
↓ 2 callers
Method
as_rule_table
(&self, preview: PreviewMode)
crates/ruff_workspace/src/configuration.rs:862
↓ 2 callers
Method
as_single_part_bytestring
Return `Some(literal)` if the bytestring only consists of a single `BytesLiteral` part (indicating that it is not implicitly concatenated). Otherwise,
crates/ruff_python_ast/src/nodes.rs:2008
↓ 2 callers
Method
as_single_upper_bound
Returns one effective upper bound without expanding factored intersections.
crates/ty_python_semantic/src/types/constraints.rs:3495
↓ 2 callers
Method
as_str
(&'a self)
crates/ruff_annotate_snippets/src/level.rs:131
↓ 2 callers
Method
as_str
(&self)
crates/ty_module_resolver/src/module_name.rs:230
↓ 2 callers
Method
as_str
Returns the string representation of the indent style.
crates/ruff_formatter/src/lib.rs:86
↓ 2 callers
Method
as_str
(&self)
crates/ruff_formatter/src/printer/printer_options/mod.rs:135
↓ 2 callers
Method
as_str
(&self)
crates/ruff_linter/src/settings/types.rs:691
↓ 2 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:483
↓ 2 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:373
↓ 2 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_literal_set.rs:146
↓ 2 callers
Function
as_substr
Given an original string like `AACC`, and a suggestion like `AABBCC`, try to detect the case where a substring of the suggestion is "sandwiched" in th
crates/ruff_annotate_snippets/src/renderer/source_map.rs:813
↓ 2 callers
Method
as_text
(&self)
crates/ty_server/src/session/index.rs:273
↓ 2 callers
Method
as_text_mut
(&mut self)
crates/ty_server/src/session/index.rs:280
↓ 2 callers
Method
as_u128
(self)
crates/ruff_db/src/file_revision.rs:26
↓ 2 callers
Method
as_u32
Returns the index as a `u32`. or `None` for `NodeIndex::NONE`.
crates/ruff_python_ast/src/node_index.rs:72
↓ 2 callers
Method
as_unannotated_assignment
(&self)
crates/ty_python_core/src/definition.rs:1000
↓ 2 callers
Function
ascii_identifier_prefix_len
Returns the number of leading ASCII identifier-continuation bytes. A table lookup classifies each byte without decoding UTF-8. Fixed-size batches giv
crates/ruff_python_parser/src/lexer.rs:1582
↓ 2 callers
Method
assert_all_formatted
(&self, _source_code: SourceCode)
crates/ruff_python_formatter/src/comments/mod.rs:379
↓ 2 callers
Function
assert_code_action_resolve_unchanged
(server: &mut crate::TestServer, action: &CodeAction)
crates/ruff_server/tests/e2e/code_action.rs:10
↓ 2 callers
Function
assert_conda_precedence
( system: &TestSystem, prefix: &SystemPath, python: &str, )
crates/ty_site_packages/src/lib.rs:2410
↓ 2 callers
Function
assert_const_function_query_was_not_run
( db: &Db, query: Q, events: &[salsa::Event], )
crates/ruff_db/src/testing.rs:29
↓ 2 callers
Function
assert_diagnostics
(db: &dyn Db, diagnostics: &[Diagnostic], expected: &[KeyDiagnosticFields])
crates/ruff_benchmark/benches/ty.rs:189
↓ 2 callers
Function
assert_excludes
(set: &ModuleGlobSet, name: &str)
crates/ty_module_resolver/src/module_glob.rs:372
↓ 2 callers
Function
assert_params
( db: &'db dyn Db, signature: &Signature<'db>, expected: &[Parameter<'db>], )
crates/ty_python_semantic/src/types/signatures.rs:6663
↓ 2 callers
Function
assert_python_version
(workspace: &Workspace, file: &ty_wasm::FileHandle, minor: u8)
crates/ty_wasm/tests/api.rs:191
↓ 2 callers
Function
assert_rules_safety
( table: &FixSafetyTable, assertions: &[(&str, Applicability, Applicability)], )
crates/ruff_linter/src/settings/fix_safety_table.rs:182
↓ 2 callers
Method
assert_syntax_error_counts_do_not_increase
(&mut self, source: &str)
crates/ty_ide/src/inlay_hints.rs:1348
↓ 2 callers
Function
assign_argument_separator_comment_placement
Locates positional only parameters separator `/` or the keywords only parameters separator `*` comments. ```python def test( a, # Positional only par
crates/ruff_python_formatter/src/other/parameters.rs:549
↓ 2 callers
Method
assignable_solutions_for_argument_context
Calculates the [`CandidateSolutions`] that represent the valid solutions for when `self` is constraint-set assignable to `target`. Unlike [`Self::ass
crates/ty_python_semantic/src/types/constraints.rs:3633
↓ 2 callers
Function
assignable_solutions_impl
( db: &'db dyn Db, program: Program<'db>, source: Type<'db>, target: Type<'db>, inferable:
crates/ty_python_semantic/src/types/constraints.rs:3656
↓ 2 callers
Method
assignment
(&self)
crates/ty_python_core/src/definition.rs:1550
↓ 2 callers
Function
assignment_declaration_annotation
Locate the annotation that uniquely declares an assignment target's type.
crates/ty_python_semantic/src/types/diagnostic.rs:2046
↓ 2 callers
Function
assignment_diagnostic_range
Return the range of an assignment's value, including any surrounding parentheses.
crates/ty_python_semantic/src/types/diagnostic.rs:2170
↓ 2 callers
Function
assignment_display_settings
( context: &InferContext<'db, '_>, target_type: Type<'db>, value_type: Type<'db>, starred_elem
crates/ty_python_semantic/src/types/diagnostic.rs:2204
↓ 2 callers
Method
assignment_index
(&self, assignment: Assignment<AtomicConstraintId>)
crates/ty_python_semantic/src/types/constraints/paths.rs:571
↓ 2 callers
Function
assignment_targets_from_with_items
( items: &'a [WithItem], dummy_variable_rgx: &'a Regex, )
crates/ruff_linter/src/rules/pylint/rules/redefined_loop_name.rs:346
↓ 2 callers
Function
assignment_value_node
Return the expression assigned by an ordinary or named assignment.
crates/ty_python_semantic/src/types/diagnostic.rs:2121
↓ 2 callers
Function
assignment_values_for_target
( unpack_target: &ast::Expr, value: &'ast ast::Expr, requested_target: &ast::Expr, )
crates/ty_python_semantic/src/types/unpacker.rs:497
↓ 2 callers
Method
assume
Add an assignment and propagate its consequences. On conflict, the caller must discard the path or roll back the edge before adding another assignment
crates/ty_python_semantic/src/types/constraints/paths.rs:425
↓ 2 callers
Function
async_gen
()
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C419.py:65
↓ 2 callers
Function
asyncio_dangling_task
RUF006
crates/ruff_linter/src/rules/ruff/rules/asyncio_dangling_task.rs:86
↓ 2 callers
Method
at
Returns the closest root for `path` or `None` if no root contains `path`.
crates/ruff_db/src/files/file_root.rs:100
↓ 2 callers
Function
at_last_top_level_expression_in_cell
Return `true` if the statement containing the current expression is the last top-level expression in the cell. This assumes that the source is a Jupyt
crates/ruff_linter/src/rules/flake8_bugbear/helpers.rs:12
↓ 2 callers
Function
attempt_test
Run a function over an embedded test file, catching any panics that occur in the process. If no panic occurs, the result of the function is returned
crates/mdtest/src/lib.rs:593
↓ 2 callers
Function
attribute_expr
(value: Expr, attribute: &str)
crates/ruff_python_ast/src/name.rs:941
↓ 2 callers
Method
attribute_name_could_match
(&self, name: &str)
crates/ty_ide/src/call_hierarchy/incoming_calls.rs:278
← previous
next →
5,001–5,100 of 31,766, ranked by callers