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
↓ 1 callers
Method
try_start_format_spec
Returns `true` if the context is in a valid position to start format spec i.e., at the same level of nesting as the opening parentheses token. Increme
crates/ruff_python_parser/src/lexer/interpolated_string.rs:101
↓ 1 callers
Method
try_statement
( &self, statement_key: impl Into<StatementNodeKey>, )
crates/ty_python_core/src/lib.rs:769
↓ 1 callers
Method
try_unary_overload_aggregate_relation
Fast path for unary callable assignability: compare overload sets by aggregating overlapping parameter domains and return types. This is intentionall
crates/ty_python_semantic/src/types/signatures.rs:2614
↓ 1 callers
Method
try_unpack
Returns the [`unpack::Unpack`] ingredient for an unpacking target, if any.
crates/ty_python_core/src/lib.rs:760
↓ 1 callers
Function
try_unwrap_nonmember_value
Extracts the inner value type from an `enum.nonmember()` wrapper. At runtime, the enum metaclass unwraps `nonmember(value)`, so accessing the attribu
crates/ty_python_semantic/src/types/enums.rs:1681
↓ 1 callers
Method
try_upcast_to_callable_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, policy: UpcastPolicy,
crates/ty_python_semantic/src/types/callable.rs:232
↓ 1 callers
Method
try_upcast_to_callable_with_recursive_fallback
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, recursive_definition:
crates/ty_python_semantic/src/types/callable.rs:184
↓ 1 callers
Function
try_vendored_class_scope
Returns the body scope when all reachable, exported definitions of `name` in a vendored module are the same direct class definition. This can be used
crates/ty_python_semantic/src/place.rs:2425
↓ 1 callers
Method
tuple
Returns the tuple spec for a specialization of the `tuple` class.
crates/ty_python_semantic/src/types/generics.rs:1348
↓ 1 callers
Function
tuple_diagnostic
Create a [`Diagnostic`] for a tuple of expressions.
crates/ruff_linter/src/rules/pyupgrade/rules/os_error_alias.rs:99
↓ 1 callers
Function
tuple_diagnostic
Create a [`Diagnostic`] for a tuple of expressions.
crates/ruff_linter/src/rules/pyupgrade/rules/timeout_error_alias.rs:125
↓ 1 callers
Function
twisted_arms_in_ifexpr
SIM212
crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs:238
↓ 1 callers
Method
ty
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/signatures.rs:6529
↓ 1 callers
Method
ty
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, tuple: &VariableLength
crates/ty_python_semantic/src/types/tuple.rs:1444
↓ 1 callers
Method
ty
(self)
crates/ty_python_semantic/src/types/enums.rs:232
↓ 1 callers
Function
ty_cmd
()
crates/ty/tests/cli/rule.rs:4
↓ 1 callers
Function
ty_key
(diag: TyDiagnostic)
scripts/conformance.py:568
↓ 1 callers
Method
ty_string_and_syntax
(&self, ty: &Type<'db>)
crates/ty_ide/src/hover.rs:427
↓ 1 callers
Method
type_alias_class
(self)
crates/ty_python_semantic/src/types.rs:769
↓ 1 callers
Function
type_alias_strictness
(db: &'db dyn Db, definition: Definition<'db>)
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:397
↓ 1 callers
Function
type_alias_without_annotation
PYI026
crates/ruff_linter/src/rules/flake8_pyi/rules/simple_defaults.rs:678
↓ 1 callers
Method
type_at_negative_distance
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, distance: usize,
crates/ty_python_semantic/src/types/tuple.rs:2051
↓ 1 callers
Method
type_at_nonnegative_index
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, index: usize, )
crates/ty_python_semantic/src/types/tuple.rs:2027
↓ 1 callers
Method
type_before_if_chain
Resolve a name using the bindings and constraints that precede its `if` chain. This preserves earlier narrowing, including constraints on captured var
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1541
↓ 1 callers
Function
type_bivariance
PLC0131
crates/ruff_linter/src/rules/pylint/rules/type_bivariance.rs:78
↓ 1 callers
Function
type_call_arg
Returns the object passed to the function, if the expression is a call to `type` with a single argument.
crates/ruff_linter/src/rules/refurb/rules/type_none_comparison.rs:90
↓ 1 callers
Function
type_check_without_type_error
TRY004
crates/ruff_linter/src/rules/tryceratops/rules/type_check_without_type_error.rs:147
↓ 1 callers
Function
type_comparison
E721
crates/ruff_linter/src/rules/pycodestyle/rules/type_comparison.rs:64
↓ 1 callers
Method
type_definition
Returns the type definition for this class. For static classes, returns `TypeDefinition::StaticClass`. For dynamic classes, returns `TypeDefinition::
crates/ty_python_semantic/src/types/class.rs:956
↓ 1 callers
Method
type_expression_context
(self)
crates/ty_python_semantic/src/types/infer.rs:2497
↓ 1 callers
Method
type_expression_flags
Get metadata for a type expression.
crates/ty_python_semantic/src/types/infer.rs:1184
↓ 1 callers
Method
type_for_value_field
Returns the type to render for a value field. reST allows types inline on the value field: ```python """ :param str value: The value. """ ``` It al
crates/ty_ide/src/docstring/markdown/structured/rst.rs:210
↓ 1 callers
Function
type_hierarchy_prepare
Return a type hierarchy item for the class type given. When the type given doesn't correspond to a class literal, then this always returns `None`. T
crates/ty_python_semantic/src/types/ide_support.rs:1873
↓ 1 callers
Function
type_hint_explicitly_allows_none
Check if the given annotation [`Expr`] explicitly allows `None`. This function will return `None` if the annotation explicitly allows `None` otherwis
crates/ruff_linter/src/rules/ruff/typing.rs:250
↓ 1 callers
Function
type_hint_is_excessive_for_expr
Given an expression that's the RHS of an assignment, would it be excessive to emit an inlay type hint for the variable assigned to it? This is used t
crates/ty_ide/src/inlay_hints.rs:720
↓ 1 callers
Function
type_hint_resolves_to_any
Check if the given annotation [`Expr`] resolves to `Any`. This function assumes that the annotation is a valid typing annotation expression.
crates/ruff_linter/src/rules/ruff/typing.rs:277
↓ 1 callers
Method
type_identity
Keep parameter positions and variances when abstracting a growing specialization. A variable can first become visible after moving through several rec
crates/ty_python_semantic/src/types/generics.rs:2482
↓ 1 callers
Method
type_is_self_referential
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>,
crates/ty_python_semantic/src/types/typevar.rs:502
↓ 1 callers
Function
type_name_incorrect_variance
PLC0105
crates/ruff_linter/src/rules/pylint/rules/type_name_incorrect_variance.rs:71
↓ 1 callers
Function
type_none_comparison
FURB169
crates/ruff_linter/src/rules/refurb/rules/type_none_comparison.rs:56
↓ 1 callers
Function
type_of_primitive
UP003
crates/ruff_linter/src/rules/pyupgrade/rules/type_of_primitive.rs:58
↓ 1 callers
Function
type_param_name_mismatch
PLC0132
crates/ruff_linter/src/rules/pylint/rules/type_param_name_mismatch.rs:63
↓ 1 callers
Method
type_qualifiers
Returns the type qualifiers (e.g. `Final`, `ClassVar`) for this goto target.
crates/ty_ide/src/goto.rs:608
↓ 1 callers
Function
type_var_is_valid
Returns true in the following cases: If `type_var` is a `TypeVar`: It must not be unpacked If `type_var` is a `TypeVarTuple`: It must be unpacked It
crates/ruff_linter/src/rules/ruff/rules/class_with_mixed_type_vars.rs:240
↓ 1 callers
Function
typed_argument_simple_defaults
PYI011
crates/ruff_linter/src/rules/flake8_pyi/rules/simple_defaults.rs:514
↓ 1 callers
Function
typed_dict_key_definition
( model: &SemanticModel<'db>, subscript: &ast::ExprSubscript, key: &str, )
crates/ty_python_semantic/src/types/ide_support.rs:830
↓ 1 callers
Function
typed_dict_key_hover
( model: &SemanticModel<'db>, subscript: &ast::ExprSubscript, )
crates/ty_python_semantic/src/types/ide_support.rs:842
↓ 1 callers
Method
typed_dict_member
Returns the `TypedDict` member lookup.
crates/ty_python_semantic/src/types/class.rs:1087
↓ 1 callers
Method
typed_dict_module
(self)
crates/ty_python_semantic/src/types/class_base.rs:97
↓ 1 callers
Method
typed_dict_params
Compute `TypedDict` parameters dynamically based on MRO detection and AST parsing.
crates/ty_python_semantic/src/types/class/static_literal.rs:1148
↓ 1 callers
Function
typed_dict_params_from_class_def
(class_stmt: &StmtClassDef)
crates/ty_python_semantic/src/types/typed_dict.rs:1558
↓ 1 callers
Function
typed_dict_subscript
On a closed `TypedDict`, a successful lookup with an arbitrary string must return one of the declared value types. Recover with their union after repo
crates/ty_python_semantic/src/types/subscript.rs:591
↓ 1 callers
Function
typed_dict_without_keys
Returns a `TypedDict` schema with `excluded_keys` removed. This is used for mixed positional-and-keyword constructor calls, where guaranteed keyword
crates/ty_python_semantic/src/types/typed_dict.rs:2295
↓ 1 callers
Method
typed_string_prefix
Returns the source text between the current string's opener and the cursor.
crates/ty_ide/src/completion.rs:1070
↓ 1 callers
Function
typeddict_declares_key
(db: &'db dyn Db, ty: Type<'db>, key: &str)
crates/ty_python_semantic/src/types/narrow.rs:5578
↓ 1 callers
Method
types_in_context_order
( &self, types: &FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>, )
crates/ty_python_semantic/src/types/generics.rs:2975
↓ 1 callers
Method
typeshed
(&self)
crates/ty_test/src/config.rs:69
↓ 1 callers
Method
typevar_inference
( &self, types: &FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>, solutions: TypeVarIn
crates/ty_python_semantic/src/types/generics.rs:2962
↓ 1 callers
Method
typevars_referenced_in_bases
Returns all of the typevars that are referenced in this class's base class list. (This is used to ensure that classes do not reference typevars from e
crates/ty_python_semantic/src/types/class/static_literal.rs:548
↓ 1 callers
Method
typevartuple_argument_context
Returns the expected tuple element for an argument matched to a `TypeVarTuple`. For `result: tuple[Payload, list[int]] = collect({"value": 1}, [])`,
crates/ty_python_semantic/src/types/call/bind.rs:8806
↓ 1 callers
Function
typing_generic_base_and_arguments
( class_arguments: &'a Arguments, semantic: &SemanticModel, )
crates/ruff_linter/src/rules/ruff/rules/class_with_mixed_type_vars.rs:121
↓ 1 callers
Method
typing_import_edit
Move an existing import into a `TYPE_CHECKING` block. If there are no existing `TYPE_CHECKING` blocks, a new one will be added at the top of the file
crates/ruff_linter/src/importer/mod.rs:141
↓ 1 callers
Method
typing_modules
Return an iterator over the set of `typing` modules allowed in the semantic model.
crates/ruff_python_semantic/src/model.rs:313
↓ 1 callers
Function
typing_only_runtime_import
TC001, TC002, TC003
crates/ruff_linter/src/rules/flake8_type_checking/rules/typing_only_runtime_import.rs:355
↓ 1 callers
Method
typing_self_type
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:17
↓ 1 callers
Function
typing_text_str_alias
UP019
crates/ruff_linter/src/rules/pyupgrade/rules/typing_text_str_alias.rs:54
↓ 1 callers
Function
typing_union
Format the expressions as a `typing.Union`-style union. Note: It is a syntax error to have `Union[]` so the caller should ensure that the `elts` argu
crates/ruff_python_ast/src/helpers.rs:1745
↓ 1 callers
Function
u32_index_to_usize
(index: u32)
crates/ruff_server/src/edit/range.rs:30
↓ 1 callers
Function
unaliased_collections_abc_set_import
PYI025
crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs:63
↓ 1 callers
Method
unambiguous_failing_overload
Returns a failing overload only when the call's argument shape selected it uniquely. The overload chosen for diagnostics can be arbitrary when multip
crates/ty_python_semantic/src/types/call/bind.rs:4701
↓ 1 callers
Function
unannotated_assignment_in_stub
PYI052
crates/ruff_linter/src/rules/flake8_pyi/rules/simple_defaults.rs:625
↓ 1 callers
Method
unannotated_collection_literal_binding
( &self, collection_use: &ast::Expr, )
crates/ty_python_core/src/builder.rs:1118
↓ 1 callers
Function
unary_op
Return the name of the `operator` implemented by the given unary expression.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:388
↓ 1 callers
Method
unary_op_expr
(self)
crates/ruff_python_ast/src/generated.rs:1731
↓ 1 callers
Function
unary_prefix_increment_decrement
B002
crates/ruff_linter/src/rules/flake8_bugbear/rules/unary_prefix_increment_decrement.rs:55
↓ 1 callers
Function
unassigned_special_variable_in_stub
PYI035
crates/ruff_linter/src/rules/flake8_pyi/rules/simple_defaults.rs:660
↓ 1 callers
Method
unbound_narrowing_constraint
(&self)
crates/ty_python_core/src/use_def/place_state.rs:336
↓ 1 callers
Method
unbound_signatures_with_inferred_return_type
The unbound signatures, including an inferred return type for Python functions.
crates/ty_python_semantic/src/types/method.rs:210
↓ 1 callers
Function
uncalled_mock_method
PGH005
crates/ruff_linter/src/rules/pygrep_hooks/rules/invalid_mock_access.rs:54
↓ 1 callers
Method
uncommitted
Returns any uncommitted changes (staged or unstaged). Returns `None` if there are no uncommitted changes.
crates/ty_python_semantic/src/fixes.rs:601
↓ 1 callers
Function
unconditionally_terminates
Whether `body` has an unconditional terminator at its top level. Used to decide if a `try` statement's `finally` clause always exits the enclosing con
crates/ruff_linter/src/rules/flake8_bugbear/rules/loop_iterator_mutation.rs:171
↓ 1 callers
Method
uncontracted_name
(&self)
crates/mdtest/src/parser.rs:139
↓ 1 callers
Function
unconventional_import_alias
ICN001
crates/ruff_linter/src/rules/flake8_import_conventions/rules/unconventional_import_alias.rs:61
↓ 1 callers
Function
undefined_local
F823
crates/ruff_linter/src/rules/pyflakes/rules/undefined_local.rs:51
↓ 1 callers
Method
underlying_function
Returns the function exposed by descriptor access or a bound method's `__func__`.
crates/ty_python_semantic/src/types/callable.rs:52
↓ 1 callers
Function
undocumented_warn
LOG009
crates/ruff_linter/src/rules/flake8_logging/rules/undocumented_warn.rs:54
↓ 1 callers
Function
unescape_f_string
Unescape an f-string body by replacing `{{` with `{` and `}}` with `}`. In Python, curly-brace literals within f-strings must be escaped by doubling
crates/ruff_linter/src/rules/pyflakes/rules/f_string_missing_placeholders.rs:120
↓ 1 callers
Function
unexpected_special_method_signature
PLE0302
crates/ruff_linter/src/rules/pylint/rules/unexpected_special_method_signature.rs:140
↓ 1 callers
Method
unfolded_body
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/recursive.rs:562
↓ 1 callers
Method
unfreshened_binder
All fresh occurrences of a binder, including both components of a `ParamSpec`, share the same source declaration.
crates/ty_python_semantic/src/types/typevar.rs:1916
↓ 1 callers
Function
unicode_kind_prefix
UP025
crates/ruff_linter/src/rules/pyupgrade/rules/unicode_kind_prefix.rs:44
↓ 1 callers
Function
unimportant
(name)
crates/ruff_linter/resources/test/fixtures/pyflakes/F821_3.py:17
↓ 1 callers
Function
unintentional_type_annotation
B032
crates/ruff_linter/src/rules/flake8_bugbear/rules/unintentional_type_annotation.rs:39
↓ 1 callers
Method
union
(self, other: Self)
crates/ruff_python_semantic/src/analyze/type_inference.rs:22
↓ 1 callers
Method
union
Updates this constraint set to hold the union of itself and another constraint set. In the result's source order, `self` will appear before `other`.
crates/ty_python_semantic/src/types/constraints.rs:691
↓ 1 callers
Function
union_unpacked_typed_dict_openness
Combines the openness policies of unioned `TypedDict`-shaped values. A union may contain extra items from any constituent, so `Closed` contributes no
crates/ty_python_semantic/src/types/typed_dict.rs:1875
↓ 1 callers
Function
unique_forwarding_target
Return no target for an unbound source, and reject ambiguous or possibly unbound sources.
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:373
↓ 1 callers
Function
unittest_assertion
PT009
crates/ruff_linter/src/rules/flake8_pytest_style/rules/assertion.rs:297
↓ 1 callers
Function
unittest_raises_assertion_binding
PT027
crates/ruff_linter/src/rules/flake8_pytest_style/rules/assertion.rs:411
↓ 1 callers
Function
unittest_raises_assertion_call
PT027
crates/ruff_linter/src/rules/flake8_pytest_style/rules/assertion.rs:395
← previous
next →
13,701–13,800 of 31,562, ranked by callers