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
declared
Constructor that creates a [`Place`] with type origin [`TypeOrigin::Declared`] and definedness [`Definedness::AlwaysDefined`].
crates/ty_python_semantic/src/place.rs:245
↓ 3 callers
Method
declared
(declared_type: Option<Type<'db>>)
crates/ty_python_semantic/src/types/infer/type_context.rs:60
↓ 3 callers
Method
default
()
crates/ty_python_semantic/src/types/infer/builder.rs:13396
↓ 3 callers
Method
default
()
crates/ruff_linter/src/rules/flake8_pytest_style/settings.rs:47
↓ 3 callers
Function
default_banned_aliases
(preview: PreviewMode)
crates/ruff_linter/src/rules/flake8_import_conventions/settings.rs:92
↓ 3 callers
Function
default_function
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF009.py:10
↓ 3 callers
Method
default_level
(&self)
crates/ty_python_semantic/src/lint.rs:130
↓ 3 callers
Method
defers_annotations
(self)
crates/ruff_python_ast/src/python_version.rs:94
↓ 3 callers
Function
definite_match_pattern_type_for_subject
Return the values that are statically guaranteed to match `kind`, using `subject_ty` when the answer depends on the subject. This is an under-approxi
crates/ty_python_semantic/src/types/match_pattern.rs:712
↓ 3 callers
Function
definite_match_pattern_type_for_subject_cached
Reuse definite-match types when different union arms reach the same nested pattern and type. ```python from __future__ import annotations from typing
crates/ty_python_semantic/src/types/match_pattern.rs:747
↓ 3 callers
Method
definition
The defining symbol of this constructor, including for qualified references.
crates/ty_python_semantic/src/types/recursive.rs:296
↓ 3 callers
Function
definition_expression_type_in_scope
Infer a definition's expression using an explicitly supplied evaluation scope. [`definition_expression_type`] can look up the scope of a string liter
crates/ty_python_semantic/src/types.rs:423
↓ 3 callers
Function
definitions_for_attribute
Returns definitions for an attribute expression, inferring its receiver through the IDE model.
crates/ty_python_semantic/src/types/ide_support.rs:143
↓ 3 callers
Function
definitions_for_expression
Shared helper to get definitions for an expr (that is presumably a name/attr)
crates/ty_ide/src/goto.rs:1402
↓ 3 callers
Method
definitions_for_module_global
Returns the definitions that may supply a module global at the end of its scope. Returns `None` if the module has no file or the name has no symbol-t
crates/ty_python_semantic/src/semantic_model.rs:506
↓ 3 callers
Method
defuse
(&mut self)
crates/ty_python_semantic/src/types/context.rs:414
↓ 3 callers
Method
describe
Format the recorded failure as Markdown. For a timeout, include the cutoff and any recorded baseline duration.
python/py-fuzzer/fuzz.py:260
↓ 3 callers
Function
desperately_resolve_module
( db: &'db dyn Db, importing_file: File, module_name: ModuleNameIngredient<'db>, )
crates/ty_module_resolver/src/resolve.rs:289
↓ 3 callers
Function
discover_roots
Finds candidates for the root component of a module name (i.e. `foo` from `foo.bar.baz`) across the supplied search paths and stub packages. Callers
crates/ty_module_resolver/src/resolve/search.rs:1073
↓ 3 callers
Method
display
(&self)
crates/ty_ide/src/inlay_hints.rs:268
↓ 3 callers
Method
display_name
Display name of the parameter, if it has one.
crates/ty_python_semantic/src/types/signatures.rs:6466
↓ 3 callers
Method
docstring
Get the docstring for this definition Typically documentation only appears on implementations and not stubs, so this will check both the goto-declara
crates/ty_ide/src/goto.rs:441
↓ 3 callers
Function
docstring_for_call_definition
Resolve the docstring for a call-signature's resolved definition. Tries the definition's own docstring first (stub-mapped when appropriate) and falls
crates/ty_ide/src/goto.rs:498
↓ 3 callers
Method
document
Returns the document targeted by this snapshot.
crates/ty_server/src/session.rs:1568
↓ 3 callers
Method
document
(&self, path: AnySystemPath)
crates/ty_server/src/system.rs:123
↓ 3 callers
Function
document_highlights
Find all document highlights for a symbol at the given position. Document highlights are limited to the current file only.
crates/ty_ide/src/doc_highlights.rs:10
↓ 3 callers
Method
documentation
(&self)
crates/ruff_options_metadata/src/lib.rs:120
↓ 3 callers
Method
documentation
Returns the documentation as a single string.
crates/ty_python_semantic/src/lint.rs:122
↓ 3 callers
Function
draw_col_separator_end
(renderer: &Renderer, buffer: &mut StyledBuffer, line: usize, col: usize)
crates/ruff_annotate_snippets/src/renderer/render.rs:2249
↓ 3 callers
Function
draw_col_separator_no_space_with_style
( buffer: &mut StyledBuffer, chr: char, line: usize, col: usize, style: ElementStyle, )
crates/ruff_annotate_snippets/src/renderer/render.rs:2279
↓ 3 callers
Method
dunder
(self)
crates/ty_python_semantic/src/types/equality.rs:1831
↓ 3 callers
Function
dynamic_content_impl
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>, mode: DynamicContentMode, )
crates/ty_python_semantic/src/types/visitor.rs:501
↓ 3 callers
Method
eat_whitespace
(&mut self)
crates/ty_python_semantic/src/suppression/parser.rs:128
↓ 3 callers
Method
eat_whitespace
(&mut self)
crates/ruff_linter/src/suppression.rs:1354
↓ 3 callers
Method
elements
(&self)
crates/ruff_formatter/src/buffer.rs:143
↓ 3 callers
Method
else_body
Returns the `else` suite. Defaults to an empty suite if the statement has no `else` block.
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:267
↓ 3 callers
Method
enable_diagnostic_related_information
(mut self, enabled: bool)
crates/ty_server/tests/e2e/main.rs:1519
↓ 3 callers
Method
enable_multiline_token_support
(mut self, enabled: bool)
crates/ty_server/tests/e2e/main.rs:1530
↓ 3 callers
Method
enabled_or
Resolve this value to a boolean, using `default` when it is unspecified. An unknown value resolves to `true`.
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:557
↓ 3 callers
Function
end_of_scope_definition
Returns the sole definition bound to a module symbol at the end of its scope.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1568
↓ 3 callers
Method
enter_string
Entering another interpolated string increases the nesting depth.
crates/ruff_python_formatter/src/context.rs:176
↓ 3 callers
Method
entry_is_directory
Returns whether `name` resolves to a directory, following symbolic links.
crates/ruff_db/src/files/directory.rs:43
↓ 3 callers
Function
enum_class_key_profile
( db: &'db dyn Db, enum_class: EnumClassLiteral<'db>, operator: ComparisonOperator, )
crates/ty_python_semantic/src/types/equality/enums.rs:1121
↓ 3 callers
Function
enum_literal_value
Return the statically known runtime value of an enum member. Custom enum construction can replace the declared value, so members of such enums return
crates/ty_python_semantic/src/types/equality.rs:2229
↓ 3 callers
Method
eq
(&self, other: &InnerBindingKind)
crates/ruff_linter/src/rules/pylint/rules/redefined_loop_name.rs:131
↓ 3 callers
Method
equation
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/variance/equations.rs:192
↓ 3 callers
Function
equivalent
Return `true` if the format string is equivalent to the constant type
crates/ruff_linter/src/rules/pylint/rules/bad_string_format_type.rs:121
↓ 3 callers
Method
error
(self)
crates/ruff_python_parser/src/error.rs:53
↓ 3 callers
Method
evaluate
Return `None` when the expression cannot finish evaluating, even if its inferred type is inhabited, as in `bool(never)`. This lets required operands p
crates/ty_python_semantic/src/types/infer/expression_truthiness.rs:87
↓ 3 callers
Method
evaluate
Validate the assignment and optionally record its accessor deprecations. After validation short-circuits, a pure collector inspects the remaining alte
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:275
↓ 3 callers
Method
evaluate_constraint_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/narrow.rs:799
↓ 3 callers
Method
evaluate_match_pattern_for_subject_element
( &mut self, subject_expression: Expression<'db>, subject: &ast::Expr, pattern
crates/ty_python_semantic/src/types/narrow.rs:4957
↓ 3 callers
Function
evaluate_reachability_path
Evaluate a reachability decision diagram, reusing checkpoints for previously evaluated suffixes. An inhabited predicate selects its true, false, or a
crates/ty_python_semantic/src/reachability.rs:878
↓ 3 callers
Method
evidence_satisfies_declared_constraint
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constra
crates/ty_python_semantic/src/types/constraints/solutions.rs:899
↓ 3 callers
Function
exact_sequence_pattern_type
Build the structural type used for a fixed-length sequence pattern. For a pattern like: ```python match value: case [int(), str()]: ... ``` this re
crates/ty_python_semantic/src/types/match_pattern.rs:240
↓ 3 callers
Function
exact_with_provenance
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, provenance: ConstraintProvenance, t
crates/ty_python_semantic/src/types/constraints/projection/tests.rs:48
↓ 3 callers
Method
execute
( &self, executor: &dyn CommandExecutor, target: &MetadataTarget<'_>, )
crates/ty_project/src/uv/command.rs:47
↓ 3 callers
Method
existing_entry
(&self, file: File)
crates/ty_project/src/uv/environments.rs:497
↓ 3 callers
Function
exists
()
crates/ruff_db/src/system/memory_fs.rs:774
↓ 3 callers
Method
expand_starred_variadic_annotations
Expands an unpacked `*args` annotation into its logical callable parameters. Preserve the original `*args` definition and source position on every ex
crates/ty_python_semantic/src/types/signatures.rs:5861
↓ 3 callers
Function
expand_tabs
Expands tabs to the next eight-column tab stop, matching Python's `str.expandtabs`.
crates/ruff_python_trivia/src/whitespace.rs:7
↓ 3 callers
Method
expect_class_literal
(self)
crates/ty_python_semantic/src/types.rs:3202
↓ 3 callers
Method
expect_function_literal
(self)
crates/ty_python_semantic/src/types.rs:3307
↓ 3 callers
Method
expect_type_alias
(&self)
crates/ty_python_core/src/scope.rs:444
↓ 3 callers
Method
exported_symbols
Returns the [`FlatSymbols`] for `test.py`.
crates/ty_ide/src/symbols.rs:3296
↓ 3 callers
Function
expr_name_to_type_var
( semantic: &'a SemanticModel, name: &'a ExprName, )
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:295
↓ 3 callers
Method
expr_ref_in_ast
Get a "safe" [`ExprRef`] to use for referring to the given (sub-)expression. If we're analyzing a string annotation, it will return the string litera
crates/ty_python_semantic/src/semantic_model.rs:579
↓ 3 callers
Method
expression
(self)
crates/ruff_python_formatter/src/expression/mod.rs:826
↓ 3 callers
Method
expression_type
(&self, expr_id: impl Into<ExpressionNodeKey>)
crates/ty_python_semantic/src/types/unpacker.rs:387
↓ 3 callers
Method
expressions
Returns an [`Iterator`] over the expressions, starting from the given [`NodeId`]. through to any parents.
crates/ruff_python_semantic/src/model.rs:1663
↓ 3 callers
Method
extend
(&mut self, iter: I)
crates/ruff_db/src/system/path.rs:734
↓ 3 callers
Method
extend_expression
(&mut self, inference: &ExpressionInference<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:768
↓ 3 callers
Method
extend_expression_without_bindings
Merges expression results without claiming bindings owned by their enclosing statement.
crates/ty_python_semantic/src/types/infer/builder.rs:802
↓ 3 callers
Method
extend_scope
(&mut self, inference: &ScopeInference<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:887
↓ 3 callers
Function
extract_handled_exceptions
Extract the names of all handled exceptions.
crates/ruff_python_ast/src/helpers.rs:867
↓ 3 callers
Function
extract_unpacked_typed_dict_keys_from_kwargs_annotation
Extracts unpacked `TypedDict` keys for a `**kwargs` annotation only when the annotation explicitly uses `Unpack[...]`. Per [PEP 692](https://peps.pyt
crates/ty_python_semantic/src/types/typed_dict.rs:2135
↓ 3 callers
Method
field_specifiers
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class.rs:313
↓ 3 callers
Method
field_specifiers
( db: &'db dyn Db, index: &'db SemanticIndex<'db>, scope: ScopeId<'db>,
crates/ty_python_semantic/src/types/infer/builder.rs:983
↓ 3 callers
Method
file
Returns the file to which this module belongs.
crates/ruff_db/src/parsed.rs:188
↓ 3 callers
Method
file
The file for which the types are inferred.
crates/ty_python_semantic/src/types/context.rs:195
↓ 3 callers
Method
file_path
Get the path for the document selected by this query. Returns `None` if this is an unsaved (untitled) document. The path isn't guaranteed to point t
crates/ruff_server/src/session/index.rs:635
↓ 3 callers
Function
file_settings
(db: &dyn SemanticDb, file: File)
crates/ty_test/src/db.rs:215
↓ 3 callers
Method
file_type
Returns the type of the entry named `name`, if present.
crates/ruff_db/src/files/directory.rs:16
↓ 3 callers
Method
file_type
Return the file type for the file that this entry points to.
crates/ruff_db/src/system/walk_directory.rs:183
↓ 3 callers
Method
files
(&self)
crates/ty_project/src/db.rs:684
↓ 3 callers
Function
filter_generic_narrowing_constraint
Preserve known generic arguments when narrowing a specialized base to one of its subclasses. For example, filtering `Sequence[int]` with `list[Unknow
crates/ty_python_semantic/src/types/narrow.rs:823
↓ 3 callers
Method
filter_tuple_subscript
Retain tuple union members whose indexed element can satisfy a predicate.
crates/ty_python_semantic/src/types/narrow.rs:5398
↓ 3 callers
Method
finalize
Finalize the lookup result by handling dynamic type intersection.
crates/ty_python_semantic/src/types/class.rs:3289
↓ 3 callers
Method
find
Look for the best matching token pattern at the given offset.
crates/ty_ide/src/completion.rs:2489
↓ 3 callers
Function
find_any_ignore_ascii_case
(expr: &ast::Expr, patterns: &[&'static str])
crates/ruff_linter/src/linter/float.rs:38
↓ 3 callers
Function
find_goto_target_impl
( model: &'a SemanticModel, tokens: &'a Tokens, syntax: AnyNodeRef<'a>, offset: TextSize, )
crates/ty_ide/src/goto.rs:1441
↓ 3 callers
Method
find_name_in_mro_with_policy
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, name: &str, po
crates/ty_python_semantic/src/types/subclass_of.rs:269
↓ 3 callers
Function
find_references
Find all references to a symbol at the given position. Search for references across all files in the project.
crates/ty_ide/src/find_references.rs:14
↓ 3 callers
Function
find_settings_toml
Find the path to the `pyproject.toml` or `ruff.toml` file, if such a file exists.
crates/ruff_workspace/src/pyproject.rs:109
↓ 3 callers
Function
find_trailing_pragma_offset
Returns the byte offset within `comment` where a trailing pragma comment starts, or `None` if no pragma is found. For a plain pragma like `# noqa: F4
crates/ruff_python_trivia/src/pragmas.rs:56
↓ 3 callers
Function
find_typevar_annotation_range
( context: &InferContext<'db, '_>, node: &ast::StmtFunctionDef, typevar: TypeVarInstance<'db>,
crates/ty_python_semantic/src/types/infer/builder/post_inference/function.rs:512
↓ 3 callers
Function
find_underline
Returns the [`TextRange`] of the underline, if a line consists of only dashes.
crates/ruff_linter/src/rules/pydocstyle/helpers.rs:151
↓ 3 callers
Function
find_will_execute_event_by_name
( db: &dyn salsa::Database, query_name: &str, input: Option<salsa::Id>, events: &'a [salsa::Ev
crates/ruff_db/src/testing.rs:123
↓ 3 callers
Method
finish
(mut self)
crates/ruff_formatter/src/printer/mod.rs:1543
↓ 3 callers
Method
finish
(self)
crates/ruff_db/src/vendored.rs:500
← previous
next →
3,901–4,000 of 31,562, ranked by callers