MCPcopy Create free account

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

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

↓ 2 callersFunctionempty_lines_before_trailing_comments
Format the empty lines between a node and its trailing comments. For example, given: ```python class Class: ... # comment ``` This builder will inse
crates/ruff_python_formatter/src/comments/format.rs:543
↓ 2 callersMethodenable_implementations_link_support
Enable or disable location link support for goto implementations
crates/ty_server/tests/e2e/main.rs:1604
↓ 2 callersMethodenable_workspace_configuration
Enable or disable workspace configuration capability
crates/ty_server/tests/e2e/main.rs:1469
↓ 2 callersMethodenclosing_classes
Returns the eligible classes enclosing the test's binding, from innermost to outermost. `module` must be the current parsed module containing the tes
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:140
↓ 2 callersFunctionenclosing_generic_contexts
Returns an iterator of any generic context introduced by the given scope or any enclosing scope.
crates/ty_python_semantic/src/types/generics.rs:57
↓ 2 callersMethodenclosing_parent
Returns the parent of the enclosing node, if any
crates/ruff_python_formatter/src/comments/visitor.rs:211
↓ 2 callersFunctionenclosing_scope
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:319
↓ 2 callersMethodenclosing_scope_item
Build the item for the semantic scope in which a call site is evaluated. This differs from taking the nearest syntactic function/class ancestor for e
crates/ty_ide/src/call_hierarchy/incoming_calls.rs:390
↓ 2 callersMethodenclosing_snapshot
Returns `NoLongerInEagerContext` if the nested scope is no longer in an eager context (that is, not every scope that will be traversed is eager) and n
crates/ty_python_core/src/lib.rs:810
↓ 2 callersMethodend_of_scope_declarations
( &'map self, place: ScopedPlaceId, )
crates/ty_python_core/src/use_def.rs:1348
↓ 2 callersFunctionends_suppression
Returns `true` if the statements coming after `leading_or_trailing_comments` are no longer suppressed. The result is only correct if called for state
crates/ruff_python_formatter/src/verbatim.rs:44
↓ 2 callersMethodenqueue_assignment
( &mut self, assignment: Assignment<AtomicConstraintId>, new_fuel: AssignmentFuel,
crates/ty_python_semantic/src/types/constraints/paths.rs:1032
↓ 2 callersMethodensure_lines
(&mut self, line: usize)
crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs:37
↓ 2 callersMethodensure_overlay_typevar_identity_cache
This is a separate method from `ensure_overlay_identity_caches` because it requires a `db`.
crates/ty_python_semantic/src/types/constraints.rs:1158
↓ 2 callersFunctionensure_stability_when_formatting_twice
Format another time and make sure that there are no changes anymore
crates/ruff_python_formatter/tests/fixtures.rs:378
↓ 2 callersFunctionensure_unchanged_ast
Ensure that formatting doesn't change the AST and doesn't introduce any new unsupported syntax errors. Like Black, there are a few exceptions to this
crates/ruff_python_formatter/tests/fixtures.rs:442
↓ 2 callersMethodenter_level
(&mut self, first_child: Option<AnyNodeRef>)
crates/ruff_python_formatter/src/range.rs:495
↓ 2 callersMethodenter_node
(&mut self, node: AnyNodeRef<'ast>)
crates/ruff_python_formatter/src/range.rs:192
↓ 2 callersMethodentry
(&self, file: File)
crates/ty_project/src/uv/environments.rs:502
↓ 2 callersMethodentry
Adds a new entry to the join output.
crates/ruff_formatter/src/builders.rs:2475
↓ 2 callersMethodenum_class
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/literal.rs:423
↓ 2 callersFunctionenum_functional_call_base
Find enum base class of the given type.
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:114
↓ 2 callersFunctionenum_ignored_names
(db: &'db dyn Db, scope_id: ScopeId<'db>)
crates/ty_python_semantic/src/types/enums.rs:950
↓ 2 callersFunctionenum_members_from_names
( context: &InferContext<'db, '_>, names: Vec<Name>, start: EnumStart, base_class: KnownClass,
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:229
↓ 2 callersFunctionenumerate_items
( call_expr: &'a Expr, tuple_expr: &'a Expr, semantic: &SemanticModel, )
crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs:116
↓ 2 callersMethodenumeration_allowed
Whether this directory's contents may supply names during module enumeration. This implements the policy described on `ModuleSearchCursor::list_modul
crates/ty_module_resolver/src/path.rs:350
↓ 2 callersMethodenvironment
(&self, db: &dyn Db, file: File)
crates/ty_project/src/uv/environments.rs:478
↓ 2 callersMethodeq
(&self, other: &MemberExprRef)
crates/ty_python_core/src/member.rs:413
↓ 2 callersMethodeq
(&self, other: &Self)
crates/ruff_linter/src/rules/pylint/settings.rs:82
↓ 2 callersMethodequivalent_representative
(&self, types: &[Type<'db>])
crates/ty_python_semantic/src/types/call/ambiguous.rs:79
↓ 2 callersMethoderror_count
Count the actual errors excluding invalid input files and io errors
crates/ruff_dev/src/format_dev.rs:643
↓ 2 callersFunctionevaluate
(a: Literal[Format.STRING], b: Literal[-1])
crates/ty_python_semantic/resources/corpus/literal_slices.py:6
↓ 2 callersFunctionevaluate_against_results
Combine comparison results produced by alternatives of the non-target operand. The target remains possible when any alternative can satisfy the selec
crates/ty_python_semantic/src/types/equality.rs:1385
↓ 2 callersFunctionevaluate_container_element_equality
( evaluator: &mut ComparisonEvaluator<'db>, left: Type<'db>, right: Type<'db>, )
crates/ty_python_semantic/src/types/equality.rs:1822
↓ 2 callersMethodevaluate_descriptor_write
Check the setter call and return whether the setter is always or only possibly present. Return `None` when the write fails, reporting the error if `em
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:886
↓ 2 callersFunctionevaluate_enum_domains
Compare values that are all enum members. Describe the result using enum members only. Do not copy other restrictions from one side to the other.
crates/ty_python_semantic/src/types/equality/enums.rs:52
↓ 2 callersMethodevaluate_explicit_member
( &mut self, requirement: &ExplicitAttributeWriteRequirement<'db>, value_ty: Type<'db>
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:825
↓ 2 callersMethodevaluate_expression_predicate
( &mut self, expression: Expression<'db>, is_positive: bool, )
crates/ty_python_semantic/src/types/narrow.rs:1735
↓ 2 callersMethodevaluate_known_cases
Evaluates the return type of certain known callables, where we have special-case logic to determine the return type in a way that isn't directly expre
crates/ty_python_semantic/src/types/call/bind.rs:1713
↓ 2 callersMethodevaluate_match_pattern_sequence_for_subject_element
( &mut self, subject_expression: Expression<'db>, elements: &[ast::Expr], kind
crates/ty_python_semantic/src/types/narrow.rs:4941
↓ 2 callersMethodevaluate_match_pattern_value
( &mut self, subject: Expression<'db>, value: Expression<'db>, is_positive: bo
crates/ty_python_semantic/src/types/narrow.rs:5062
↓ 2 callersFunctionevaluate_predicate_truthiness
A widened operand can require a new metaclass lookup, so evaluate truthiness after expression inference has normalized the operand types.
crates/ty_python_semantic/src/types/infer.rs:623
↓ 2 callersFunctionevaluate_reachability_constraint
Evaluates a reachability constraint, first caching complete blocks of statement calls up to its root predicate when the scope has many calls. Large s
crates/ty_python_semantic/src/reachability.rs:749
↓ 2 callersMethodevaluate_simple_expr
( &mut self, expr: &ast::Expr, is_positive: bool, )
crates/ty_python_semantic/src/types/narrow.rs:3773
↓ 2 callersFunctionevaluate_target_union
Combine comparison results for the alternatives of the union being constrained. Alternatives that cannot satisfy the selected branch are removed. Dyn
crates/ty_python_semantic/src/types/equality.rs:1242
↓ 2 callersFunctionevaluate_type_comparison
Return a constraint for `left` in the selected branch of an equality or inequality comparison.
crates/ty_python_semantic/src/types/equality.rs:208
↓ 2 callersFunctionevaluate_union_left
Evaluate each alternative of the union being constrained and combine their branch results.
crates/ty_python_semantic/src/types/equality.rs:1216
↓ 2 callersFunctionevaluate_union_right
Evaluate the target against each alternative of a union on the non-target side.
crates/ty_python_semantic/src/types/equality.rs:1325
↓ 2 callersMethodevaluate_with
Substitute the supplied variable values; the component solver supplies its current approximations for members and effective variance for references ou
crates/ty_python_semantic/src/types/variance/equations.rs:87
↓ 2 callersFunctionexc_info
If the keywords to a logging call contain `exc_info=True` or `exc_info=sys.exc_info()`, return the `Keyword` for `exc_info`.
crates/ruff_python_semantic/src/analyze/logging.rs:81
↓ 2 callersFunctionexcept
Return the [`TextRange`] of the `except` token in an [`ExceptHandler`].
crates/ruff_python_ast/src/identifier.rs:107
↓ 2 callersMethodexception_checkpoint_crosses_scope_boundary
Returns whether an exception raised while evaluating `scope` can propagate directly to its enclosing scope. Generator expressions follow the eager co
crates/ty_python_core/src/builder.rs:2446
↓ 2 callersMethodexclude
(&self)
crates/ruff_linter/src/rules/flake8_tidy_imports/settings.rs:141
↓ 2 callersFunctionexclude_regex
Convert a project exclusion glob to a regex for mypy and Zuban.
scripts/ty_benchmark/src/benchmark/tool.py:33
↓ 2 callersMethodexpand
(&self, ty: Type<'db>)
crates/ty_python_semantic/src/types/type_expansion.rs:77
↓ 2 callersFunctionexpand_args
Expands `@path` arguments unless the literal path, including `@`, exists. Response files contain one argument per line and may refer to other respons
crates/ruff_command_line/src/lib.rs:16
↓ 2 callersMethodexpand_elements
( &self, elements: impl IntoIterator<Item = Type<'db>>, )
crates/ty_python_semantic/src/types/type_expansion.rs:55
↓ 2 callersFunctionexpand_indent
Return the amount of indentation, expanding tabs to the next multiple of the settings' tab size.
crates/ruff_linter/src/checkers/logical_lines.rs:23
↓ 2 callersFunctionexpand_intersection_typevars_and_newtypes
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, positive: &FxOrderSet<Type<'db>>, negative:
crates/ty_python_semantic/src/types/set_theoretic.rs:1563
↓ 2 callersFunctionexpanded_class_base_entries
Expands a class's bases into the semantic entries used by [`StaticClassLiteral::explicit_bases`].
crates/ty_python_semantic/src/types/class/static_literal.rs:3539
↓ 2 callersMethodexpansions
Prepares lazy argument type expansions for overload resolution.
crates/ty_python_semantic/src/types/call/arguments.rs:854
↓ 2 callersMethodexpect_dynamic
(self)
crates/ty_python_semantic/src/types.rs:3188
↓ 2 callersMethodexpect_enum_literal
(self)
crates/ty_python_semantic/src/types.rs:3362
↓ 2 callersMethodexpect_ipy_notebook
(self)
crates/ruff_linter/src/source_kind.rs:65
↓ 2 callersMethodexpected_system_site_packages
(&self)
crates/ty_site_packages/src/lib.rs:2715
↓ 2 callersMethodexpected_system_stdlib
(&self)
crates/ty_site_packages/src/lib.rs:2737
↓ 2 callersFunctionexplicit_attribute_write_requirement
Convert an explicitly resolved member into either a descriptor call or a direct type check. A slot descriptor writes directly to instance storage, so
crates/ty_python_semantic/src/types/attribute_write.rs:885
↓ 2 callersFunctionexplicit_global_symbol
Infers the public type of an explicit module-global symbol as seen from within the same file. Note that all global scopes also include various "impli
crates/ty_python_semantic/src/place.rs:500
↓ 2 callersMethodexplicit_member_type_context
( &self, requirement: &ExplicitAttributeWriteRequirement<'db>, )
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:790
↓ 2 callersMethodexplored_node_key
( &mut self, storage: &mut ConstraintSetStorage<'db>, path: &mut PathAssignments,
crates/ty_python_semantic/src/types/constraints/solutions.rs:577
↓ 2 callersFunctionexported_names
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_core/src/re_exports.rs:41
↓ 2 callersMethodexported_symbols_for
Returns the [`FlatSymbols`] for 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:3303
↓ 2 callersFunctionexposures_contributed_by_definition
Returns fixture exposures contributed by a symbol definition.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1365
↓ 2 callersMethodexpression
(&self)
crates/ruff_python_formatter/src/expression/binary_like.rs:786
↓ 2 callersMethodexpression_type
(&self, expression: &ast::Expr)
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:451
↓ 2 callersMethodextend
Extends the line suffixes with `elements`, storing their call stack arguments with them.
crates/ruff_formatter/src/printer/line_suffixes.rs:12
↓ 2 callersMethodextend
(&mut self, other: Self)
crates/ty_ide/src/references.rs:478
↓ 2 callersMethodextend
Extends the current set of names with the names from the given expression which can be either a list/tuple/set of string-literal names or a module's `
crates/ty_python_semantic/src/dunder_all.rs:79
↓ 2 callersMethodextend
(&mut self, other: &TypeCheckDiagnostics)
crates/ty_python_semantic/src/types/diagnostic.rs:1711
↓ 2 callersMethodextend_all
Extends the current set of names with the names from the given expression which currently must be a list/tuple/set of string-literal names. This curre
crates/ty_ide/src/symbols.rs:1006
↓ 2 callersMethodextend_diagnostics
(&mut self, diagnostics: impl IntoIterator<Item = Diagnostic>)
crates/ty_python_semantic/src/types/diagnostic.rs:1731
↓ 2 callersMethodextend_expression_unchecked
(&mut self, inference: &ExpressionInference<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:786
↓ 2 callersFunctionextend_lsp_edits
Appends replacements grouped by document URI, skipping edits without an LSP location.
crates/ty_server/src/document.rs:26
↓ 2 callersMethodextend_with_class_members
Add members from `class_literal` (including following its parent classes). `ty` should be the original type that we're adding members for. For exampl
crates/ty_python_semantic/src/types/list_members.rs:503
↓ 2 callersMethodextend_with_instance_members
Extend with instance members from a class and all classes in its MRO.
crates/ty_python_semantic/src/types/list_members.rs:635
↓ 2 callersMethodextend_with_slot_members
Includes slot descriptors that are generated outside the class-body symbol table. ```python class Example: __slots__ = ("value",) ``` Both `Example`
crates/ty_python_semantic/src/types/list_members.rs:540
↓ 2 callersMethodextend_with_type
(&mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>)
crates/ty_python_semantic/src/types/list_members.rs:176
↓ 2 callersFunctionexternal_stub_fixture_cursor_test_with_stub
( test_source: &str, stub_source: &str, )
crates/ty_ide/src/find_references.rs:3367
↓ 2 callersMethodextra_configuration_paths
Returns configuration paths outside normal project discovery that should be watched.
crates/ty_project/src/metadata.rs:424
↓ 2 callersFunctionextract_isort_directives
Extract a set of ranges over which to disable isort.
crates/ruff_linter/src/directives.rs:205
↓ 2 callersFunctionextract_literal_container_element_types
Extract precise element types for membership in an immediately consumed list or set display. The ordinary inferred container type remains unchanged.
crates/ty_python_semantic/src/types/iteration.rs:115
↓ 2 callersFunctionextract_local_override_definitions
( context: &InferContext<'db, '_>, member: &Member<'db>, subclass_scope: ScopeId<'db>, )
crates/ty_python_semantic/src/types/overrides.rs:2226
↓ 2 callersFunctionextract_noqa_line_for
Extract a mapping from logical line to noqa line.
crates/ruff_linter/src/directives.rs:109
↓ 2 callersFunctionextract_options
Extract [`ParseOptions`] from an initial pragma line, if present. For example, ```python # parse_options: { "target-version": "3.10" } def f(): ...
crates/ruff_python_parser/tests/fixtures.rs:295
↓ 2 callersMethodextract_pending
(&mut self)
crates/ty_python_semantic/src/types/constraints/sequents.rs:264
↓ 2 callersFunctionextract_underlying_functions
Extract callable functions represented by a type. These may be defined in files other than the one being checked.
crates/ty_python_semantic/src/types/list_members.rs:906
↓ 2 callersFunctionextract_unpacked_typed_dict_keys_from_value_type
Extracts `TypedDict` keys, their value types, and whether they are required when an unpacked `**kwargs` value has this type, resolving type aliases an
crates/ty_python_semantic/src/types/typed_dict.rs:1919
↓ 2 callersFunctionf
()
crates/ruff_python_parser/resources/inline/ok/single_star_in_tuple.py:1
↓ 2 callersFunctionf
()
crates/ruff_python_parser/resources/inline/err/yield_after_comma.py:1
↓ 2 callersFunctionf
()
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM108.py:124
← previousnext →5,501–5,600 of 31,766, ranked by callers