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
Function
check_deprecated_context_key
Check for deprecated/renamed context key access and report diagnostics.
crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs:366
↓ 2 callers
Function
check_deprecated_context_key_value_access
( checker: &Checker, value: &Expr, range: TextRange, )
crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs:344
↓ 2 callers
Method
check_deprecated_property
Check the accessor invoked by an attribute operation, using the deprecations retained by member lookup or assignment validation. `access` describes th
crates/ty_python_semantic/src/types/infer/builder.rs:11010
↓ 2 callers
Method
check_diagnostic
Check if a diagnostic is suppressed by any known range suppressions. A suppression applies for the given diagnostic if it fully contains the diagnost
crates/ruff_linter/src/suppression.rs:334
↓ 2 callers
Function
check_dict_items_usage
(checker: &Checker, target: &Expr, iter: &Expr)
crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs:85
↓ 2 callers
Method
check_direct_dependency
(&self, module: Module<'db>, range: TextRange)
crates/ty_python_semantic/src/types/infer/builder/imports.rs:80
↓ 2 callers
Method
check_explicit_attribute_write
( &self, db: &'db dyn Db, requirement: &ExplicitAttributeWriteRequirement<'db>,
crates/ty_python_semantic/src/types/attribute_write.rs:1756
↓ 2 callers
Method
check_fallback_attribute_write
( &self, db: &'db dyn Db, requirement: &FallbackAttributeWriteRequirement<'db>,
crates/ty_python_semantic/src/types/attribute_write.rs:1881
↓ 2 callers
Function
check_file
(db: &dyn Db, file: File)
crates/ty_project/src/lib.rs:904
↓ 2 callers
Method
check_file
(&self, file_id: &FileHandle)
crates/ty_wasm/src/lib.rs:266
↓ 2 callers
Function
check_file_impl
( db: &dyn Db, file: ProgramFile<'_>, )
crates/ty_project/src/lib.rs:1020
↓ 2 callers
Function
check_interpolated_string
Checks for unnecessary escaped quotes in an f-string or t-string.
crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs:291
↓ 2 callers
Method
check_invalid_namedtuple_field_names
Report diagnostics for invalid field names in a namedtuple definition.
crates/ty_python_semantic/src/types/infer/builder/named_tuple.rs:711
↓ 2 callers
Method
check_liskov_violations
(self)
crates/ty_python_semantic/src/types/overrides.rs:2042
↓ 2 callers
Method
check_meta_type_satisfies_protocol
Return whether a class-object type inhabits `type[protocol]`. The effective constructor return must satisfy the instance protocol, while the class ob
crates/ty_python_semantic/src/types/instance.rs:1400
↓ 2 callers
Method
check_module
Return `true` if `module` is a module from which this `SpecialFormType` variant can validly originate. Some variants are defined in only one module;
crates/ty_python_semantic/src/types/special_form.rs:507
↓ 2 callers
Method
check_newtype_pair
( &self, db: &'db dyn Db, source: NewType<'db>, target: NewType<'db>, )
crates/ty_python_semantic/src/types/newtype.rs:214
↓ 2 callers
Function
check_no_default_after_typevar_tuple
A defaulted `TypeVar` anywhere after a pack makes it ambiguous how many arguments belong to the pack. A `ParamSpec` can follow it because its argument
crates/ty_python_semantic/src/types/infer/builder/post_inference/type_param_validation.rs:90
↓ 2 callers
Function
check_no_default_after_typevar_tuple_pep695
( context: &InferContext<'_, '_>, type_params: &ast::TypeParams, )
crates/ty_python_semantic/src/types/infer/builder/post_inference/type_param_validation.rs:68
↓ 2 callers
Method
check_nominal_instance_pair
( &self, db: &'db dyn Db, source: NominalInstanceType<'db>, target: NominalIns
crates/ty_python_semantic/src/types/instance.rs:1419
↓ 2 callers
Function
check_override
Classify an override and check attribute compatibility without emitting diagnostics. Declared attributes compare the values exposed after descriptor
crates/ty_python_semantic/src/types/overrides/attributes.rs:665
↓ 2 callers
Function
check_panic
(test: &MarkdownTest<'_, '_, C>, panic_info: Option<PanicError>)
crates/mdtest/src/lib.rs:669
↓ 2 callers
Method
check_paramspec_return_pair
( &self, db: &'db dyn Db, source: &Signature<'db>, target: &Signature<'db>,
crates/ty_python_semantic/src/types/signatures.rs:3104
↓ 2 callers
Method
check_paths
Get the benchmark paths
crates/ruff_benchmark/src/real_world_projects.rs:121
↓ 2 callers
Function
check_physical_lines
( locator: &Locator, stylist: &Stylist, indexer: &Indexer, doc_lines: &[TextSize], setting
crates/ruff_linter/src/checkers/physical_lines.rs:21
↓ 2 callers
Method
check_protocol_member_read
( &self, db: &'db dyn Db, ty: Type<'db>, receiver_ty: Type<'db>, membe
crates/ty_python_semantic/src/types/protocol_class.rs:2745
↓ 2 callers
Method
check_relation_in_invariant_position
Whether two types encountered in an invariant position have a relation (subtyping or assignability), taking into account that the two types may come f
crates/ty_python_semantic/src/types/generics.rs:1950
↓ 2 callers
Method
check_relation_with_context
Retain a failed subtyping or assignability check that proves disjointness.
crates/ty_python_semantic/src/types/relation.rs:3587
↓ 2 callers
Method
check_signature_pair_inner
( &self, db: &'db dyn Db, source: &Signature<'db>, target: &Signature<'db>,
crates/ty_python_semantic/src/types/signatures.rs:3138
↓ 2 callers
Function
check_single_typevar_tuple_pep695
Check that a PEP 695 class or type alias parameter list contains at most one `TypeVarTuple`. Classes and type aliases can be explicitly specialized,
crates/ty_python_semantic/src/types/infer/builder/post_inference/type_param_validation.rs:21
↓ 2 callers
Method
check_source_typevar_bounds
( &self, db: &'db dyn Db, bound_or_constraints: TypeVarBoundOrConstraints<'db>,
crates/ty_python_semantic/src/types/relation.rs:1448
↓ 2 callers
Function
check_string_or_bytes
Checks for unnecessary escaped quotes in a string or bytes literal. # Panics If the string kind is an f-string or a t-string.
crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs:250
↓ 2 callers
Method
check_subclassof_pair
Return `true` if `source` has a certain relation to `other`.
crates/ty_python_semantic/src/types/subclass_of.rs:420
↓ 2 callers
Method
check_suppression
Check whether the given rule code or name corresponds to a valid suppression comment at `range` itself or the `parent` offset.
crates/ruff_linter/src/suppression.rs:371
↓ 2 callers
Method
check_tuple_spec_pair
( &self, db: &'db dyn Db, left: &TupleSpec<'db>, right: &TupleSpec<'db>, )
crates/ty_python_semantic/src/types/tuple.rs:812
↓ 2 callers
Method
check_tuple_type_pair
( &self, db: &'db dyn Db, source: TupleType<'db>, target: TupleType<'db>,
crates/ty_python_semantic/src/types/tuple.rs:339
↓ 2 callers
Method
check_type_alias_cycle
Check both alias syntaxes, including union members that disappear during expansion.
crates/ty_python_semantic/src/types/infer/builder.rs:2124
↓ 2 callers
Method
check_type_satisfies_protocol
Return `true` if `ty` conforms to the interface described by `protocol`.
crates/ty_python_semantic/src/types/instance.rs:867
↓ 2 callers
Function
check_type_vars
Deduplicate `vars`, returning `None` if `vars` is empty or any duplicates are found. Also returns `None` if any `TypeVar` has a default value and the
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:402
↓ 2 callers
Method
check_typeddict_pair
Subtyping between `TypedDict`s follows the algorithm described at: https://typing.python.org/en/latest/spec/typeddict.html#subtyping-between-typeddict
crates/ty_python_semantic/src/types/typed_dict.rs:718
↓ 2 callers
Method
check_variadic_argument_type
( &mut self, constraints: &ConstraintSetBuilder<'db>, argument_index: usize, a
crates/ty_python_semantic/src/types/call/bind.rs:8248
↓ 2 callers
Method
check_with_reporter
Checks the files in the project and its dependencies, using the given reporter. Uses the same environment synchronization behavior as [`check`](Self:
crates/ty_project/src/db.rs:247
↓ 2 callers
Function
checkout_project
Obtain a pinned checkout without installing any project dependencies.
crates/ruff_benchmark/src/checkout.rs:9
↓ 2 callers
Method
checkpoint
Creates a checkpoint to which the token source can later return to using [`Self::rewind`].
crates/ruff_python_parser/src/token_source.rs:197
↓ 2 callers
Method
checkpoint
Creates a checkpoint to which the parser can later return to using [`Self::rewind`].
crates/ruff_python_parser/src/parser/mod.rs:918
↓ 2 callers
Method
children
Returns an iterator over the child symbols for the symbol identified by the given ID. Returns `None` when there aren't any children or when the given
crates/ty_ide/src/symbols.rs:234
↓ 2 callers
Function
choose_quote
Returns the outer quotes to use and the number of quotes that need to be escaped.
crates/ruff_python_literal/src/escape.rs:36
↓ 2 callers
Function
class_body_declaration_from_bases
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, class: StaticClassLiteral<'db>, name: &str,
crates/ty_python_semantic/src/types/member.rs:173
↓ 2 callers
Function
class_body_implicit_symbol
Looks up the type of an "implicit class body symbol". Returns [`Place::Undefined`] if `name` is not present as an implicit symbol in class bodies. Im
crates/ty_python_semantic/src/place.rs:2669
↓ 2 callers
Function
class_comparison_semantics
( db: &'db dyn Db, program: Program<'db>, class: Type<'db>, operator: ComparisonOperator, )
crates/ty_python_semantic/src/types/equality.rs:2040
↓ 2 callers
Function
class_decorator_preserves_class_binding
Return true if a decorator result still binds the name to the original class. For example, an identity decorator keeps the public name bound to the s
crates/ty_python_semantic/src/types/infer/builder/class.rs:559
↓ 2 callers
Function
class_defines_property
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, class: ClassLiteral<'db>, name: &str, )
crates/ty_python_semantic/src/types/enums.rs:259
↓ 2 callers
Function
class_has_match_self_flag
Return whether `class` inherits Python's special match-self class-pattern behavior. Callers must first establish that `__match_args__` is statically
crates/ty_python_semantic/src/types/match_pattern.rs:442
↓ 2 callers
Function
class_match_args_type
Resolve `__match_args__` through the pattern class, including its metaclass. The semantic member type is used for validation. When mapping positional
crates/ty_python_semantic/src/types/match_pattern.rs:406
↓ 2 callers
Method
class_member_inner
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, specialization: Option
crates/ty_python_semantic/src/types/class/static_literal.rs:1515
↓ 2 callers
Method
class_metadata_base_types
Base types for class metadata lookup, where the tuple's field types are irrelevant.
crates/ty_python_semantic/src/types/class/static_literal.rs:757
↓ 2 callers
Function
class_mro_intersects
Returns whether any class in `class`'s MRO is one of `roots`.
crates/ty_python_semantic/src/types/ide_support.rs:535
↓ 2 callers
Method
class_namespace_member
Look up metaclass instance members in a constructed class's namespace. A class object is an instance of its metaclass, and its instance storage is al
crates/ty_python_semantic/src/types.rs:4781
↓ 2 callers
Method
class_pattern_arm
( &self, kind: &ClassPatternPredicateKind<'db>, context: &ClassPatternContext<'db>,
crates/ty_python_semantic/src/types/narrow.rs:2745
↓ 2 callers
Method
class_pattern_contexts
( &self, kind: &ClassPatternPredicateKind<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:2707
↓ 2 callers
Function
class_pattern_positional_sources
Resolve the value supplied to each positional subpattern, preserving source order and length. A fixed tuple of string literals in `__match_args__` ma
crates/ty_python_semantic/src/types/match_pattern.rs:530
↓ 2 callers
Method
class_variable_read_type
Reads a value stored on a class, binding its descriptor to the given instance or class. A descriptor that rejects this access cannot satisfy a read re
crates/ty_python_semantic/src/types.rs:5365
↓ 2 callers
Method
classify
(self, source: Source)
scripts/conformance.py:313
↓ 2 callers
Method
classify_from_type_and_name_str
( &self, ty: Type, name_str: &str, )
crates/ty_ide/src/semantic_tokens.rs:522
↓ 2 callers
Method
classify_type_alias_from_resolved_definitions
( &self, definitions: &[ResolvedDefinition<'db>], )
crates/ty_ide/src/semantic_tokens.rs:503
↓ 2 callers
Method
classify_type_form_expr
( &self, ty: Type, )
crates/ty_ide/src/semantic_tokens.rs:564
↓ 2 callers
Function
clean_import_aliases
Return a vector of all non-`mock` imports.
crates/ruff_linter/src/rules/pyupgrade/rules/deprecated_mock_import.rs:82
↓ 2 callers
Method
clear_diagnostics
Clears the diagnostics for the document identified by `uri`. This is done by notifying the client with an empty list of diagnostics for the document.
crates/ty_server/src/session.rs:1100
↓ 2 callers
Method
clear_diagnostics_if_needed
( &self, document: &OpenDocumentHandle, client: &Client, )
crates/ty_server/src/session.rs:1083
↓ 2 callers
Method
client
(&self)
crates/ruff_server/src/session/options.rs:66
↓ 2 callers
Method
client_settings
(&self, key: &DocumentKey)
crates/ruff_server/src/session/index.rs:336
↓ 2 callers
Function
clock_module
Resolve direct imports and use the final attribute as a heuristic for consumers.
crates/ruff_linter/src/rules/ruff/rules/shared_clock_mock.rs:204
↓ 2 callers
Method
close_document
(&mut self, key: &DocumentKey)
crates/ruff_server/src/session/index.rs:314
↓ 2 callers
Method
close_over_constraints
( &mut self, storage: &ConstraintSetStorage<'_>, constraints: impl Iterator<Item = Con
crates/ty_python_semantic/src/types/constraints/support.rs:130
↓ 2 callers
Method
cmp_atoms
(&self, a: ScopedNarrowingConstraint, b: ScopedNarrowingConstraint)
crates/ty_python_core/src/narrowing_constraints.rs:178
↓ 2 callers
Method
cmp_atoms
Implements the ordering that determines which level a TDD node appears at. Each interior node checks the value of a single variable (for us, a `Predi
crates/ty_python_core/src/reachability_constraints.rs:326
↓ 2 callers
Function
code_is_valid
(code: &str, external: &[String])
crates/ruff_linter/src/rules/ruff/rules/invalid_rule_code.rs:135
↓ 2 callers
Method
col_separator
(&self)
crates/ruff_annotate_snippets/src/renderer/mod.rs:298
↓ 2 callers
Method
collapse_to_object
Collapse the union to a single type: `object`.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:769
↓ 2 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, visitor: &StringLiteralCandidatesVisitor
crates/ty_python_semantic/src/semantic_model.rs:711
↓ 2 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, typevars: &mut FxOrderSet<BoundTypeVarInstance<'db>>
crates/ty_python_semantic/src/types/type_alias.rs:65
↓ 2 callers
Method
collect_call_arguments_type_context
Collects the type contexts used to infer the arguments of a call expression.
crates/ty_python_semantic/src/types/infer/builder.rs:6565
↓ 2 callers
Function
collect_comments
Collect the preceding, following and enclosing node for each comment without applying [`place_comment`] for debugging.
crates/ruff_python_formatter/src/comments/visitor.rs:20
↓ 2 callers
Function
collect_fixture_reference_roots
Follows imports that preserve the fixture name, collecting the name sources at their roots. Returns whether this branch supplied a root; a cycle back
crates/ty_ide/src/references.rs:544
↓ 2 callers
Function
collect_for_loop_bindings
Like `collect_while_loop_bindings` above, but for `for` loops.
crates/ty_python_core/src/builder/loop_bindings_visitor.rs:21
↓ 2 callers
Method
collect_from_annotation
Collect Pydantic field metadata from a field's annotation. For example, collect the strictness metadata from the following field annotation: ```py fi
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:194
↓ 2 callers
Function
collect_implicit_attribute_names
( db: &'db dyn Db, class_body_scope: ScopeId<'db>, defined_only: bool, )
crates/ty_python_semantic/src/types/class/implicit_attributes.rs:531
↓ 2 callers
Function
collect_import_from_member
Format the call path for a relative import. # Examples ```rust # use ruff_python_ast::helpers::collect_import_from_member; assert_eq!(collect_impor
crates/ruff_python_ast/src/helpers.rs:1024
↓ 2 callers
Function
collect_publish_diagnostic_notifications_with_versions
( server: &mut TestServer, count: usize, )
crates/ty_server/tests/e2e/publish_diagnostics.rs:943
↓ 2 callers
Function
collect_rule_codes
(rules: impl IntoIterator<Item = T>)
crates/ruff_linter/src/linter.rs:644
↓ 2 callers
Function
collect_shop_items
(shopper, items)
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B031.py:17
↓ 2 callers
Method
collect_type_expression_diagnostics
Collect type-expression errors for use as explanations at a reference site. These errors describe why a value cannot be used as a type, independently
crates/ty_python_semantic/src/types/context.rs:310
↓ 2 callers
Function
collect_unused_bindings_in_file
( path: &str, source: &str, )
crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs:239
↓ 2 callers
Function
collect_unused_names_in_file
(path: &str, source: &str)
crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs:255
↓ 2 callers
Function
collect_while_loop_bindings
Do a pre-walk of a `while` loop to collect all the places that are bound, prior to visiting the loop with `SemanticIndexBuilder`. This walk includes b
crates/ty_python_core/src/builder/loop_bindings_visitor.rs:13
↓ 2 callers
Function
collected_list_type
Infers the fresh list made by a starred assignment target or sequence-pattern capture. Both `first, *rest = values` and `case [first, *rest]:` create
crates/ty_python_semantic/src/types/unpacker.rs:593
↓ 2 callers
Method
collection_use_constraint_from_specialization
TODO: This should not be needed once we use constraint sets to track the usages of each container literal across a scope. https://github.com/astral-sh
crates/ty_python_semantic/src/types/infer/builder.rs:9560
↓ 2 callers
Method
column
(&self, diagnostic: &Diagnostic)
crates/mdtest/src/matcher.rs:379
↓ 2 callers
Method
combine
(self, db: &'db dyn Db, other: Self, intersection: bool)
crates/ty_python_semantic/src/types.rs:1113
↓ 2 callers
Method
combine_with
(&mut self, _other: Self)
crates/ty_project/src/metadata/options.rs:951
← previous
next →
5,201–5,300 of 31,766, ranked by callers