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
↓ 2 callers
Method
bump_ipython_escape_command
( &mut self, context: IpyEscapeContext, )
crates/ruff_python_parser/src/parser/mod.rs:488
↓ 2 callers
Method
bump_match_statement_keyword
Consume `match` as a keyword and report an error if the compound statement follows a semicolon. If `match` turns out to be an identifier, rewinding di
crates/ruff_python_parser/src/parser/statement.rs:2538
↓ 2 callers
Method
cached_constraint_bound_depth
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, constraint_id: At
crates/ty_python_semantic/src/types/constraints.rs:1493
↓ 2 callers
Function
call
( argumentable: Argumentable, parameters: impl Iterator<Item = &'a Parameter>, scope: &Scope,
crates/ruff_linter/src/rules/flake8_unused_arguments/rules/unused_arguments.rs:346
↓ 2 callers
Function
call_inference
( db: &'db TestDb, callable: Type<'db>, arguments: impl IntoIterator<Item = Type<'db>>
crates/ty_python_semantic/src/types/call/bind.rs:11538
↓ 2 callers
Function
call_signature_details
Extract signature details from a function call expression. This function analyzes the callable being invoked and returns zero or more `CallSignatureDe
crates/ty_python_semantic/src/types/ide_support.rs:1142
↓ 2 callers
Method
callable_by_name
(&self, name: &str)
crates/ty_python_semantic/src/types/signatures.rs:6396
↓ 2 callers
Method
callables
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:502
↓ 2 callers
Method
callables_with_receiver
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, receiver_type: Type<'d
crates/ty_python_semantic/src/types/method.rs:282
↓ 2 callers
Method
can_await_here
Returns `true` if adding `await` at `expression` would produce valid Python. Accounts for asynchronous functions, notebook cells, annotation restrict
crates/ty_python_semantic/src/types/infer/builder/awaitable.rs:80
↓ 2 callers
Method
can_skip
Try to skip the subtree if there are no comments if the next comment comes after this node (meaning, this nodes subtree contains no comments)
crates/ruff_python_formatter/src/comments/visitor.rs:65
↓ 2 callers
Method
can_skip
(&mut self, node_end: TextSize)
crates/ruff_linter/src/rules/ruff/rules/suppression_comment_visitor.rs:59
↓ 2 callers
Method
cancellation_token
Returns the cancellation token for the given request id if the request is still pending.
crates/ty_server/src/session/request_queue.rs:84
↓ 2 callers
Method
candidate_evidence
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constra
crates/ty_python_semantic/src/types/constraints/solutions.rs:762
↓ 2 callers
Method
canonicalize_path
(&self, path: &SystemPath)
crates/ty_server/src/system.rs:182
↓ 2 callers
Method
capture
(&mut self, comment: SuppressionCommentData<'src>)
crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs:213
↓ 2 callers
Method
cell_document_by_uri
Get the text document representing the contents of a cell by the cell URI.
crates/ruff_server/src/edit/notebook.rs:221
↓ 2 callers
Method
cell_index
(&self)
crates/ruff_notebook/src/index.rs:89
↓ 2 callers
Method
cell_index_by_uri
(&self, cell_uri: &lsp_types::Uri)
crates/ty_server/src/document/notebook.rs:196
↓ 2 callers
Function
cell_range
Returns the range of the notebook cell identified by `cell_uri` in the notebook's concatenated Python source, including the newline that separates it
crates/ty_server/src/document/range.rs:118
↓ 2 callers
Method
cell_range
Returns the text range in the concatenated document of the cell with index `cell`. `cell` is the cell's index among all of the notebook's cells, the
crates/ruff_notebook/src/notebook.rs:405
↓ 2 callers
Method
cell_uri_by_index
Get the URI for a cell by its index within the cell array.
crates/ty_server/src/document/notebook.rs:185
↓ 2 callers
Method
cell_uri_by_index
Get the URI for a cell by its index within the cell array.
crates/ruff_server/src/edit/notebook.rs:216
↓ 2 callers
Method
cell_uris
Returns a list of cell URIs in the order they appear in the array.
crates/ty_server/src/document/notebook.rs:192
↓ 2 callers
Method
changed
(&self)
crates/ruff_python_literal/src/escape.rs:19
↓ 2 callers
Function
char_width
(ch: char)
crates/ruff_annotate_snippets/src/renderer/render.rs:2401
↓ 2 callers
Method
characters_between
( &self, range: TextRange, text: &str, encoding: PositionEncoding, )
crates/ruff_source_file/src/line_index.rs:191
↓ 2 callers
Function
check
( query: &DocumentQuery, encoding: PositionEncoding, show_syntax_errors: bool, supports_relate
crates/ruff_server/src/lint.rs:76
↓ 2 callers
Method
check
Checks the files in the project and its dependencies as per the project's check mode. Uses current settings and environments without starting or wait
crates/ty_project/src/db.rs:235
↓ 2 callers
Function
check_annotation
(checker: &Checker<'a>, unresolved_annotation: &'b Expr)
crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs:99
↓ 2 callers
Method
check_attribute_write
Checks a required attribute write using normal attribute-assignment lookup. Resolution is shared with real assignments, but this path evaluates the r
crates/ty_python_semantic/src/types/attribute_write.rs:1424
↓ 2 callers
Method
check_boolean_test
Check `test` and the boolean tests contributing to its outcome. Diagnostic selection follows these rules: - Within a condition with fixed truthiness
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:1013
↓ 2 callers
Method
check_bound_method_pair
( &self, db: &'db dyn Db, source: BoundMethodType<'db>, target: BoundMethodTyp
crates/ty_python_semantic/src/types/method.rs:331
↓ 2 callers
Method
check_bound_super_pair
Check whether two `BoundSuperType`s are equivalent by recursing into their fields. This method is necessary because [`super::relation::TypeRelationCh
crates/ty_python_semantic/src/types/bound_super.rs:1035
↓ 2 callers
Method
check_callable_signature_pair_inner
Implementation of subtyping and assignability between two, possible overloaded, callable types.
crates/ty_python_semantic/src/types/signatures.rs:2703
↓ 2 callers
Method
check_callable_write_parameter
( &self, db: &'db dyn Db, callable_ty: Type<'db>, parameter_index: usize,
crates/ty_python_semantic/src/types/attribute_write.rs:1687
↓ 2 callers
Method
check_callables_vs_callable
( &self, db: &'db dyn Db, source: &CallableTypes<'db>, target: CallableType<'d
crates/ty_python_semantic/src/types/callable.rs:1225
↓ 2 callers
Method
check_condition_redundancy
Check a condition, for which types have already been inferred, to see if it is redundant. Report a diagnostic if so. If `test` is part of a larger ex
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:440
↓ 2 callers
Method
check_covering_node
(&mut self, covering_node: &CoveringNode<'_>, kind: OccurrenceKind)
crates/ty_ide/src/references.rs:775
↓ 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:10863
↓ 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:79
↓ 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:1616
↓ 2 callers
Method
check_fallback_attribute_write
( &self, db: &'db dyn Db, requirement: &FallbackAttributeWriteRequirement<'db>,
crates/ty_python_semantic/src/types/attribute_write.rs:1741
↓ 2 callers
Method
check_file
(&self, file: File)
crates/ty_project/src/db.rs:256
↓ 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:1009
↓ 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:2043
↓ 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:1355
↓ 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:508
↓ 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:1374
↓ 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:593
↓ 2 callers
Function
check_panic
(test: &MarkdownTest<'_, '_, C>, panic_info: Option<PanicError>)
crates/mdtest/src/lib.rs:673
↓ 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:3063
↓ 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:2658
↓ 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:1932
↓ 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:3530
↓ 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:3097
↓ 2 callers
Method
check_signature_return_pair
( &self, db: &'db dyn Db, source: &Signature<'db>, target: &Signature<'db>,
crates/ty_python_semantic/src/types/signatures.rs:3050
↓ 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:1447
↓ 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:416
↓ 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:2104
↓ 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:822
↓ 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:717
↓ 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:8131
↓ 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:248
↓ 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_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:2732
↓ 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:550
↓ 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_from_mro
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, name: &str, po
crates/ty_python_semantic/src/types/class/static_literal.rs:1560
↓ 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:1516
↓ 2 callers
Function
class_member_with_symbol
( db: &'db dyn Db, scope: ScopeId<'db>, symbol: Option<ScopedSymbolId>, )
crates/ty_python_semantic/src/types/member.rs:74
↓ 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:758
↓ 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:4759
↓ 2 callers
Method
class_pattern_arm
( &self, kind: &ClassPatternPredicateKind<'db>, context: &ClassPatternContext<'db>,
crates/ty_python_semantic/src/types/narrow.rs:2743
↓ 2 callers
Method
class_pattern_contexts
( &self, kind: &ClassPatternPredicateKind<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:2705
← previous
next →
5,101–5,200 of 31,562, ranked by callers