MCPcopy Create free account

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

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

↓ 1 callersFunctionimport_fixtures
Imports all the black fixtures
crates/ruff_python_formatter/resources/test/fixtures/import_black_tests.py:124
↓ 1 callersMethodimport_from_module_edit
Constructs a module name edit while preserving the import level.
crates/ty_ide/src/will_rename.rs:457
↓ 1 callersFunctionimport_from_self
PLW0406
crates/ruff_linter/src/rules/pylint/rules/import_self.rs:57
↓ 1 callersMethodimport_module_name
Return the module tested for membership in `__lazy_modules__`. A `from package import member` statement tests `package`, not `package.member`.
crates/ruff_python_semantic/src/model.rs:2518
↓ 1 callersFunctionimport_outside_top_level
PLC0415
crates/ruff_linter/src/rules/pylint/rules/import_outside_top_level.rs:68
↓ 1 callersFunctionimport_private_name
PLC2701
crates/ruff_linter/src/rules/pylint/rules/import_private_name.rs:76
↓ 1 callersFunctionimport_self
PLW0406
crates/ruff_linter/src/rules/pylint/rules/import_self.rs:41
↓ 1 callersFunctionimport_shadowed_by_loop_var
F402
crates/ruff_linter/src/rules/pyflakes/rules/imports.rs:53
↓ 1 callersMethodimport_submodule_completions_for_name
Returns submodule-only completions for the given module.
crates/ty_python_semantic/src/semantic_model.rs:228
↓ 1 callersMethodimport_symbol
Attempts to import a given symbol. If the symbol in the text edit needs to be qualified, we return the qualified symbol text.
crates/ty_ide/src/inlay_hints.rs:794
↓ 1 callersMethodimported_modules
Returns the set of modules that are imported anywhere in this file. This set only considers `import` statements, not `from...import` statements. See
crates/ty_python_core/src/lib.rs:418
↓ 1 callersMethodimporter
(&self)
crates/ty_ide/src/importer.rs:59
↓ 1 callersMethodin_annotated_type_alias_value
Return `true` if the model is visiting the value expression of a [PEP 613] type alias. For example: ```python from typing import TypeAlias OptStr: T
crates/ruff_python_semantic/src/model.rs:2218
↓ 1 callersMethodin_attribute_docstring
Return `true` if the model is in an attribute docstring.
crates/ruff_python_semantic/src/model.rs:2308
↓ 1 callersMethodin_await_allowed_context
(&self)
crates/ruff_python_parser/tests/fixtures.rs:700
↓ 1 callersMethodin_class_body_comprehension
(&self)
crates/ruff_python_parser/tests/fixtures.rs:677
↓ 1 callersMethodin_deferred_class_base
Return `true` if the model is visiting an item in a class's bases tuple that was initially deferred while traversing the AST. (This only happens in st
crates/ruff_python_semantic/src/model.rs:2362
↓ 1 callersMethodin_deferred_type_alias_value
Return `true` if the model is visiting the value expression of a [PEP 695] type alias. For example: ```python type OptStr = str | None # We're visit
crates/ruff_python_semantic/src/model.rs:2232
↓ 1 callersMethodin_docstring
Return a new context suitable for formatting code snippets within a docstring. The quote character given should correspond to the quote character use
crates/ruff_python_formatter/src/context.rs:107
↓ 1 callersFunctionin_dunder_method_definition
Returns `true` if the [`SemanticModel`] is currently in a dunder method definition.
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs:615
↓ 1 callersFunctionin_empty_collection
RUF060
crates/ruff_linter/src/rules/ruff/rules/in_empty_collection.rs:40
↓ 1 callersFunctionin_function
(checker: &Checker, name: &Identifier, body: &[Stmt])
crates/ruff_linter/src/rules/pylint/rules/unreachable.rs:47
↓ 1 callersMethodin_function_definition
(self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:502
↓ 1 callersMethodin_future_type_definition
Return `true` if the model is visiting a "`__future__` type definition" that was previously deferred when initially traversing the AST
crates/ruff_python_semantic/src/model.rs:2175
↓ 1 callersMethodin_generator_context
(&self)
crates/ruff_python_parser/tests/fixtures.rs:708
↓ 1 callersFunctionin_immediate_eager_comprehension_context
(semantic: &SemanticModel)
crates/ruff_linter/src/rules/flake8_tidy_imports/rules/lazy_import_immediately_resolved.rs:233
↓ 1 callersMethodin_loop_context
(&self)
crates/ty_python_core/src/builder.rs:6033
↓ 1 callersMethodin_loop_context
(&self)
crates/ruff_python_parser/tests/fixtures.rs:712
↓ 1 callersMethodin_memory
()
crates/ty_test/src/db.rs:461
↓ 1 callersMethodin_memory
Returns the [`InMemorySystem`]. ## Panics If the underlying test system isn't the [`InMemorySystem`].
crates/ruff_db/src/system/test.rs:80
↓ 1 callersMethodin_module_scope
(&self)
crates/ty_python_core/src/builder.rs:5993
↓ 1 callersMethodin_named_expression_assignment
Return `true` if the model is in a named expression assignment (e.g., `x := 1`).
crates/ruff_python_semantic/src/model.rs:2341
↓ 1 callersFunctionin_nested_block
Check if a node is in a nested block.
crates/ruff_python_ast/src/helpers.rs:1300
↓ 1 callersMethodin_nested_literal
Return `true` if the model is in a nested literal expression (e.g., the inner `Literal` in `Literal[Literal[int, str], float]`).
crates/ruff_python_semantic/src/model.rs:1897
↓ 1 callersMethodin_nested_union
Return `true` if the model is in a nested union expression (e.g., the inner `Union` in `Union[Union[int, str], float]`).
crates/ruff_python_semantic/src/model.rs:1859
↓ 1 callersMethodin_orelse
Return `true` if the model is in an exception handler.
crates/ruff_python_semantic/src/model.rs:2249
↓ 1 callersFunctionin_parameter_annotation
(offset: TextSize, semantic: &SemanticModel)
crates/ruff_linter/src/rules/pyupgrade/rules/quoted_annotation.rs:145
↓ 1 callersFunctionin_parentheses_only_if_group_breaks
Shows prints `content` only if the expression is enclosed by (optional) parentheses (`()`, `[]`, or `{}`) and splits across multiple lines.
crates/ruff_python_formatter/src/expression/parentheses.rs:355
↓ 1 callersFunctionin_parentheses_only_soft_line_break
Creates a [`soft_line_break`] if the expression is enclosed by (optional) parentheses (`()`, `[]`, or `{}`). Prints nothing if the expression is not p
crates/ruff_python_formatter/src/expression/parentheses.rs:247
↓ 1 callersMethodin_place_dunder
Returns the in-place dunder method name for the operator.
crates/ruff_python_ast/src/nodes.rs:2867
↓ 1 callersMethodin_range
Returns a slice of [`Token`] that are within the given `range`.
crates/ruff_python_parser/src/token_source.rs:216
↓ 1 callersMethodin_runtime_required_annotation
Return `true` if the context is in a runtime-required type annotation.
crates/ruff_python_semantic/src/model.rs:2136
↓ 1 callersMethodin_subscript
Return `true` if the model is in a subscript expression.
crates/ruff_python_semantic/src/model.rs:2290
↓ 1 callersFunctionin_subscript_index
Determine whether the [`ExprSubscript`] is in a subscript index (e.g., `Generic[Unpack[int]]`).
crates/ruff_linter/src/rules/pyupgrade/rules/non_pep646_unpack.rs:105
↓ 1 callersMethodin_sync_comprehension
(&self)
crates/ruff_python_parser/tests/fixtures.rs:668
↓ 1 callersMethodin_t_string
Return `true` if the model is in a t-string.
crates/ruff_python_semantic/src/model.rs:2264
↓ 1 callersFunctionin_task_execution_context
Returns `true` if the current location is inside a `@task`-decorated function or a task-execution-time method on an Airflow operator subclass.
crates/ruff_linter/src/rules/airflow/rules/variable_get_outside_task.rs:138
↓ 1 callersMethodin_test
(&self)
crates/ty_server/src/session.rs:1716
↓ 1 callersMethodin_type_alias_value
Return `true` if the model is visiting the value expression of either kind of type alias.
crates/ruff_python_semantic/src/model.rs:2239
↓ 1 callersMethodin_typing_literal
Return `true` if the model is in a `typing::Literal` annotation.
crates/ruff_python_semantic/src/model.rs:2285
↓ 1 callersFunctionin_vararg
Determine whether the [`ExprSubscript`] is attached to a variadic argument in a function definition (e.g., `def f(*args: Unpack[int])`).
crates/ruff_linter/src/rules/pyupgrade/rules/non_pep646_unpack.rs:139
↓ 1 callersMethodin_yield_allowed_context
(&self)
crates/ruff_python_parser/tests/fixtures.rs:704
↓ 1 callersMethodinclude_name
(self)
crates/ty_project/src/metadata/options.rs:1566
↓ 1 callersMethodincludes_generic_writable_instance_member
Returns whether `name` has an instance-write requirement of `type[T]`, where `T` belongs to `generic_context`.
crates/ty_python_semantic/src/types/protocol_class.rs:943
↓ 1 callersFunctionincludes_import
Return `true` if the [`Stmt`] includes the given [`AnyImportRef`].
crates/ruff_linter/src/rules/isort/rules/add_required_imports.rs:60
↓ 1 callersFunctionincoming
( server: &mut crate::TestServer, item: CallHierarchyItem, )
crates/ty_server/tests/e2e/call_hierarchy.rs:317
↓ 1 callersMethodincoming
Returns the client to server request queue.
crates/ruff_server/src/session/request_queue.rs:34
↓ 1 callersMethodincompatible_typevars
Variables whose bounds fail with all sibling arguments fixed to this specialization.
crates/ty_python_semantic/src/types/constraints.rs:3715
↓ 1 callersMethodincompatible_yield_from_send_type
Find a delegated generator's send type that cannot accept `send_ty`. Check union members independently to preserve gradual assignability. Intersectin
crates/ty_python_semantic/src/types.rs:9045
↓ 1 callersMethodincomplete_keywords
Returns keywords when the cursor follows syntax that can only be continued by those keywords. This first identifies keywords compatible with the type
crates/ty_ide/src/completion.rs:1282
↓ 1 callersMethodincomplete_typed_dict_key_context
Returns a fallback type context for completing a `TypedDict` key while editing. While editing `{"key": value}` as a `TypedDict` literal, `{"key"}` pa
crates/ty_python_semantic/src/types/infer/builder.rs:7867
↓ 1 callersMethodinconclusive_definition_reaches
(&self, target: Definition<'db>)
crates/ty_python_semantic/src/types/cyclic.rs:536
↓ 1 callersFunctionincorrect_decorator_order
RUF074
crates/ruff_linter/src/rules/ruff/rules/incorrect_decorator_order.rs:66
↓ 1 callersFunctionincorrect_dict_iterator
PERF102 for `for` loops.
crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs:73
↓ 1 callersFunctionincorrect_dict_iterator_comprehension
PERF102 for comprehensions and generators.
crates/ruff_linter/src/rules/perflint/rules/incorrect_dict_iterator.rs:78
↓ 1 callersMethodincrease_depth
(&mut self)
crates/ruff_annotate_snippets/src/renderer/source_map.rs:614
↓ 1 callersMethodincrement
Increments the value of the token ID.
crates/ruff_python_parser/src/parser/progress.rs:8
↓ 1 callersMethodincrement_dangling_range
(&mut self)
crates/ruff_python_formatter/src/comments/map.rs:447
↓ 1 callersMethodincrement_leading_range
(&mut self)
crates/ruff_python_formatter/src/comments/map.rs:438
↓ 1 callersMethodincrement_level
Increments the level by one. The behaviour depends on the [`indent_style`][IndentStyle] if this is an [`Indent::Align`]: - **Tabs**: `align` is conve
crates/ruff_formatter/src/printer/mod.rs:989
↓ 1 callersMethodincrement_trailing_range
(&mut self)
crates/ruff_python_formatter/src/comments/map.rs:459
↓ 1 callersFunctionincremental
(case: &mut FileCase)
crates/ruff_benchmark/benches/ty.rs:151
↓ 1 callersFunctionindent
(content: &Content)
crates/ruff_formatter/src/builders.rs:715
↓ 1 callersFunctionindent
Indent each line by the given prefix. # Examples ``` # use ruff_python_trivia::textwrap::indent; assert_eq!(indent("First line.\nSecond line.\n", "
crates/ruff_python_trivia/src/textwrap.rs:56
↓ 1 callersMethodindent
The indent of the entire code block relative to the start of the line. For example: ```python def test(): """Docstring Example: >>> 1 + 1 ``` The `>
crates/ruff_python_formatter/src/string/docstring.rs:854
↓ 1 callersFunctionindent_first_line
Indent only the first line by the given prefix. This function is useful when you want to indent the first line of a multi-line expression while prese
crates/ruff_python_trivia/src/textwrap.rs:106
↓ 1 callersFunctionindent_level
Computes the level of indentation for `indentation` when using the configured [`IndentStyle`] and [`IndentWidth`](ruff_formatter::IndentWidth). Retur
crates/ruff_python_formatter/src/range.rs:747
↓ 1 callersFunctionindented
()
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:598
↓ 1 callersMethodindented_code
Returns the code collected in this example as a sequence of lines. The lines returned have the minimum indentation stripped from their prefix in-plac
crates/ruff_python_formatter/src/string/docstring.rs:1098
↓ 1 callersFunctionindented_form_feed
RUF054
crates/ruff_linter/src/rules/ruff/rules/indented_form_feed.rs:54
↓ 1 callersMethodindex
(&self, index: NodeId)
crates/ruff_python_semantic/src/nodes.rs:72
↓ 1 callersMethodindex
(self)
crates/ty_python_core/src/reachability_constraints.rs:123
↓ 1 callersMethodindex
Returns the index of the AST node.
crates/ty_python_core/src/node_key.rs:11
↓ 1 callersMethodindex
Return the Jupyter notebook index. The index is built only once when required. This is only used to report diagnostics, so by that time all of the fi
crates/ruff_notebook/src/notebook.rs:384
↓ 1 callersFunctioninequality_truthiness
Return the truthiness of `left != right` when it is known for every represented runtime value. A result that only permits narrowing remains ambiguous
crates/ty_python_semantic/src/types/equality.rs:287
↓ 1 callersMethodinfer_and_check_argument_types_simple
( &mut self, ast_arguments: ArgumentsIter<'_>, argument_types: &mut CallArguments<'cal
crates/ty_python_semantic/src/types/infer/builder.rs:6331
↓ 1 callersMethodinfer_and_check_argument_types_unified
( &mut self, ast_arguments: &ArgumentsIter<'_>, argument_types: &mut CallArguments<'_,
crates/ty_python_semantic/src/types/infer/builder.rs:6426
↓ 1 callersMethodinfer_annotated_assignment_cycle_initial
Initialize a declaration cycle without discarding its annotation diagnostics or metadata.
crates/ty_python_semantic/src/types/infer/builder.rs:4739
↓ 1 callersMethodinfer_annotated_assignment_definition
Infer the types in an annotated assignment definition.
crates/ty_python_semantic/src/types/infer/builder.rs:4752
↓ 1 callersMethodinfer_annotated_assignment_statement
(&mut self, assignment: &ast::StmtAnnAssign)
crates/ty_python_semantic/src/types/infer/builder.rs:4489
↓ 1 callersMethodinfer_annotation_expression_allow_pep_613
Infer the type of an annotation expression with the given [`DeferredExpressionState`], allowing a PEP 613 `typing.TypeAlias` annotation.
crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs:58
↓ 1 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:100
↓ 1 callersMethodinfer_assert_statement
(&mut self, assert: &ast::StmtAssert)
crates/ty_python_semantic/src/types/infer/builder.rs:5557
↓ 1 callersMethodinfer_assignment_deferred
(&mut self, target: &ast::Expr, value: &'ast ast::Expr)
crates/ty_python_semantic/src/types/infer/builder.rs:4017
↓ 1 callersMethodinfer_assignment_definition
( &mut self, assignment: &AssignmentDefinitionKind<'db>, definition: Definition<'db>,
crates/ty_python_semantic/src/types/infer/builder.rs:3596
↓ 1 callersMethodinfer_assignment_definition_impl
( &mut self, assignment: &AssignmentDefinitionKind<'db>, definition: Definition<'db>,
crates/ty_python_semantic/src/types/infer/builder.rs:3618
↓ 1 callersMethodinfer_assignment_statement
(&mut self, assignment: &ast::StmtAssign)
crates/ty_python_semantic/src/types/infer/builder.rs:3055
↓ 1 callersMethodinfer_augment_assignment_definition
( &mut self, assignment: &'ast ast::StmtAugAssign, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:5347
↓ 1 callersMethodinfer_augmented_assignment_statement
(&mut self, assignment: &ast::StmtAugAssign)
crates/ty_python_semantic/src/types/infer/builder.rs:5161
↓ 1 callersMethodinfer_augmented_op
Infer an augmented operator, returning its recovery type if the operation fails.
crates/ty_python_semantic/src/types/infer/builder.rs:5202
← previousnext →10,201–10,300 of 31,766, ranked by callers