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
default_type
Infer the default-value type only when its value is needed, such as for display or a dataclass field specifier. Callable compatibility only needs [`Se
crates/ty_python_semantic/src/types/signatures.rs:6395
↓ 2 callers
Method
default_type_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, visitor: &TypeVarDefau
crates/ty_python_semantic/src/types/typevar.rs:420
↓ 2 callers
Method
defer_decorator_call
(&mut self, decorator: &ast::Decorator, input_ty: Type<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:5922
↓ 2 callers
Method
deferred_decorator_input_type
( &self, expression: impl Into<ExpressionNodeKey>, )
crates/ty_python_semantic/src/types/infer.rs:1914
↓ 2 callers
Method
definition
(self)
crates/ty_python_core/src/use_def/place_state.rs:122
↓ 2 callers
Method
definition
(self)
crates/ty_python_semantic/src/place.rs:126
↓ 2 callers
Function
definition_for_name
Get the primary definition kind for a name expression within a specific file. Returns the first definition kind that is reachable for this name in its
crates/ty_python_semantic/src/types/ide_support.rs:65
↓ 2 callers
Function
definitions_for_bin_op
Returns the definitions of the binary operation along with its callable type.
crates/ty_python_semantic/src/types/ide_support.rs:1420
↓ 2 callers
Function
definitions_for_builtin
Resolves a symbol in an implicit builtins scope.
crates/ty_python_semantic/src/types/definition_resolution.rs:294
↓ 2 callers
Function
definitions_for_imported_symbol
Find the definitions for a symbol imported via `from x import y as z` statement. This function handles the case where the cursor is on the original sy
crates/ty_python_semantic/src/types/ide_support.rs:910
↓ 2 callers
Function
definitions_for_unary_op
Returns the definitions for an unary operator along with their callable types.
crates/ty_python_semantic/src/types/ide_support.rs:1448
↓ 2 callers
Method
definitions_reaching
(&self, target: Definition<'db>)
crates/ty_python_semantic/src/types/cyclic.rs:551
↓ 2 callers
Method
definitions_with_usage
Definitions relevant to usage analysis, including standalone declarations. The early declaration part of a combined definition is omitted: its later
crates/ty_python_core/src/use_def.rs:1079
↓ 2 callers
Method
delete_binding
(&mut self, place: ScopedPlaceId)
crates/ty_python_core/src/builder.rs:1560
↓ 2 callers
Function
dependencies
()
crates/ruff/tests/analyze_graph.rs:30
↓ 2 callers
Method
dependencies
(&self)
crates/ty_test/src/config.rs:81
↓ 2 callers
Method
dependencies
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/variance/equations.rs:221
↓ 2 callers
Method
dependency_metadata
( self, db: &dyn Db, )
crates/ty_project/src/lib.rs:286
↓ 2 callers
Method
dependency_metadata
( &self, )
crates/ty_project/src/uv/metadata/dependencies.rs:17
↓ 2 callers
Method
dependency_metadata
(&self, _file: File)
crates/ty_python_semantic/src/db.rs:203
↓ 2 callers
Function
depends_arguments
(expr: &'a Expr, semantic: &SemanticModel)
crates/ruff_linter/src/rules/fastapi/rules/fastapi_unused_path_parameter.rs:420
↓ 2 callers
Method
depends_on_type_parameters
Variance accounts for aliases without expanding recursive specializations and ignores parameters used only in bivariant positions, such as unused type
crates/ty_python_semantic/src/types.rs:5943
↓ 2 callers
Method
deprecated
(since: &'static str, reason: &'static str)
crates/ty_python_semantic/src/lint.rs:214
↓ 2 callers
Method
deprecated_decorator_functions
Return deprecations that need to be reported when applying a decorator. Direct function implementations are checked at references, while overloads and
crates/ty_python_semantic/src/types/call/bind.rs:1032
↓ 2 callers
Method
deprecated_functions
A method can be deprecated even when it is missing on some union members or its signature rejects the implicit call.
crates/ty_python_semantic/src/types/call.rs:492
↓ 2 callers
Method
descendants
(&self)
crates/ty_python_core/src/scope.rs:166
↓ 2 callers
Method
descendent_scopes
Returns an iterator over the descendent scopes of `scope`.
crates/ty_python_core/src/lib.rs:652
↓ 2 callers
Function
descriptor_setter
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, descriptor_ty: Type<'db>, )
crates/ty_python_semantic/src/types/attribute_write.rs:1278
↓ 2 callers
Method
descriptor_type
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:1097
↓ 2 callers
Method
descriptor_write_alternatives
Yield each possible descriptor type so writes can be checked one alternative at a time. For example, if an attribute has type `IntDescriptor | StrDes
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:859
↓ 2 callers
Function
detect_blind_exception
( semantic: &ruff_python_semantic::SemanticModel<'_>, func: &Expr, arguments: &Arguments, )
crates/ruff_linter/src/rules/flake8_bugbear/rules/assert_raises_exception.rs:61
↓ 2 callers
Function
determine_self_class
Walk the MRO of this class and return the last class just before the specified known base. This determines the owner and upper bound of `Self` on synt
crates/ty_python_semantic/src/types.rs:13150
↓ 2 callers
Method
diagnose_single_length_tuple
( &self, length: TupleLength, node: &ast::Expr, node_type: Type<'db>,
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1001
↓ 2 callers
Function
diagnostic_signature
Create a signature for a diagnostic based on file, code, and message (ignoring position).
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:447
↓ 2 callers
Function
diagnostic_touches_vendored_file
(db: &dyn Db, diagnostic: &Diagnostic)
crates/ty_ide/src/lib.rs:478
↓ 2 callers
Method
diagnostics
(&self)
crates/ty_project/src/lib.rs:1081
↓ 2 callers
Method
diagnostics
(&self)
crates/ty_python_semantic/src/types/diagnostic.rs:1764
↓ 2 callers
Function
dict_items
( call_expr: &'a Expr, tuple_expr: &'a Expr, )
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs:114
↓ 2 callers
Method
dict_value_type
Returns the value type if this `TypedDict` is a subtype of `dict[str, VT]`. This requires mutable explicit extra items and optional, mutable declared
crates/ty_python_semantic/src/types/typed_dict.rs:507
↓ 2 callers
Method
dict_value_type_if
Like [`Self::dict_value_type`], but uses the caller's equivalence or mutual-assignability check so recursive comparisons can share their cycle guards.
crates/ty_python_semantic/src/types/typed_dict.rs:519
↓ 2 callers
Function
did_you_mean
Suggest a name from `existing_names` that is similar to `wrong_name`.
crates/ty_python_semantic/src/diagnostic/mod.rs:16
↓ 2 callers
Method
diff
(&self)
crates/ruff_annotate_snippets/src/renderer/mod.rs:336
↓ 2 callers
Function
diff_diagnostics
Return diagnostics in `new` that aren't in `old`.
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:463
↓ 2 callers
Method
differs_for_members_required_by
Compare the original and materialized forms of members required by `required`. An unrelated materialized member must not prevent a protocol from reta
crates/ty_python_semantic/src/types/protocol_class.rs:564
↓ 2 callers
Method
digest
(self)
crates/ruff_linter/resources/test/fixtures/refurb/FURB181.py:53
↓ 2 callers
Function
directory_watcher
Creates a new watcher observing file system changes. The watcher debounces events, but guarantees to send all changes eventually (even if the file sy
crates/ty_project/src/watch/watcher.rs:16
↓ 2 callers
Method
disable
Disables `lint` if it was previously enabled.
crates/ty_python_semantic/src/lint.rs:675
↓ 2 callers
Method
disable
(&mut self, rule: Rule)
crates/ruff_linter/src/settings/rule_table.rs:73
↓ 2 callers
Function
disable_io_rules
Disables IO based rules because they are a source of flakiness
crates/ruff_benchmark/benches/linter.rs:115
↓ 2 callers
Method
disallow_signature_name
(&self)
crates/ty_python_semantic/src/types/display.rs:215
↓ 2 callers
Method
discard_dict_key_assignments_for
(&mut self, definition: Definition<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:610
↓ 2 callers
Method
discards_dict_key_assignments
(&self)
crates/ty_python_semantic/src/types/infer.rs:1893
↓ 2 callers
Method
disjointness_error_context
Re-run a successful disjointness check with diagnostic context collection enabled.
crates/ty_python_semantic/src/types/relation.rs:1145
↓ 2 callers
Method
dispatch
Dispatches a `task` by either running it as a blocking function or executing it on a background thread pool.
crates/ty_server/src/server/schedule.rs:50
↓ 2 callers
Function
dispatch_request
Dispatches a new request or retries one interrupted by Salsa. Synchronous requests such as `shutdown` run directly on the main loop. Background reque
crates/ty_server/src/server/main_loop.rs:231
↓ 2 callers
Method
display
( &'env self, db: &'db dyn Db, env: &'env ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/call/arguments.rs:867
↓ 2 callers
Method
display_contents
(self, contents: &str)
crates/ruff_python_ast/src/nodes.rs:1047
↓ 2 callers
Method
display_minimum
(self)
crates/ty_python_semantic/src/types/tuple.rs:107
↓ 2 callers
Method
display_short
Renders the specialization as it would appear in a subscript expression, e.g. `[int, str]`.
crates/ty_python_semantic/src/types/display.rs:2354
↓ 2 callers
Method
do_bump
Bumps the token source to the next non-trivia token without adding the current token to the token vector. It does add the trivia tokens to the token v
crates/ruff_python_parser/src/token_source.rs:173
↓ 2 callers
Function
do_nothing
(a)
crates/ruff_linter/resources/test/fixtures/ruff/RUF027_1.py:1
↓ 2 callers
Method
do_thing
(self)
crates/ruff_linter/resources/test/fixtures/pyflakes/F841_0.py:140
↓ 2 callers
Method
docstring
Returns a non-None value only if the formatter is running on a code snippet within a docstring. The quote character returned corresponds to the quoti
crates/ruff_python_formatter/src/context.rs:98
↓ 2 callers
Method
docstring
(mut self, docs: impl Into<Option<Docstring>>)
crates/ty_ide/src/completion.rs:633
↓ 2 callers
Method
docstring
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/definition_resolution.rs:99
↓ 2 callers
Method
docstring_code
(&self)
crates/ruff_python_formatter/src/options.rs:143
↓ 2 callers
Method
docstring_code_line_width
(&self)
crates/ruff_python_formatter/src/options.rs:147
↓ 2 callers
Function
docstring_for_parameter_field
A parameter written in a `def` gets its documentation from the function docstring. A generated dataclass constructor has no `def __init__` to read. In
crates/ty_ide/src/goto.rs:512
↓ 2 callers
Function
docstring_from
Extract a docstring from a function or class body.
crates/ruff_linter/src/docstrings/extraction.rs:7
↓ 2 callers
Function
docstring_from_body
Extract a docstring from a function, module, or class body.
crates/ty_python_core/src/definition.rs:229
↓ 2 callers
Method
document_controller_for_key
( &mut self, key: &DocumentKey, )
crates/ruff_server/src/session/index.rs:344
↓ 2 callers
Method
document_mut
( &mut self, key: &DocumentKey, )
crates/ty_server/src/session/index.rs:218
↓ 2 callers
Method
documentation_lines
Returns the documentation line by line with Rust doc-comment prefixes and trailing whitespace removed.
crates/ty_python_semantic/src/lint.rs:104
↓ 2 callers
Method
domain
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:1090
↓ 2 callers
Method
dominates
Returns `true` if any execution path to `node` passes through `dominator`. More precisely, it returns true if the path of branches leading to `domina
crates/ruff_python_semantic/src/model.rs:1960
↓ 2 callers
Function
downloadZip
( files: { [name: string]: string }, prefix = "playground", )
playground/shared/src/downloadZip.ts:7
↓ 2 callers
Function
download_artifact
( artifact: dict[str, Any], *, max_bytes: int = MAX_ARCHIVE_BYTES )
scripts/publish_pr_report.py:152
↓ 2 callers
Method
drain_queue
(&mut self)
crates/ty_python_semantic/src/place.rs:2077
↓ 2 callers
Method
drain_snapshot
(&mut self, mut snapshot: ScratchSnapshot)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:64
↓ 2 callers
Function
draw_line
( renderer: &Renderer, buffer: &mut StyledBuffer, source_string: &str, line_index: usize,
crates/ruff_annotate_snippets/src/renderer/render.rs:2043
↓ 2 callers
Method
dynamic_descriptor_type
Returns the descriptor result type for directly dynamic values and gradual class-object values.
crates/ty_python_semantic/src/types.rs:5169
↓ 2 callers
Function
dynamic_resolution_paths
( db: &'db dyn Db, mode: ModuleResolveModeIngredient<'db>, )
crates/ty_module_resolver/src/resolve.rs:1134
↓ 2 callers
Function
e
()
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B012.py:36
↓ 2 callers
Method
eat_back_while
(&mut self, mut predicate: impl FnMut(char) -> bool)
crates/ruff_python_trivia/src/cursor.rs:173
↓ 2 callers
Method
eat_char2
(&mut self, c1: char, c2: char)
crates/ruff_python_trivia/src/cursor.rs:116
↓ 2 callers
Method
eat_char_back
(&mut self, c: char)
crates/ruff_python_trivia/src/cursor.rs:142
↓ 2 callers
Method
eat_while
(&mut self, mut predicate: impl FnMut(char) -> bool)
crates/ruff_python_parser/src/lexer/cursor.rs:149
↓ 2 callers
Function
eat_whitespace
(cursor: &mut Cursor)
crates/ruff_linter/src/rules/airflow/rules/xcom_pull_in_template_string.rs:241
↓ 2 callers
Method
edit_is_omitted
(&self)
crates/ty_ide/src/will_rename.rs:1109
↓ 2 callers
Function
edit_to_text_edit
(workspace: &Workspace, file: File, edit: &Edit)
crates/ty_wasm/src/lib.rs:1069
↓ 2 callers
Function
effective_superclass_variable_kind
( db: &'db dyn Db, superclass: ClassType<'db>, name: Name, )
crates/ty_python_semantic/src/types/overrides.rs:1701
↓ 2 callers
Method
effective_variance
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/variance/equations.rs:180
↓ 2 callers
Function
effective_write_type
Return the accepted type for writes to a declared attribute. A dataclass field with a converter accepts the converter's input type, not the field's p
crates/ty_python_semantic/src/types/attribute_write.rs:1083
↓ 2 callers
Method
element_truthiness
( &mut self, left: Type<'db>, right: Type<'db>, )
crates/ty_python_semantic/src/types/equality.rs:322
↓ 2 callers
Function
elements_of
Return the type whose iterated elements may satisfy membership for `ty`.
crates/ty_python_semantic/src/types/narrow/containment.rs:142
↓ 2 callers
Function
elif_else_range
Return the `Range` of the first `Elif` or `Else` token in an `If` statement.
crates/ruff_python_ast/src/stmt_if.rs:9
↓ 2 callers
Function
else_
Return the [`TextRange`] of the `else` token in a `For` or `While` statement.
crates/ruff_python_ast/src/identifier.rs:114
↓ 2 callers
Method
embedded_start_offset
(&self)
crates/mdtest/src/parser.rs:451
↓ 2 callers
Function
empty
()
crates/ruff_python_formatter/src/comments/map.rs:669
↓ 2 callers
Function
empty_lines_after_leading_comments
Format the empty lines between a node and its leading comments. For example, given: ```python # comment class Class: ... ``` While `leading_comment
crates/ruff_python_formatter/src/comments/format.rs:596
← previous
next →
5,401–5,500 of 31,766, ranked by callers