MCPcopy Create free account

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

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

↓ 1 callersFunctionadd_keyword_completions
Adds completions derived from keywords. This should generally only be used when offering "scoped" completions. This will include keywords correspondi
crates/ty_ide/src/completion.rs:2295
↓ 1 callersMethodadd_literal_string_expression
Add an expression whose `__str__` return type is `LiteralString`. The exact value is unknown, so we can't track the concatenated string, but the resul
crates/ty_python_semantic/src/types/infer/builder.rs:13309
↓ 1 callersMethodadd_member
(&mut self, member: Member)
crates/ty_python_core/src/place.rs:400
↓ 1 callersMethodadd_member
Add the given member to an existing `Stmt::ImportFrom` statement.
crates/ruff_linter/src/importer/mod.rs:491
↓ 1 callersMethodadd_module
Mark a Python module as "seen" by the semantic model. Future callers can quickly discount the need to resolve symbols from these modules if they haven
crates/ruff_python_semantic/src/model.rs:1671
↓ 1 callersMethodadd_narrowing_target
Helper to add a potential narrowing target expression to the set.
crates/ty_python_core/src/place.rs:786
↓ 1 callersMethodadd_negated_predicate
Negates a predicate and adds it to the list of all predicates, does not record it.
crates/ty_python_core/src/builder.rs:2331
↓ 1 callersMethodadd_non_literal_string_expression
Add an expression whose `__str__` return type is not `LiteralString`. The result will degrade to `str`.
crates/ty_python_semantic/src/types/infer/builder.rs:13315
↓ 1 callersFunctionadd_noqa
Add suppression directives to a collection of files.
crates/ruff/src/commands/add_noqa.rs:21
↓ 1 callersMethodadd_object_type_annotation
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, diagnostic: &mut Diag
crates/ty_python_semantic/src/types/typed_dict.rs:1722
↓ 1 callersMethodadd_one
Adds the given line to this printer. Depending on what's in the line, this may or may not print the line immediately to the underlying buffer. If the
crates/ruff_python_formatter/src/string/docstring.rs:296
↓ 1 callersMethodadd_or_constraint
( &mut self, a: ScopedReachabilityConstraintId, b: ScopedReachabilityConstraintId,
crates/ty_python_core/src/reachability_constraints.rs:429
↓ 1 callersMethodadd_pair_impossibility
( &mut self, ante1: AtomicConstraint<'db>, ante2: AtomicConstraint<'db>, )
crates/ty_python_semantic/src/types/constraints/sequents.rs:312
↓ 1 callersFunctionadd_parameter
Generic function to add a (regular) parameter to a function definition. Returns `None` if the parameter cannot be added without introducing a syntax
crates/ruff_linter/src/fix/edits.rs:337
↓ 1 callersMethodadd_pattern_binding
(&mut self, stmt: &ast::Stmt, name: &ast::Identifier)
crates/ty_ide/src/symbols.rs:883
↓ 1 callersMethodadd_pattern_narrowing_constraint
( &mut self, pattern_predicate: PatternPredicate<'db>, subject_targets: &[(ScopedPlace
crates/ty_python_core/src/builder.rs:2822
↓ 1 callersMethodadd_pending
(self, key: Key, flag: int)
crates/ruff_benchmark/resources/tomllib/_parser.py:148
↓ 1 callersFunctionadd_permalink_to_diagnostic_line
(repo: ClonedRepository, line: str)
python/ruff-ecosystem/ruff_ecosystem/check.py:495
↓ 1 callersMethodadd_place
(&mut self, place: ScopedPlaceId)
crates/ty_python_core/src/use_def.rs:2326
↓ 1 callersMethodadd_place
(&mut self, place: PlaceExpr)
crates/ty_python_core/src/place.rs:427
↓ 1 callersMethodadd_rebinding_scope
Mark the given [`BindingId`] as rebound in the given [`ScopeId`] (i.e., declared as `global` or `nonlocal`).
crates/ruff_python_semantic/src/model.rs:2026
↓ 1 callersFunctionadd_required_import
( required_import: &NameImport, parsed: &Parsed<ModModule>, locator: &Locator, stylist: &Styli
crates/ruff_linter/src/rules/isort/rules/add_required_imports.rs:99
↓ 1 callersFunctionadd_required_imports
I002
crates/ruff_linter/src/rules/isort/rules/add_required_imports.rs:141
↓ 1 callersMethodadd_result
(&mut self, result: notify::Result<notify::Event>)
crates/ty_project/src/watch/watcher.rs:197
↓ 1 callersFunctionadd_return_none
(checker: &Checker, stmt: &Stmt, range: TextRange)
crates/ruff_linter/src/rules/flake8_return/rules/function.rs:475
↓ 1 callersMethodadd_secondary_annotations_for_redundant_assert
( &self, diagnostic: &mut Diagnostic, full_condition_truthiness: Truthiness, f
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1236
↓ 1 callersMethodadd_secondary_annotations_for_redundant_if_or_elif
( &self, condition: &RedundantCondition<'_, 'db>, diagnostic: &mut Diagnostic,
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1304
↓ 1 callersMethodadd_secondary_annotations_for_redundant_match
( &self, diagnostic: &mut Diagnostic, full_condition_truthiness: Truthiness, c
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1254
↓ 1 callersMethodadd_secondary_annotations_for_redundant_while
( &self, diagnostic: &mut Diagnostic, full_condition_truthiness: Truthiness, w
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1149
↓ 1 callersMethodadd_semantic
Attempts to add the given semantic completion to this collection. When added, `true` is returned.
crates/ty_ide/src/completion.rs:255
↓ 1 callersMethodadd_sequents
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:535
↓ 1 callersMethodadd_sequents
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Con
crates/ty_python_semantic/src/types/constraints/paths.rs:589
↓ 1 callersMethodadd_sequents_with
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:550
↓ 1 callersMethodadd_sequents_with_concrete_equivalence
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:1564
↓ 1 callersMethodadd_sequents_with_concrete_lower
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:1449
↓ 1 callersMethodadd_sequents_with_concrete_upper
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:1505
↓ 1 callersMethodadd_sequents_with_typevar_equivalence
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:1630
↓ 1 callersMethodadd_sequents_with_typevar_range
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, map: &mut SequentMapBu
crates/ty_python_semantic/src/types/constraints/sequents.rs:1610
↓ 1 callersMethodadd_single_tautology
(&mut self, ante: AtomicConstraint<'db>)
crates/ty_python_semantic/src/types/constraints/sequents.rs:306
↓ 1 callersFunctionadd_source
( sources: &mut Vec<Source>, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>
crates/ty_ide/src/lib.rs:759
↓ 1 callersMethodadd_source
(&mut self, db: &'db dyn Db, resolved_source: &ResolvedPlaceLoadSource<'_, 'db>)
crates/ty_python_semantic/src/place/definitions.rs:68
↓ 1 callersMethodadd_space
(self)
crates/ruff_python_parser/src/lexer/indentation.rs:53
↓ 1 callersMethodadd_standalone_assigned_expression
Record an expression that is immediately assigned to a target, and that needs to be a Salsa ingredient, because we need to infer its type standalone (
crates/ty_python_core/src/builder.rs:2934
↓ 1 callersMethodadd_standalone_statement
(&mut self, statement_node: &ast::Stmt)
crates/ty_python_core/src/builder.rs:2970
↓ 1 callersMethodadd_standalone_type_expression
Same as [`SemanticIndexBuilder::add_standalone_expression`], but marks the expression as a type* expression, which makes sure that it will later be in
crates/ty_python_core/src/builder.rs:2948
↓ 1 callersMethodadd_star_import
Adds a reference to a star import (e.g., `from sys import *`) to this scope.
crates/ruff_python_semantic/src/scope.rs:135
↓ 1 callersFunctionadd_string_literal_completions
( model: &SemanticModel<'db>, string_expr: &ast::ExprStringLiteral, subscript: Option<&ast::ExprSu
crates/ty_ide/src/completion.rs:2326
↓ 1 callersMethodadd_subdiagnostics
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, mut diagnostic: LintDi
crates/ty_python_semantic/src/types.rs:12356
↓ 1 callersMethodadd_subscript_expression_ranges
( &mut self, subscript: &'a ExprSubscript, node: AnyNodeRef<'a>, )
crates/ty_ide/src/folding_range.rs:221
↓ 1 callersFunctionadd_suppression
( path: &Path, diagnostics: &[Diagnostic], locator: &Locator, comment_ranges: &CommentRanges,
crates/ruff_linter/src/noqa.rs:784
↓ 1 callersFunctionadd_suppressions
( path: &Path, source_kind: &SourceKind, settings: &LinterSettings, suppressio
crates/ruff_linter/src/noqa.rs:1411
↓ 1 callersFunctionadd_suppressions_to_path
Add any missing suppression comments to the source code at the given `Path`.
crates/ruff_linter/src/linter.rs:358
↓ 1 callersMethodadd_symbol
(&mut self, symbol: Symbol)
crates/ty_python_core/src/place.rs:389
↓ 1 callersMethodadd_tab
(self)
crates/ruff_python_parser/src/lexer/indentation.rs:61
↓ 1 callersMethodadd_to_type_checking_block
Add an import statement to an existing `TYPE_CHECKING` block.
crates/ruff_linter/src/importer/mod.rs:529
↓ 1 callersMethodadd_triple_impossibility
( &mut self, ante1: AtomicConstraint<'db>, ante2: AtomicConstraint<'db>, ante3
crates/ty_python_semantic/src/types/constraints/sequents.rs:323
↓ 1 callersMethodadd_type_checking_block
Add a `TYPE_CHECKING` block to the given module.
crates/ruff_linter/src/importer/mod.rs:511
↓ 1 callersMethodadd_type_hint
(&mut self, expr: &Expr)
crates/ty_ide/src/inlay_hints.rs:459
↓ 1 callersMethodadd_typevar
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Con
crates/ty_python_semantic/src/types/constraints/solutions.rs:1919
↓ 1 callersMethodadd_upper_bound
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Con
crates/ty_python_semantic/src/types/constraints/solutions.rs:1985
↓ 1 callersMethodadjusted_constraint_id
(&self, id: ConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1185
↓ 1 callersMethodadjusted_node_id
(&self, id: NodeId)
crates/ty_python_semantic/src/types/constraints.rs:1178
↓ 1 callersMethodadjusted_source_order_id
(&self, id: SourceOrderId)
crates/ty_python_semantic/src/types/constraints.rs:1199
↓ 1 callersMethodadjusted_support_id
(&self, id: SupportId)
crates/ty_python_semantic/src/types/constraints.rs:1192
↓ 1 callersMethodadjusted_typevar_id
(&self, id: TypeVarId)
crates/ty_python_semantic/src/types/constraints.rs:1206
↓ 1 callersMethodaenter
Returns the type bound from a context manager with type `self`. This method should only be used outside of type checking because it omits any errors.
crates/ty_python_semantic/src/types/context_manager.rs:165
↓ 1 callersMethodaffects_overload_resolution
Returns `true` if this error indicates the overload didn't match the call arguments. Returns `false` for semantic errors where the overload matched t
crates/ty_python_semantic/src/types/call/bind.rs:10434
↓ 1 callersFunctionaffects_python_environment
Returns whether a filesystem event should trigger Python environment discovery. `pyvenv.cfg` records the environment's Python version and whether imp
crates/ty_project/src/db/changes.rs:536
↓ 1 callersFunctionaffects_uv_metadata
(db: &dyn Db, change: &ChangeEvent)
crates/ty_project/src/db/changes.rs:593
↓ 1 callersFunctionaffix_removal_data_expr
Given an expression of the form: ```python text[slice] if text.func(affix) else text ``` where `func` is either `startswith` or `endswith`, this fun
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:158
↓ 1 callersFunctionaffix_removal_data_stmt
Given a statement of the form: ```python if text.func(affix): text = text[slice] ``` where `func` is either `startswith` or `endswith`, this functio
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:185
↓ 1 callersMethodafter_operator
Creates a slice starting at the right operand of `index`.
crates/ruff_python_formatter/src/expression/binary_like.rs:576
↓ 1 callersFunctionairflow_3_0_suggested_update_expr
AIR311
crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs:90
↓ 1 callersFunctionairflow_3_1_moved_expr
AIR321
crates/ruff_linter/src/rules/airflow/rules/moved_in_3_1.rs:82
↓ 1 callersFunctionairflow_3_dag_dynamic_value
AIR304
crates/ruff_linter/src/rules/airflow/rules/runtime_value_in_dag_or_task.rs:59
↓ 1 callersFunctionairflow_3_incompatible_function_signature
AIR303
crates/ruff_linter/src/rules/airflow/rules/function_signature_change_in_3.rs:63
↓ 1 callersFunctionairflow_3_incompatible_method_signature_def
AIR303
crates/ruff_linter/src/rules/airflow/rules/function_signature_change_in_3.rs:100
↓ 1 callersFunctionairflow_3_removal_expr
AIR301
crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs:94
↓ 1 callersFunctionairflow_3_removal_function_def
AIR301
crates/ruff_linter/src/rules/airflow/rules/removal_in_3.rs:137
↓ 1 callersMethodalias_detection_value
Returns the value to use when checking whether an enum member is an alias. For an `auto()` member with a resolvable `_generate_next_value_`, this use
crates/ty_python_semantic/src/types/enums.rs:194
↓ 1 callersMethodall_bindings
Like [`Scope::bindings`], but returns all bindings added to the scope, including those that were shadowed by later bindings.
crates/ruff_python_semantic/src/scope.rs:117
↓ 1 callersFunctionall_codes_invalid_diagnostic
( directive: &Codes<'_>, invalid_codes: Vec<&Code<'_>>, locator: &Locator, context: &LintConte
crates/ruff_linter/src/rules/ruff/rules/invalid_rule_code.rs:140
↓ 1 callersFunctionall_implicit_module_globals
Returns an iterator over all implicit module global symbols and their types. This is used for completions in the global scope of a module. It returns
crates/ty_python_semantic/src/place.rs:2680
↓ 1 callersFunctionall_lines_fit
Returns `true` if all lines in the fix are shorter than the given line length.
crates/ruff_linter/src/fix/edits.rs:639
↓ 1 callersFunctionall_narrowing_constraints_for_expression
( db: &'db dyn Db, expression: Expression<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:151
↓ 1 callersFunctionall_narrowing_constraints_for_pattern
( db: &'db dyn Db, pattern: PatternPredicate<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:134
↓ 1 callersFunctionall_narrowing_constraints_for_subject_element_pattern
( db: &'db dyn Db, pattern: PatternPredicate<'db>, target: ExpressionNodeKey, )
crates/ty_python_semantic/src/types/narrow.rs:197
↓ 1 callersFunctionall_negative_narrowing_constraints_for_pattern
( db: &'db dyn Db, pattern: PatternPredicate<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:180
↓ 1 callersMethodall_parts
(&self)
crates/ruff_python_formatter/src/comments/map.rs:270
↓ 1 callersMethodall_reachable_symbols
( &'map self, )
crates/ty_python_core/src/use_def.rs:1447
↓ 1 callersFunctionall_section_headings
Helper to create a standard `import_headings` map for all sections.
crates/ruff_linter/src/rules/isort/mod.rs:1272
↓ 1 callersMethodall_sequents
(&self)
crates/ty_python_semantic/src/types/constraints/sequents.rs:236
↓ 1 callersMethodall_targets_are_dunder
Returns `true` when every assignment target is a simple name and each name is a dunder (`__` prefix and suffix), matching [`is_dunder`].
crates/ruff_linter/src/rules/ruff/rules/non_empty_init_module.rs:176
↓ 1 callersFunctionall_with_model_form
DJ007
crates/ruff_linter/src/rules/flake8_django/rules/all_with_model_form.rs:53
↓ 1 callersFunctionallocate_tokens_vec
Allocates a token buffer with a capacity intended to skip early grows.
crates/ruff_python_parser/src/token_source.rs:258
↓ 1 callersFunctionallow_boolean_trap
Returns `true` if an argument is allowed to use a boolean trap. To return `true`, the function name must be explicitly allowed, and the argument must
crates/ruff_linter/src/rules/flake8_boolean_trap/helpers.rs:136
↓ 1 callersFunctionallow_nested_expression
Returns `true` if this is a dunder method that is excusable in a nested expression. Some methods are otherwise unusable in lambda expressions and else
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs:589
↓ 1 callersMethodallow_trailing_comma
Returns `true` if a trailing comma is allowed in the current context.
crates/ruff_python_parser/src/parser/mod.rs:1245
↓ 1 callersFunctionallowed_dunder_constants
Return `true` if this is a dunder method that is allowed to be called explicitly.
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs:248
↓ 1 callersMethodallows_concatenation_with_self_environment
Whether paths with this origin should allow combination with paths with a [`SysPrefixPathOrigin::SelfEnvironment`] origin.
crates/ty_site_packages/src/lib.rs:2244
← previousnext →7,601–7,700 of 31,562, ranked by callers