MCPcopy Create free account

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

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

↓ 2 callersFunctionclass_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 callersMethodclassify
(self, source: Source)
scripts/conformance.py:331
↓ 2 callersMethodclassify_from_type_and_name_str
( &self, ty: Type, name_str: &str, )
crates/ty_ide/src/semantic_tokens.rs:522
↓ 2 callersMethodclassify_type_alias_from_resolved_definitions
( &self, definitions: &[ResolvedDefinition<'db>], )
crates/ty_ide/src/semantic_tokens.rs:503
↓ 2 callersMethodclassify_type_form_expr
( &self, ty: Type, )
crates/ty_ide/src/semantic_tokens.rs:564
↓ 2 callersFunctionclean_import_aliases
Return a vector of all non-`mock` imports.
crates/ruff_linter/src/rules/pyupgrade/rules/deprecated_mock_import.rs:82
↓ 2 callersMethodclear_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:1073
↓ 2 callersMethodclear_diagnostics_if_needed
( &self, document: &OpenDocumentHandle, client: &Client, )
crates/ty_server/src/session.rs:1056
↓ 2 callersMethodclient
(&self)
crates/ruff_server/src/session/options.rs:66
↓ 2 callersMethodclient_settings
(&self, key: &DocumentKey)
crates/ruff_server/src/session/index.rs:336
↓ 2 callersFunctionclock_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 callersMethodclose_document
(&mut self, key: &DocumentKey)
crates/ruff_server/src/session/index.rs:314
↓ 2 callersMethodclose_over_constraints
( &mut self, storage: &ConstraintSetStorage<'_>, constraints: impl Iterator<Item = Con
crates/ty_python_semantic/src/types/constraints/support.rs:131
↓ 2 callersMethodcmp
(&self, other: &Self)
crates/ruff_linter/src/line_width.rs:176
↓ 2 callersMethodcmp_atoms
(&self, a: ScopedNarrowingConstraint, b: ScopedNarrowingConstraint)
crates/ty_python_core/src/narrowing_constraints.rs:178
↓ 2 callersMethodcmp_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 callersFunctioncode_is_valid
(code: &str, external: &[String])
crates/ruff_linter/src/rules/ruff/rules/invalid_rule_code.rs:135
↓ 2 callersMethodcol_separator
(&self)
crates/ruff_annotate_snippets/src/renderer/mod.rs:298
↓ 2 callersMethodcollapse_to_object
Collapse the union to a single type: `object`.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:756
↓ 2 callersMethodcollect
( db: &'db dyn Db, ty: Type<'db>, visitor: &StringLiteralCandidatesVisitor
crates/ty_python_semantic/src/semantic_model.rs:711
↓ 2 callersMethodcollect
( db: &'db dyn Db, ty: Type<'db>, typevars: &mut FxOrderSet<BoundTypeVarInstance<'db>>
crates/ty_python_semantic/src/types/type_alias.rs:62
↓ 2 callersMethodcollect_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:6464
↓ 2 callersFunctioncollect_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 callersFunctioncollect_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:537
↓ 2 callersFunctioncollect_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 callersMethodcollect_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:151
↓ 2 callersFunctioncollect_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:535
↓ 2 callersFunctioncollect_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 callersFunctioncollect_publish_diagnostic_notifications_with_versions
( server: &mut TestServer, count: usize, )
crates/ty_server/tests/e2e/publish_diagnostics.rs:943
↓ 2 callersFunctioncollect_rule_codes
(rules: impl IntoIterator<Item = T>)
crates/ruff_linter/src/linter.rs:644
↓ 2 callersFunctioncollect_shop_items
(shopper, items)
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B031.py:17
↓ 2 callersMethodcollect_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:291
↓ 2 callersFunctioncollect_unused_bindings_in_file
( path: &str, source: &str, )
crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs:239
↓ 2 callersFunctioncollect_unused_names_in_file
(path: &str, source: &str)
crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs:255
↓ 2 callersFunctioncollect_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 callersFunctioncollected_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 callersMethodcollection_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:9425
↓ 2 callersMethodcolumn
(&self, diagnostic: &Diagnostic)
crates/mdtest/src/matcher.rs:379
↓ 2 callersMethodcombine
(self, db: &'db dyn Db, other: Self, intersection: bool)
crates/ty_python_semantic/src/types.rs:1112
↓ 2 callersMethodcombine_with
(&mut self, other: Self)
crates/ty_project/src/uv.rs:68
↓ 2 callersMethodcomment_complexity
Determine the [`CommentComplexity`] of this multiline string sequence.
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:382
↓ 2 callersFunctioncomment_strings_in_range
( checker: &'a Checker, range: TextRange, ranges_to_ignore: &[TextRange], )
crates/ruff_linter/src/rules/perflint/helpers.rs:9
↓ 2 callersMethodcommit_pending_blank_lines
(&mut self)
crates/ty_ide/src/docstring/document/numpy.rs:363
↓ 2 callersFunctioncommon_section
( checker: &Checker, docstring: &Docstring, context: &SectionContext, next: Option<&SectionCon
crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs:1761
↓ 2 callersFunctioncompare_different_semantics
Compare types that inherit different builtin comparison implementations. A base-class annotation can contain instances of a known subclass with a dif
crates/ty_python_semantic/src/types/equality.rs:1695
↓ 2 callersFunctioncomparison_truthiness
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, left: Type<'db>, right: Type<'db>, opera
crates/ty_python_semantic/src/types/equality.rs:360
↓ 2 callersMethodcomponents_excluding_self
Returns the components of the qualified name of this class, excluding this class itself. For example, calling this method on a class `C` in the modul
crates/ty_python_semantic/src/types/class.rs:3347
↓ 2 callersMethodcompose_thunk
Compose definition-site and use-site variance, preserving erasure in either position.
crates/ty_python_semantic/src/types/variance/equations.rs:66
↓ 2 callersFunctioncomprehension_target_names
( comprehensions: &[ast::Comprehension], )
crates/ruff_python_parser/src/semantic_errors.rs:2144
↓ 2 callersFunctioncompute_diagnostics
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, global_settings: &GlobalSettin
crates/ty_server/src/server/api/diagnostics.rs:384
↓ 2 callersFunctioncompute_stats
(test_cases: list[TestCase], source: Source)
scripts/conformance.py:601
↓ 2 callersMethodconcat_with
Appends `other`, preserving the elements whose positions are known from either end. A literal expansion preserves every position: ```python result =
crates/ty_python_semantic/src/types/tuple.rs:3009
↓ 2 callersMethodconcrete_value_type
Returns the normalized member payload when construction is known not to transform it. Unlike [`Self::value_type`], this does not substitute a `_value
crates/ty_python_semantic/src/types/enums.rs:573
↓ 2 callersFunctioncondensed_full_document_diagnostic_report
(report: FullDocumentDiagnosticReport)
crates/ty_server/tests/e2e/diagnostic_snapshots.rs:60
↓ 2 callersMethodcondition
(&self)
crates/ruff_formatter/src/format_element/tag.rs:274
↓ 2 callersMethodconditions
Returns iterator over [`Condition`]s which must be satisfied to traverse corresponding edge
crates/ruff_python_semantic/src/cfg/graph.rs:134
↓ 2 callersFunctionconfig_boolean
( db: &dyn Db, definition: Definition<'_>, keyword: Option<&Keyword>, )
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:566
↓ 2 callersMethodconfiguration
(&self)
crates/mdtest/src/parser.rs:151
↓ 2 callersFunctionconflicting_parent_member
( db: &'db dyn Db, program: Program<'db>, parent: ClassType<'db>, target: ClassLiteral<'db>,
crates/ty_python_semantic/src/types/overrides/attributes.rs:858
↓ 2 callersMethodconstraint_failure_from_violation
Converts a solver-reported solution violation into a diagnostic failure.
crates/ty_python_semantic/src/types/generics.rs:3653
↓ 2 callersMethodconstraint_is_substituted
(&self, constraint: AtomicConstraintId)
crates/ty_python_semantic/src/types/constraints/paths.rs:537
↓ 2 callersMethodconstraint_mentions_typevars
( &self, db: &'db dyn Db, constraint: ConstraintId, typevars: TypeVarSet<'db>,
crates/ty_python_semantic/src/types/constraints.rs:1648
↓ 2 callersMethodconstraint_source_order
(&mut self, constraint: ConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1551
↓ 2 callersMethodconstraints
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/constraints.rs:6295
↓ 2 callersFunctionconstruct_replacement
(elts: &[&str], flags: StringLiteralFlags)
crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs:176
↓ 2 callersFunctionconstruct_starmap_call
Construct the call to `itertools.starmap` for suggestion.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs:313
↓ 2 callersMethodconstructor_bindings
Build bindings for constructor calls by combining `__new__`/`__init__` signatures. Returns fallback bindings for cases that intentionally keep bespoke
crates/ty_python_semantic/src/types.rs:8044
↓ 2 callersMethodconstructor_for_typevar_bound
Selects the constructor used for a type variable's upper bound. The meta-type of `object` simplifies to permissive bare `type`, so retain the exact c
crates/ty_python_semantic/src/types.rs:3131
↓ 2 callersMethodconstructor_init_argument_matches_keyword_variadic
Return `true` if `argument_index` is matched to the keyword-variadic parameter of an `__init__` constructor.
crates/ty_python_semantic/src/types/call/bind.rs:1078
↓ 2 callersFunctioncontainer_block_end
Returns the end of an indented Markdown or reStructuredText container block. For example, in `["- item", " first", " second", "next"]`, the block a
crates/ty_ide/src/docstring/document/syntax.rs:463
↓ 2 callersFunctioncontains
()
crates/ruff_text_size/tests/main.rs:37
↓ 2 callersMethodcontains
Returns whether this union contains exact instances of `class`.
crates/ty_python_semantic/src/types/set_theoretic.rs:744
↓ 2 callersMethodcontains_comments
Returns true if the node itself or any of its descendants have comments.
crates/ruff_python_formatter/src/comments/mod.rs:441
↓ 2 callersMethodcontains_only_annotated_assignments
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/reachability.rs:2299
↓ 2 callersFunctioncontains_opposite_quote
(content: &str, flags: AnyStringFlags)
crates/ruff_python_formatter/src/string/normalize.rs:1079
↓ 2 callersMethodcontains_positive
Test the underlying value without discarding an unchanged alias from the intersection.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:2027
↓ 2 callersMethodcontains_range_filter
(&self, range: TextRange)
crates/ty_ide/src/folding_range.rs:122
↓ 2 callersFunctioncontext_after
Returns the line number accounting for the given `len` number of following context lines. The line number returned is guaranteed to be greater than o
crates/ruff_db/src/diagnostic/render.rs:872
↓ 2 callersFunctioncontext_before
Returns the line number accounting for the given `len` number of preceding context lines. The line number returned is guaranteed to be less than or e
crates/ruff_db/src/diagnostic/render.rs:835
↓ 2 callersFunctioncontext_manager_suppresses
( db: &'db dyn Db, expression: Expression<'db>, evaluation_mode: EvaluationMode, )
crates/ty_python_semantic/src/reachability.rs:2010
↓ 2 callersMethodcontinuation_line_starts
Returns the line start positions of continuations (backslash).
crates/ruff_python_index/src/indexer.rs:121
↓ 2 callersFunctionconvert_to_lsp_symbol_information
Convert a `ty_ide` `SymbolInfo` to LSP `SymbolInformation` Returns `None` if the symbol's range cannot be converted to a location (e.g., if the file
crates/ty_server/src/server/api/symbols.rs:32
↓ 2 callersFunctioncopy_directory_recursive
Recursively load a directory into the memory filesystem
crates/ruff_benchmark/src/real_world_projects.rs:217
↓ 2 callersFunctioncore_module_scope
Get the scope of a core stdlib module. Can return `None` if a custom typeshed is used that is missing the core module in question.
crates/ty_python_semantic/src/place.rs:773
↓ 2 callersMethodcoroutine_returning_async_iterable
Recognizes coroutines whose results can be iterated over asynchronously. These can arise from async generator stubs that omit `yield`, or from corout
crates/ty_python_semantic/src/types/iteration.rs:189
↓ 2 callersFunctioncould_be_short_circuit
Returns `true` if the function body has 2+ return statements with exactly one non-empty list return — indicating a short-circuit pattern.
crates/ruff_linter/src/rules/airflow/rules/task_branch_as_short_circuit.rs:182
↓ 2 callersMethodcould_coexist_in_mro_with_disjointness_checker
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self, c
crates/ty_python_semantic/src/types/class.rs:1748
↓ 2 callersMethodcould_coexist_in_mro_with_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, other: Self, c
crates/ty_python_semantic/src/types/class.rs:1779
↓ 2 callersMethodcould_exist_in_mro_of_impl
( self, db: &'db dyn Db, other: Self, specializations_are_disjoint: impl Fn(Sp
crates/ty_python_semantic/src/types/class.rs:1668
↓ 2 callersMethodcould_exist_in_mro_of_with_disjointness_checker
Like [`ClassType::could_exist_in_mro_of`], but reuses an active disjointness checker for nested specialization checks so recursive class graphs keep t
crates/ty_python_semantic/src/types/class.rs:1654
↓ 2 callersMethodcovering_node
Convenience method for `covering_node(cursor.parsed.syntax().into(), ...)`.
crates/ty_ide/src/completion.rs:1007
↓ 2 callersMethodcreate_additional_definition
Create a [`Definition`] without recording it in control flow. Returns the new definition and the number of definitions now associated with its AST no
crates/ty_python_core/src/builder.rs:1584
↓ 2 callersFunctioncreate_all_name
Create and return a string representing a name from the given expression, or `None` if it is an invalid expression for a `__all__` element.
crates/ty_ide/src/symbols.rs:1652
↓ 2 callersFunctioncreate_diagnostic
Generate a [`Diagnostic`] for a non-PEP 695 type alias or type alias type.
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/non_pep695_type_alias.rs:267
↓ 2 callersMethodcreate_directory_all
(&self, path: &SystemPath)
crates/ruff_mdtest/src/db.rs:25
↓ 2 callersMethodcreate_error
(self, p: &Parser)
crates/ruff_python_parser/src/parser/mod.rs:1516
↓ 2 callersFunctioncreate_field_assignment_stmt
Generate a [`Stmt::AnnAssign`] representing the provided field definition.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs:150
↓ 2 callersFunctioncreate_field_assignment_stmt
Generate a [`Stmt::AnnAssign`] representing the provided field definition.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs:165
↓ 2 callersFunctioncreate_fix
Attempt to return `Some(fix)`, where `fix` is a `Fix` that can be set on the diagnostic to sort the user's `__all__` definition Return `None` if it's
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:230
↓ 2 callersFunctioncreate_lint_diagnostic
( body: B, suggestion: Option<S>, range: TextRange, fix: Option<Fix>, parent: Option<TextS
crates/ruff_linter/src/message/mod.rs:82
← previousnext →5,201–5,300 of 31,562, ranked by callers