MCPcopy Create free account

hub / github.com/astral-sh/ruff / functions

Functions31,562 in github.com/astral-sh/ruff

↓ 2 callersMethodin_complex_string_type_definition
Return `true` if the model is visiting a "complex string type definition" that was previously deferred when initially traversing the AST
crates/ruff_python_semantic/src/model.rs:2139
↓ 2 callersMethodin_docstring_position
Returns `true` if the expression spanning `range` sits in a docstring position: it makes up the whole of the current expression statement, and that st
crates/ruff_linter/src/checkers/ast/mod.rs:700
↓ 2 callersMethodin_dunder_all_assignment
Report whether a module-level `__all__` assignment is being visited. This differs from [`SemanticModel::in_dunder_all_definition`], which is set only
crates/ruff_linter/src/checkers/ast/mod.rs:3451
↓ 2 callersMethodin_f_string
Return `true` if the model is in an f-string.
crates/ruff_python_semantic/src/model.rs:2230
↓ 2 callersMethodin_function_overload_or_abstractmethod
Returns `true` if the current scope is the function body scope of a function overload (that is, the stub declaration decorated with `@overload`, not t
crates/ty_python_semantic/src/types/infer/builder.rs:2213
↓ 2 callersMethodin_interpolated_string_replacement_field
Return `true` if the model is in an f-string replacement field.
crates/ruff_python_semantic/src/model.rs:2245
↓ 2 callersFunctionin_nested_context
Check if the current statement is nested within another [`StmtClassDef`] or [`StmtFunctionDef`].
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:376
↓ 2 callersMethodin_no_type_check
Return `true` if the model is in a `@no_type_check` context.
crates/ruff_python_semantic/src/model.rs:2285
↓ 2 callersFunctionin_parentheses_only_soft_line_break_or_space
Creates a [`soft_line_break_or_space`] if the expression is enclosed by (optional) parentheses (`()`, `[]`, or `{}`). Prints a [`space`] if the expres
crates/ruff_python_formatter/src/expression/parentheses.rs:253
↓ 2 callersMethodin_protocol_or_abstract_method
Return `true` if the model is in a `typing.Protocol` subclass or an abstract method.
crates/ruff_python_semantic/src/model.rs:2394
↓ 2 callersMethodin_runtime_ambiguous_annotation
Return `true` if the context is in a runtime-ambiguous type annotation.
crates/ruff_python_semantic/src/model.rs:2113
↓ 2 callersMethodin_stub
Are we currently inferring types in a stub file?
crates/ty_python_semantic/src/types/context.rs:410
↓ 2 callersMethodin_stub_file
Return `true` if the model is in a stub file (i.e., a file with a `.pyi` extension).
crates/ruff_python_semantic/src/model.rs:2307
↓ 2 callersMethodin_type_expression
If we see a value of this type used as a type expression, what type does it name? For example, the builtin `int` as a value expression is of type `Ty
crates/ty_python_semantic/src/types.rs:9111
↓ 2 callersMethodin_type_expression_impl
( &self, db: &'db dyn Db, scope_id: ScopeId<'db>, typevar_binding_context: Opt
crates/ty_python_semantic/src/types.rs:9121
↓ 2 callersMethodin_typing_context
Return `true` if the context is in a typing context.
crates/ruff_python_semantic/src/reference.rs:46
↓ 2 callersMethodinclude
(&self)
crates/ruff_linter/src/rules/flake8_tidy_imports/settings.rs:134
↓ 2 callersMethodincludes
Returns whether this selection mode should count the given error.
crates/ty_python_semantic/src/types/call/bind.rs:3552
↓ 2 callersMethodincludes_member_or_object_fallback
Includes inherited `object` members that are guaranteed for every instance. Subclasses can disable `__hash__`, and slotted instances can omit the `__
crates/ty_python_semantic/src/types/protocol_class.rs:532
↓ 2 callersMethodincludes_name
Returns `true` if the file is exempt from the rule with the given name.
crates/ruff_linter/src/noqa.rs:197
↓ 2 callersMethodincoming_mut
(&mut self)
crates/ty_server/src/session/request_queue.rs:38
↓ 2 callersMethodincoming_mut
(&mut self)
crates/ruff_server/src/session/request_queue.rs:38
↓ 2 callersMethodincrement_indent_level
(mut self, indent_style: IndentStyle)
crates/ruff_formatter/src/printer/call_stack.rs:54
↓ 2 callersMethodincremental_matcher
Creates a matcher for determining whether paths are ignored during incremental walking.
crates/ruff_db/src/system/walk_directory.rs:75
↓ 2 callersMethodindent
(&mut self, indent: Indentation)
crates/ruff_python_parser/src/lexer/indentation.rs:95
↓ 2 callersFunctionindentation
(source: &'a str, located: &T)
crates/ruff_python_ast/src/whitespace.rs:9
↓ 2 callersMethodindentation
(self)
crates/ruff_formatter/src/printer/call_stack.rs:50
↓ 2 callersMethodindex
(&self)
crates/ruff_server/src/lint.rs:336
↓ 2 callersMethodindex
(self)
crates/ty_python_core/src/narrowing_constraints.rs:70
↓ 2 callersMethodindex_for_path
(&self, path: &NormalizedVendoredPath)
crates/ruff_db/src/vendored.rs:371
↓ 2 callersMethodindexed_source_place
Retrieve the lexical operand produced for this expression in the current scope.
crates/ty_python_semantic/src/types/infer/builder.rs:10876
↓ 2 callersMethodinfer
( self, builder: &mut TypeInferenceBuilder<'db, '_>, argument: &ast::Expr, )
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:2714
↓ 2 callersMethodinfer_all_argument_types
Infers every call argument using the provided set of type context.
crates/ty_python_semantic/src/types/infer/builder.rs:6526
↓ 2 callersMethodinfer_and_try_call_dunder
( &mut self, object: Type<'db>, name: &str, lookup_policy: MemberLookupPolicy,
crates/ty_python_semantic/src/types/infer/builder.rs:5849
↓ 2 callersMethodinfer_and_try_call_dunder_member
( &mut self, member: PlaceAndQualifiers<'db>, ast_arguments: ArgumentsIter<'_>,
crates/ty_python_semantic/src/types/infer/builder.rs:5871
↓ 2 callersMethodinfer_and_try_call_setattr
Infer an attribute-assignment value using the context provided by `__setattr__`, then validate the synthesized setter call and return both its result
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:242
↓ 2 callersMethodinfer_annotated_assignment_annotation
Infer an annotated assignment's annotation using the file's deferred-annotation semantics.
crates/ty_python_semantic/src/types/infer/builder.rs:4638
↓ 2 callersMethodinfer_annotation_expression_impl
Implementation of [`infer_annotation_expression`]. [`infer_annotation_expression`]: TypeInferenceBuilder::infer_annotation_expression
crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs:104
↓ 2 callersMethodinfer_annotation_expression_inner
( &mut self, annotation: &ast::Expr, deferred_state: DeferredExpressionState,
crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs:70
↓ 2 callersMethodinfer_argument_constraints
( &self, builder: &mut SpecializationBuilder<'db, 'c>, preferred_type_mappings: &FxHas
crates/ty_python_semantic/src/types/call/bind.rs:7579
↓ 2 callersMethodinfer_attribute_expression
(&mut self, attribute: &ast::ExprAttribute)
crates/ty_python_semantic/src/types/infer/builder.rs:11532
↓ 2 callersMethodinfer_attribute_load_impl
Infer an attribute load on a known receiver, returning its recovery type if lookup fails.
crates/ty_python_semantic/src/types/infer/builder.rs:11166
↓ 2 callersMethodinfer_augment_assignment
( &mut self, assignment: &ast::StmtAugAssign, )
crates/ty_python_semantic/src/types/infer/builder.rs:5269
↓ 2 callersMethodinfer_await_expression
( &mut self, await_expression: &ast::ExprAwait, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder/awaitable.rs:17
↓ 2 callersMethodinfer_binary_expression
( &mut self, binary: &ast::ExprBinOp, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:159
↓ 2 callersMethodinfer_binary_expression_from_types
Evaluate a binary operator whose operands have already been inferred in their type contexts.
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:186
↓ 2 callersMethodinfer_boolean_expression
( &mut self, bool_op: &ast::ExprBoolOp, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:11838
↓ 2 callersMethodinfer_builtins_type_call
Infer a call to `builtins.type()`. `builtins.type` has two overloads: a single-argument overload (e.g. `type("foo")`, and a 3-argument `type(name, ba
crates/ty_python_semantic/src/types/infer/builder/type_call.rs:29
↓ 2 callersMethodinfer_call_expression
( &mut self, call_expression: &ast::ExprCall, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:9453
↓ 2 callersMethodinfer_call_expression_impl
( &mut self, call_expression: &ast::ExprCall, mut callable_type: Type<'db>, ca
crates/ty_python_semantic/src/types/infer/builder.rs:9560
↓ 2 callersMethodinfer_callable_type
Infer the type of a `Callable[...]` type expression.
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:2445
↓ 2 callersMethodinfer_callee
Infer a callable expression without introducing new type variable bindings. An assignment such as `items = list[T]()` creates an instance, not a gene
crates/ty_python_semantic/src/types/infer/builder.rs:9467
↓ 2 callersMethodinfer_chained_boolean_types
Computes the output of a chain of (one) boolean operation, consuming as input an iterator of operations and calling the `infer_ty` for each to infer t
crates/ty_python_semantic/src/types/infer/builder.rs:11885
↓ 2 callersMethodinfer_collection_literal_impl
Infer the type of a collection literal expression.
crates/ty_python_semantic/src/types/infer/builder.rs:7971
↓ 2 callersMethodinfer_collection_with_union_context
( &mut self, tcx: TypeContext<'db>, mut infer: impl FnMut(&mut Self, TypeContext<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:7914
↓ 2 callersMethodinfer_compare_expression
(&mut self, compare: &ast::ExprCompare)
crates/ty_python_semantic/src/types/infer/builder.rs:11975
↓ 2 callersMethodinfer_concatenate_special_form
Infer the parameter types represented by a `typing.Concatenate` special form.
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:3463
↓ 2 callersMethodinfer_context_expression
Infers the type of a context expression (`with expr`) and returns the target's type Returns [`Type::unknown`] if the context expression doesn't imple
crates/ty_python_semantic/src/types/infer/builder.rs:2505
↓ 2 callersMethodinfer_decorator
(&mut self, decorator: &ast::Decorator)
crates/ty_python_semantic/src/types/infer/builder.rs:5646
↓ 2 callersMethodinfer_dict_comprehension_expression
( &mut self, dictcomp: &ast::ExprDictComp, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:8697
↓ 2 callersMethodinfer_dict_expression
(&mut self, dict: &ast::ExprDict, tcx: TypeContext<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:7767
↓ 2 callersMethodinfer_eager_union_type_expression
( &mut self, binary: &ast::ExprBinOp, need_runtime_value: bool, )
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:1297
↓ 2 callersMethodinfer_ellipsis_literal_expression
( &mut self, _literal: &ast::ExprEllipsisLiteral, )
crates/ty_python_semantic/src/types/infer/builder.rs:7438
↓ 2 callersMethodinfer_enum_call_expression
( &mut self, call_expr: &ast::ExprCall, definition: Option<Definition<'db>>, b
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:295
↓ 2 callersMethodinfer_exception
(&mut self, node: Option<&ast::Expr>, is_star: bool)
crates/ty_python_semantic/src/types/infer/builder.rs:2531
↓ 2 callersMethodinfer_explicit_class_specialization
( &mut self, subscript: &ast::ExprSubscript, value_ty: Type<'db>, generic_clas
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:507
↓ 2 callersMethodinfer_explicit_type_alias_type_specialization
( &mut self, subscript: &ast::ExprSubscript, value_ty: Type<'db>, generic_type
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:568
↓ 2 callersMethodinfer_expression_impl
Infer the type of an expression.
crates/ty_python_semantic/src/types/infer/builder.rs:6826
↓ 2 callersFunctioninfer_expression_type
Infers the type of an expression where the expression might come from another file. Use this over [`infer_expression_types`] if the expression might
crates/ty_python_semantic/src/types/infer.rs:714
↓ 2 callersFunctioninfer_expression_types_impl
( db: &'db dyn Db, input: InferExpression<'db>, )
crates/ty_python_semantic/src/types/infer.rs:650
↓ 2 callersMethodinfer_expression_with_collection_literal_peer_context
( &mut self, expression: &ast::Expr, tcx: TypeContext<'db>, peer_ty: Option<Ty
crates/ty_python_semantic/src/types/infer/builder.rs:6705
↓ 2 callersMethodinfer_fstring_expression
(&mut self, fstring: &ast::ExprFString)
crates/ty_python_semantic/src/types/infer/builder.rs:7338
↓ 2 callersMethodinfer_function_signature_annotations
Infer an annotated method receiver before the rest of its signature so `Self` can be validated where it occurs, including inside parsed string annotat
crates/ty_python_semantic/src/types/infer/builder/function.rs:861
↓ 2 callersMethodinfer_generator_expression
( &mut self, generator: &ast::ExprGenerator, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:8532
↓ 2 callersMethodinfer_if_expression
( &mut self, if_expression: &ast::ExprIf, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:9039
↓ 2 callersMethodinfer_lambda_expression
( &mut self, lambda_expression: &ast::ExprLambda, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:9099
↓ 2 callersFunctioninfer_legacy_type_alias
( db: &'db dyn Db, definition: Definition<'db>, _parameters: Option<crate::types::GenericContext<'
crates/ty_python_semantic/src/types/infer.rs:133
↓ 2 callersMethodinfer_list_comprehension_expression
( &mut self, listcomp: &ast::ExprListComp, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:8619
↓ 2 callersMethodinfer_list_expression
(&mut self, list: &ast::ExprList, tcx: TypeContext<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:7650
↓ 2 callersMethodinfer_literal_parameter_type
( &mut self, parameters: &'param ast::Expr, )
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:3197
↓ 2 callersMethodinfer_map_impl
( &mut self, formal: Type<'db>, actual: Type<'db>, polarity: TypeVarVariance,
crates/ty_python_semantic/src/types/generics.rs:4147
↓ 2 callersMethodinfer_name_load
(&mut self, name_node: &ast::ExprName)
crates/ty_python_semantic/src/types/infer/builder.rs:10894
↓ 2 callersMethodinfer_name_load_with_definition
Resolve a name once, retaining its definition for type-alias interpretation.
crates/ty_python_semantic/src/types/infer/builder.rs:10899
↓ 2 callersMethodinfer_named_expression
(&mut self, named: &ast::ExprNamed)
crates/ty_python_semantic/src/types/infer/builder.rs:8989
↓ 2 callersMethodinfer_namedtuple_call_expression
Infer a `typing.NamedTuple(typename, fields)` or `collections.namedtuple(typename, field_names)` call. This method *does not* call `infer_expression`
crates/ty_python_semantic/src/types/infer/builder/named_tuple.rs:30
↓ 2 callersFunctioninfer_narrowing_constraints
Return the type constraints that `test` would place on `symbol` if true and false. For example, if we have this code: ```python y = 1 if flag else N
crates/ty_python_semantic/src/types/narrow.rs:85
↓ 2 callersMethodinfer_new_class_call
Infer a `types.new_class(name, bases, kwds, exec_body)` call. This method *does not* call `infer_expression` on the object being called; it is assume
crates/ty_python_semantic/src/types/infer/builder/new_class.rs:26
↓ 2 callersMethodinfer_parameter_definition
Check a parameter's annotation and default. When a definition is supplied, record the declared and inferred types of the parameter in the function bod
crates/ty_python_semantic/src/types/infer/builder/function.rs:1100
↓ 2 callersMethodinfer_parameterized_special_form_type_expression
( &mut self, subscript: &ast::ExprSubscript, special_form: SpecialFormType, )
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:2564
↓ 2 callersMethodinfer_paramspec_default
( &mut self, default_expr: &ast::Expr, paramspec_name: Option<&str>, )
crates/ty_python_semantic/src/types/infer/builder/typevar.rs:587
↓ 2 callersFunctioninfer_predicate_truthiness
A loop predicate can depend on bindings it guards in the previous iteration. Evaluate it in the caller's query to keep an extra query out of that cycl
crates/ty_python_semantic/src/types/infer.rs:589
↓ 2 callersFunctioninfer_rich_comparison
Rich comparison in Python are the operators `==`, `!=`, `<`, `<=`, `>`, and `>=`. Their behaviour can be edited for classes by implementing correspond
crates/ty_python_semantic/src/types/infer/comparisons.rs:1567
↓ 2 callersFunctioninfer_scope_types_impl
( db: &'db dyn Db, input: InferScope<'db>, )
crates/ty_python_semantic/src/types/infer.rs:545
↓ 2 callersMethodinfer_set_comprehension_expression
( &mut self, setcomp: &ast::ExprSetComp, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:8658
↓ 2 callersMethodinfer_set_expression
(&mut self, set: &ast::ExprSet, tcx: TypeContext<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:7679
↓ 2 callersMethodinfer_slice_expression
(&mut self, slice: &ast::ExprSlice)
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:1693
↓ 2 callersMethodinfer_standalone_expression_impl
( &mut self, expression: &ast::Expr, standalone_expression: Expression<'db>, t
crates/ty_python_semantic/src/types/infer/builder.rs:6809
↓ 2 callersMethodinfer_statement
(&mut self, statement: &ast::Stmt)
crates/ty_python_semantic/src/types/infer/builder.rs:2271
↓ 2 callersMethodinfer_string_type_expression
Infer the type of a string type expression.
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:1563
↓ 2 callersMethodinfer_subscript_load
Infer a subscript load, returning its inferred type when the subscription succeeds. If the subscription fails, report the error and return the type t
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:175
← previousnext →5,801–5,900 of 31,562, ranked by callers