MCPcopy Create free account

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

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

↓ 1 callersMethodevaluate_against_other
Compare one possible value with the other side. Compare `Any` and `Unknown` with the whole union so neither is narrowed by separate values. Return w
crates/ty_python_semantic/src/types/equality/enums.rs:161
↓ 1 callersMethodevaluate_bool_op
( &mut self, expr_bool_op: &ExprBoolOp, expression: Expression<'db>, is_positi
crates/ty_python_semantic/src/types/narrow.rs:5104
↓ 1 callersMethodevaluate_class
( &mut self, object_ty: Type<'db>, member: &ClassAttributeWriteMember<'db>, em
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:705
↓ 1 callersMethodevaluate_class_fallback
( &mut self, object_ty: Type<'db>, requirement: &FallbackAttributeWriteRequirement<'db
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:963
↓ 1 callersFunctionevaluate_comparison_once
Evaluate one comparison after resolving aliases and checking for recursion. Handle enums and dynamic values such as `Any` before checking individual
crates/ty_python_semantic/src/types/equality.rs:612
↓ 1 callersFunctionevaluate_dynamic_comparison
Handle dynamic values such as `Any` before checking individual enum members. A one-member enum can exclude that member from `Any`. An enum with sever
crates/ty_python_semantic/src/types/equality.rs:653
↓ 1 callersFunctionevaluate_enum_comparison
Compare enum values without checking every pair of members. If either side also contains other values, compare those values normally. Return `None`
crates/ty_python_semantic/src/types/equality/enums.rs:25
↓ 1 callersMethodevaluate_expr_call
( &mut self, expr_call: &ast::ExprCall, expression: Expression<'db>, is_positi
crates/ty_python_semantic/src/types/narrow.rs:4576
↓ 1 callersMethodevaluate_expr_compare
( &mut self, expr_compare: &ast::ExprCompare, expression: Expression<'db>, is_
crates/ty_python_semantic/src/types/narrow.rs:4045
↓ 1 callersMethodevaluate_expr_if
( &mut self, expr_if: &ast::ExprIf, expression: Expression<'db>, is_positive:
crates/ty_python_semantic/src/types/narrow.rs:1951
↓ 1 callersMethodevaluate_expr_in
(&self, lhs_ty: Type<'db>, rhs_ty: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:3827
↓ 1 callersMethodevaluate_expr_named
( &mut self, expr_named: &ast::ExprNamed, expression: Expression<'db>, is_posi
crates/ty_python_semantic/src/types/narrow.rs:3792
↓ 1 callersMethodevaluate_expr_not_in
(&self, lhs_ty: Type<'db>, rhs_ty: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:3869
↓ 1 callersFunctionevaluate_finally_continuation
( db: &'db dyn Db, scope: ScopeId<'db>, continuation: ScopedReachabilityConstraintId, )
crates/ty_python_semantic/src/reachability.rs:796
↓ 1 callersFunctionevaluate_finite_comparison
Compare finite sets of values after handling enums and dynamic values. Start with the side being narrowed so its restrictions are not applied to the
crates/ty_python_semantic/src/types/equality.rs:690
↓ 1 callersMethodevaluate_instance
( &mut self, object_ty: Type<'db>, receiver: Option<Type<'db>>, member: &Insta
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:543
↓ 1 callersMethodevaluate_instance_fallback
( &mut self, object_ty: Type<'db>, requirement: &FallbackAttributeWriteRequirement<'db
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:934
↓ 1 callersFunctionevaluate_intersection_left
Combine compatible comparison results from the positive elements of an intersection target.
crates/ty_python_semantic/src/types/equality.rs:1408
↓ 1 callersMethodevaluate_negative_match_pattern
( &self, subject: Expression<'db>, pattern: &PatternPredicateKind<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:4831
↓ 1 callersMethodevaluate_negative_match_pattern_sequence
( &mut self, subject: Expression<'db>, kind: &SequencePatternPredicateKind<'db>,
crates/ty_python_semantic/src/types/narrow.rs:4856
↓ 1 callersMethodevaluate_negative_match_pattern_singleton
( &mut self, subject: Expression<'db>, singleton: ast::Singleton, )
crates/ty_python_semantic/src/types/narrow.rs:4815
↓ 1 callersMethodevaluate_negative_pattern_predicate_kind
( &mut self, pattern_predicate_kind: &PatternPredicateKind<'db>, subject: Expression<'
crates/ty_python_semantic/src/types/narrow.rs:1990
↓ 1 callersMethodevaluate_pair
Reuse the saved enum result and compare all other values normally.
crates/ty_python_semantic/src/types/equality/enums.rs:141
↓ 1 callersMethodevaluate_paramspec_sub_call
Invoke a sub-call for the given `ParamSpec` type variable, using the forwarded arguments. The forwarded arguments are those matched to the `ParamSpec
crates/ty_python_semantic/src/types/call/bind.rs:7989
↓ 1 callersMethodevaluate_pattern_predicate
( &mut self, pattern: PatternPredicate<'db>, is_positive: bool, )
crates/ty_python_semantic/src/types/narrow.rs:2038
↓ 1 callersMethodevaluate_positive_pattern_related_expressions
( &mut self, pattern: &PatternPredicateKind<'db>, subject: Expression<'db>, su
crates/ty_python_semantic/src/types/narrow.rs:2070
↓ 1 callersFunctionevaluate_projected_narrowing_checkpoint
( db: &'db dyn Db, scope: ScopeId<'db>, place: ScopedPlaceId, constraint: ScopedNarrowingConst
crates/ty_python_semantic/src/reachability.rs:1152
↓ 1 callersMethodevaluate_property_calls
Retains the accessors and nominal class when the property initializer is inherited.
crates/ty_python_semantic/src/types/call/bind/property.rs:12
↓ 1 callersFunctionevaluate_reachability_checkpoint
( db: &'db dyn Db, scope: ScopeId<'db>, id: ScopedReachabilityConstraintId, )
crates/ty_python_semantic/src/reachability.rs:946
↓ 1 callersFunctionevaluate_structural_comparison
Compare values not handled by the enum, dynamic, or finite-value stages.
crates/ty_python_semantic/src/types/equality.rs:709
↓ 1 callersMethodevaluate_subject_element_pattern
( &mut self, subject_element: SubjectElementPatternPredicate<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:3504
↓ 1 callersMethodevaluate_test_expr
Evaluate the given expression and return its truthiness. Returns [`None`] if the expression type doesn't implement `__bool__` correctly.
crates/ty_python_semantic/src/dunder_all.rs:194
↓ 1 callersMethodevaluate_type_guard_call
Helper to evaluate TypeGuard/TypeIs narrowing for a call expression. This is based on the call expression's return type, so it applies to any callable
crates/ty_python_semantic/src/types/narrow.rs:4729
↓ 1 callersFunctionevaluate_type_inequality
Return a constraint for `left` in a branch where `left != right` has the given truthiness. Returns `None` when the comparison behavior of either oper
crates/ty_python_semantic/src/types/equality.rs:188
↓ 1 callersMethodevidence_types
(&self)
crates/ty_python_semantic/src/types/constraints.rs:4861
↓ 1 callersFunctionexact_tuple_sequence_pattern_fallthrough_type
Return the part of an exact fixed-length tuple that can remain after a sequence pattern fails. A pattern fails if any aligned element pattern fails.
crates/ty_python_semantic/src/types/match_pattern.rs:1213
↓ 1 callersMethodexact_typevar_upper_bound
Return the exact class-object type of this `type[T]` `TypeVar`'s upper bound, if it has one. This can only succeed when the upper bound normalizes to
crates/ty_python_semantic/src/types/subclass_of.rs:194
↓ 1 callersMethodexactly_one_paramspec
Returns `true` if this generic context contains exactly one `ParamSpec` and no other type variables. For example: ```py class Foo[**P]: ... # true c
crates/ty_python_semantic/src/types/generics.rs:589
↓ 1 callersFunctionexc_info_arg_is_falsey
(call: &ExprCall, checker: &Checker)
crates/ruff_linter/src/rules/flake8_logging/rules/exception_without_exc_info.rs:87
↓ 1 callersFunctionexc_info_outside_except_handler
LOG014
crates/ruff_linter/src/rules/flake8_logging/rules/exc_info_outside_except_handler.rs:90
↓ 1 callersFunctionexcept_handler
Run lint rules over an [`ExceptHandler`] syntax node.
crates/ruff_linter/src/checkers/ast/analyze/except_handler.rs:11
↓ 1 callersFunctionexcept_with_empty_tuple
B029
crates/ruff_linter/src/rules/flake8_bugbear/rules/except_with_empty_tuple.rs:59
↓ 1 callersFunctionexcept_with_non_exception_classes
B030
crates/ruff_linter/src/rules/flake8_bugbear/rules/except_with_non_exception_classes.rs:58
↓ 1 callersMethodexception_checkpoint_key
Identifies the visible bindings and control-flow path observed by an exception handler.
crates/ty_python_core/src/use_def.rs:2360
↓ 1 callersMethodexception_handler_symbol_ty_from_valid_ty
( &self, ty: Type<'db>, type_base_exception: Type<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:2619
↓ 1 callersFunctionexception_needs_match
PT011
crates/ruff_linter/src/rules/flake8_pytest_style/rules/raises.rs:267
↓ 1 callersMethodexception_ty
Returns the expected type when the cursor sits inside a `raise` or `except` expression. The return value is always `None` if the cursor is not inside
crates/ty_ide/src/completion.rs:1403
↓ 1 callersFunctionexception_without_exc_info
LOG007
crates/ruff_linter/src/rules/flake8_logging/rules/exception_without_exc_info.rs:50
↓ 1 callersMethodexceptions
The set of exceptions that were handled when resolution was attempted.
crates/ruff_python_semantic/src/reference.rs:178
↓ 1 callersMethodexclude
Whether the completion that would be built from the given builder should be excluded based on this context. This only returns `true` when it is defin
crates/ty_ide/src/completion.rs:1738
↓ 1 callersFunctionexclude_from_variance
Whether a source method is exempt from declared-variance validation.
crates/ty_python_semantic/src/types/infer/builder/post_inference/function.rs:154
↓ 1 callersMethodexclude_name
(self)
crates/ty_project/src/metadata/options.rs:1477
↓ 1 callersFunctionexclude_with_model_form
DJ006
crates/ruff_linter/src/rules/flake8_django/rules/exclude_with_model_form.rs:51
↓ 1 callersFunctionexcluded_from_proto_members
Returns `true` if a declaration or binding to a given name in a protocol class body should be excluded from the list of protocol members of that class
crates/ty_python_semantic/src/types/protocol_class.rs:3379
↓ 1 callersFunctionexclusion_is_covered
(db: &'db dyn Db, types: TypePair<'db>)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:207
↓ 1 callersFunctionexec_used
S102
crates/ruff_linter/src/rules/flake8_bandit/rules/exec_used.rs:37
↓ 1 callersMethodexecute
(&self, _command: Command)
crates/ty_server/src/system.rs:333
↓ 1 callersMethodexecute
(&self, command: Command)
crates/ruff_db/src/system/test.rs:217
↓ 1 callersMethodexecute
(&self, command: Command)
crates/ruff_db/src/system/os.rs:232
↓ 1 callersFunctionexecute_command
Sends an executeCommand request to the TestServer
crates/ty_server/tests/e2e/commands.rs:8
↓ 1 callersMethodexempts
Return `true` if a given diagnostic candidate should be exempted. Reasons for exemption could be that the condition serves a defensive-programming pu
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:183
↓ 1 callersFunctionexisting_crate_versions
Return the names of workspace crates whose current version exists on crates.io.
scripts/publish-crates.py:127
↓ 1 callersFunctionexisting_directory
( path: PathBuf, description: &'static str, system: &dyn System, )
crates/ty_project/src/uv/metadata.rs:156
↓ 1 callersFunctionexisting_tests
Returns the existing tests in the given directory.
crates/ruff_python_parser/tests/generate_inline_tests.rs:291
↓ 1 callersMethodexists
(&self, path: &SystemPath)
crates/ruff_db/src/system/memory_fs.rs:153
↓ 1 callersMethodexists_inner
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constrai
crates/ty_python_semantic/src/types/constraints.rs:4530
↓ 1 callersMethodexit_scope
Pop an [`ExceptionContextStack`] off the stack of stacks. Each [`ExceptionContextStack`] is only valid for a single scope.
crates/ty_python_core/src/builder/except_handlers.rs:57
↓ 1 callersFunctionexit_status_from_diagnostics
( diagnostics: &[Diagnostic], terminal_settings: &TerminalSettings, )
crates/ty/src/lib.rs:737
↓ 1 callersFunctionexpand
( prefix_ident: &Ident, variants: impl Iterator<Item = (&'a str, &'a Vec<Attribute>)>, )
crates/ruff_macros/src/rule_code_prefix.rs:7
↓ 1 callersMethodexpand
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/call/arguments.rs:150
↓ 1 callersMethodexpand_checkpoint
Expands a deferred suffix when canonicalizing a join requires its predicates. Keeping checkpoints opaque during evaluation avoids repeated work. Duri
crates/ty_python_semantic/src/reachability.rs:1458
↓ 1 callersMethodexpand_eagerly_
(self, db: &'db dyn Db, program: Program<'db>)
crates/ty_python_semantic/src/types.rs:10765
↓ 1 callersFunctionexpand_elements
Expands a sequence of element types, bounding the size of their Cartesian product.
crates/ty_python_semantic/src/types/type_expansion.rs:33
↓ 1 callersMethodexpand_paramspec_variadics
Expands adjacent `P.args`/`P.kwargs` placeholders into their mapped parameters.
crates/ty_python_semantic/src/types/signatures.rs:5927
↓ 1 callersFunctionexpand_site_packages_placeholder
( path: &SystemPath, python_version: PythonVersion, )
crates/ty_test/src/lib.rs:593
↓ 1 callersFunctionexpand_to_qualified_name_attribute
Returns `Some` [`QualifiedName`] delineating the path for the maximal [`ExprName`] or [`ExprAttribute`] containing the expression associated to the gi
crates/ruff_linter/src/rules/pyflakes/rules/unused_import.rs:822
↓ 1 callersFunctionexpanded_diagnostic_location
( span: &diagnostic::Span, position_encoding: SourcePositionEncoding, )
crates/ruff_wasm/src/lib.rs:155
↓ 1 callersFunctionexpanded_fixed_length_starred_class_base_tuple
If `base_node` is a starred class base whose value is inferred as a fixed-length tuple, returns the unpacked tuple in source order.
crates/ty_python_semantic/src/types/class/static_literal.rs:3559
↓ 1 callersMethodexpect_modules
(mut self, names: &[&'a str])
crates/ty_module_resolver/src/resolve/search.rs:1560
↓ 1 callersMethodexpect_primary_span
Returns the "primary" span of this diagnostic, panicking if it does not exist. This should typically only be used when working with diagnostics in Ru
crates/ruff_db/src/diagnostic/mod.rs:349
↓ 1 callersMethodexpect_python
(self)
crates/ruff_linter/src/source_kind.rs:58
↓ 1 callersMethodexpect_ruff_source_file
Returns the [`SourceFile`] which the message belongs to. Panics if the diagnostic has no primary span, or if its file is not a `SourceFile`.
crates/ruff_db/src/diagnostic/mod.rs:498
↓ 1 callersMethodexpect_single_definition
( &self, definition_key: impl Into<DefinitionNodeKey> + std::fmt::Debug + Copy, )
crates/ty_python_core/src/builder.rs:409
↓ 1 callersMethodexpected_arg
(self)
crates/ruff_linter/src/rules/ruff/rules/legacy_form_pytest_raises.rs:107
↓ 1 callersMethodexpected_kind
Returns the docstring kind if the state is expecting a docstring.
crates/ruff_linter/src/checkers/ast/mod.rs:128
↓ 1 callersFunctionexpected_return_type
The type that a return expression must produce for a given annotation.
crates/ty_python_semantic/src/types/infer/builder/function.rs:152
↓ 1 callersMethodexpected_string_literal_completions
Returns completion candidates from a string's expected type and dictionary initializer. If provided, `subscript` must have `string_expr` as its compl
crates/ty_python_semantic/src/semantic_model.rs:697
↓ 1 callersFunctionexplicit
ISC003
crates/ruff_linter/src/rules/flake8_implicit_str_concat/rules/explicit.rs:66
↓ 1 callersMethodexplicit_bases
Returns the explicit base classes of this dynamic class. For assigned calls, bases are computed lazily using deferred inference to handle forward ref
crates/ty_python_semantic/src/types/class/dynamic_literal.rs:197
↓ 1 callersFunctionexplicit_external_stub_fixture_cursor_test
(test_source: &str)
crates/ty_ide/src/find_references.rs:3172
↓ 1 callersFunctionexplicit_f_string_type_conversion
RUF010
crates/ruff_linter/src/rules/ruff/rules/explicit_f_string_type_conversion.rs:66
↓ 1 callersFunctionexplicit_fixture_name_at_offset
Returns a target for the explicit fixture name at `offset`. Quotes, prefixes, and token boundaries select the name's contents. This makes it so that
crates/ty_ide/src/find_references.rs:55
↓ 1 callersMethodexplicit_keyword_names
(&self)
crates/ty_python_semantic/src/types/call/arguments.rs:366
↓ 1 callersMethodexplicit_metaclass
Return the explicit `metaclass` of this class, if one is defined. ## Note Only call this function from queries in the same file or your query depends
crates/ty_python_semantic/src/types/class/static_literal.rs:1277
↓ 1 callersMethodexplicit_return_type
Compute the explicit return type from a `__new__` or metaclass `__call__`. This method is only used for `__new__` and metaclass `__call__`, which (un
crates/ty_python_semantic/src/types/call/bind/constructor.rs:569
↓ 1 callersMethodexplicit_title
Returns the explicit display title, if present. For `` :class:`Model <pkg.Model>` ``, this returns `Some("Model")`.
crates/ty_ide/src/docstring/document/syntax.rs:210
↓ 1 callersFunctionexplicit_with_items
Check if `with_items` contains a single item which should not necessarily be grouped with other items. For example: ```python async with asyncio.time
crates/ruff_linter/src/rules/flake8_simplify/rules/ast_with.rs:87
↓ 1 callersMethodexports_for
Returns the exports from the module at the given path. The path given must have been written to this test's salsa DB.
crates/ty_ide/src/symbols.rs:3318
↓ 1 callersMethodexposures
Returns the equally viable exposures through which the request reaches the fixture.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:234
↓ 1 callersFunctionexpr_and_false
SIM223
crates/ruff_linter/src/rules/flake8_simplify/rules/ast_bool_op.rs:849
← previousnext →9,101–9,200 of 31,562, ranked by callers