MCPcopy Create free account

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

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

↓ 2 callersFunctiontyped_dict_with_relaxed_keys
Returns a `TypedDict` schema for mixed positional-constructor inference. Keys that are guaranteed to be overridden by later keyword arguments stay in
crates/ty_python_semantic/src/types/typed_dict.rs:2319
↓ 2 callersMethodtypes
(&self)
crates/ty_python_semantic/src/types/signatures.rs:828
↓ 2 callersFunctiontyping_optional
Format the expression as a `typing.Optional`-style optional.
crates/ruff_python_ast/src/helpers.rs:1726
↓ 2 callersFunctiontyping_symbol
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, symbol: &str, )
crates/ty_python_semantic/src/place.rs:740
↓ 2 callersFunctionu32_index_to_usize
(index: u32)
crates/ty_server/src/document/range.rs:246
↓ 2 callersMethodunannotated_collection_initializer_binding
If the given expression is a use of an unannotated collection initializer, returns the definition of the initializer.
crates/ty_python_core/src/builder.rs:1095
↓ 2 callersMethodunbound_instance_method
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/protocol_class.rs:1458
↓ 2 callersFunctionunbound_member_contract
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, owner: ClassType<'db>, name: &str, kind:
crates/ty_python_semantic/src/types/overrides/attributes.rs:151
↓ 2 callersMethodunderline
(&self, is_primary: bool)
crates/ruff_annotate_snippets/src/renderer/mod.rs:350
↓ 2 callersFunctionunescape_parameter_name
Removes the backslashes that escape `*` in reStructuredText, so that `\*\*kwargs` (or `\\*\\*kwargs` in a non-raw docstring) is treated as `**kwargs`.
crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs:1976
↓ 2 callersMethodunion
(self, other: Self)
crates/ty_python_core/src/lib.rs:1040
↓ 2 callersFunctionunique_value
(log: str, pattern: str, label: str)
scripts/collect_ty_ecosystem_run_metadata.py:98
↓ 2 callersFunctionunittest_raises_assertion
(call: &ast::ExprCall, extra_edits: Vec<Edit>, checker: &Checker)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/assertion.rs:478
↓ 2 callersMethodunknown_specialization
Specializes every type parameter to its unknown form. The built-in `tuple` also needs an explicit variable-length tuple shape so that materialization
crates/ty_python_semantic/src/types/generics.rs:964
↓ 2 callersMethodunknown_type_mappings
( &self, generic_context: GenericContext<'db>, )
crates/ty_python_semantic/src/types/generics.rs:3454
↓ 2 callersFunctionunnecessary_hint_to_lsp_diagnostic
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, hint: &Hint, )
crates/ty_server/src/server/api/diagnostics.rs:422
↓ 2 callersFunctionunnecessary_hints_to_lsp_diagnostics
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, hints: &[Hint], )
crates/ty_server/src/server/api/diagnostics.rs:409
↓ 2 callersMethodunpack
Unpack the value to the target expression.
crates/ty_python_semantic/src/types/unpacker.rs:80
↓ 2 callersFunctionunpacked_keyword_is_gradual
(db: &'db dyn Db, ty: Type<'db>)
crates/ty_python_semantic/src/types/typed_dict.rs:2182
↓ 2 callersFunctionunparse_expr_in_sequence
(expr: &Expr, checker: &Checker)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:791
↓ 2 callersMethodunparse_interpolated_string
Unparse `values` with [`Generator::unparse_f_string_body`], using `quote` as the preferred surrounding quote style.
crates/ruff_python_codegen/src/generator.rs:1601
↓ 2 callersMethodunparse_interpolated_string_body
( &mut self, values: &[ast::InterpolatedStringElement], flags: AnyStringFlags, )
crates/ruff_python_codegen/src/generator.rs:1493
↓ 2 callersMethodunparse_parameter
(&mut self, parameter: &Parameter)
crates/ruff_python_codegen/src/generator.rs:1432
↓ 2 callersMethodunparse_string_literal
(&mut self, string_literal: &ast::StringLiteral)
crates/ruff_python_codegen/src/generator.rs:1465
↓ 2 callersFunctionunreachable_ranges
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/types/ide_support/unreachable_code.rs:48
↓ 2 callersFunctionunused_bindings
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/types/ide_support/unused_bindings.rs:105
↓ 2 callersMethodunused_self_typevar
Returns the receiver's `Self` type variable if it is unused in the rest of the signature.
crates/ty_python_semantic/src/types/signatures.rs:1932
↓ 2 callersMethodunwrap_suppression_starts
(&self)
crates/ruff_python_formatter/src/verbatim.rs:531
↓ 2 callersMethodupdate
( &mut self, cells: Option<lsp_types::NotebookDocumentCellChanges>, metadata_change: O
crates/ruff_server/src/edit/notebook.rs:110
↓ 2 callersFunctionupdateFragmentLinks
()
docs/js/rule-filters.js:193
↓ 2 callersFunctionupdateURL
(clearFragment = false)
docs/js/rule-filters.js:200
↓ 2 callersMethodupdate_cell_content
Update the cell contents with the transformed content. Returns `true` if a cell separator was removed and the source code and cell offsets need to be
crates/ruff_notebook/src/notebook.rs:302
↓ 2 callersMethodupdate_environment_error
Update or clear the environment error while retaining the last working search paths.
crates/ty_project/src/lib.rs:351
↓ 2 callersMethodupdate_max_precedence_with_count
(&mut self, precedence: OperatorPrecedence, count: u32)
crates/ruff_python_formatter/src/expression/mod.rs:629
↓ 2 callersMethodupdate_options
(&mut self, options: JsValue)
crates/ty_wasm/src/lib.rs:153
↓ 2 callersMethodupdate_signature_generic_context
Updates the generic context of a [`Signature`] according to the current type mapping. Returns `None` if the mapping removes all type variables from t
crates/ty_python_semantic/src/types.rs:11735
↓ 2 callersMethodupdate_version
(&mut self, new_version: DocumentVersion)
crates/ty_server/src/document/text_document.rs:143
↓ 2 callersMethoduriForPath
(path: string)
playground/ty/src/Editor/Editor.tsx:986
↓ 2 callersFunctionuseTheme
()
playground/shared/src/theme.ts:8
↓ 2 callersMethoduse_uv
(&self, system: &dyn System)
crates/ty_server/src/session/options.rs:102
↓ 2 callersFunctionuser_config_directory_env_var
()
crates/ty/tests/common/mod.rs:180
↓ 2 callersMethoduses_enclosing_snapshots
(self)
crates/ty_python_semantic/src/place_load.rs:1200
↓ 2 callersMethoduses_locals
Returns `true` if this scope uses locals (e.g., `locals()`).
crates/ruff_python_semantic/src/scope.rs:160
↓ 2 callersMethoduses_special_method_lookup
Returns whether this member is dispatched through special-method lookup on the type. The names are the methods registered in CPython's `slotdefs` tab
crates/ty_python_semantic/src/types/protocol_class.rs:2299
↓ 2 callersMethoduses_star_imports
Returns `true` if this scope contains a star import (e.g., `from sys import *`).
crates/ruff_python_semantic/src/scope.rs:140
↓ 2 callersMethodvalid_first_argument_name
(self)
crates/ruff_linter/src/rules/pep8_naming/rules/invalid_first_argument_name.rs:189
↓ 2 callersMethodvalidate_assignment_type
Checks an assigned value against its target's declared type and reports any mismatch. Returns `true` when the value is assignable, even if the strict
crates/ty_python_semantic/src/types/infer/builder.rs:2016
↓ 2 callersFunctionvalidate_ast
Verifies that: the range of the parent node fully encloses all its child nodes the ranges are strictly increasing when traversing the nodes in pre-ord
crates/ruff_python_parser/tests/fixtures.rs:431
↓ 2 callersMethodvalidate_attribute_assignment
Make sure that the attribute assignment `obj.attribute = value` is valid. `target` is the node for the left-hand side, `object_ty` is the type of `ob
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:34
↓ 2 callersMethodvalidate_class_pattern
(&mut self, pattern: &ast::PatternMatchClass, cls_ty: Type<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:2857
↓ 2 callersMethodvalidate_constrained
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Con
crates/ty_python_semantic/src/types/constraints/solutions.rs:1142
↓ 2 callersFunctionvalidate_extracted_typed_dict_keys
Validates a set of extracted `TypedDict`-like keys against a constructor target. This is shared by `**kwargs` validation and mixed constructor calls
crates/ty_python_semantic/src/types/typed_dict.rs:2375
↓ 2 callersFunctionvalidate_extracted_typed_dict_openness
Validates the arbitrary keys of a `TypedDict`-shaped constructor argument. The source's effective extra items must be valid for every target field th
crates/ty_python_semantic/src/types/typed_dict.rs:2416
↓ 2 callersMethodvalidate_generator_yield_type
( &self, yielded_value: impl Ranged, yield_kind: YieldKind, return_type_span:
crates/ty_python_semantic/src/types/infer/builder.rs:10481
↓ 2 callersMethodvalidate_generic_class_attribute_access
Reject access to a generic instance attribute through a class while retaining the normal attribute type for recovery. Reads and writes use the same re
crates/ty_python_semantic/src/types/infer/builder.rs:11139
↓ 2 callersMethodvalidate_impl
( &self, db: &'db dyn Db, ty: Type<'db>, mut validate: impl FnMut(Type<'db>) -
crates/ty_python_semantic/src/types/call/bind.rs:11504
↓ 2 callersFunctionvalidate_inline_snapshot
( db: &dyn Db, tool_name: &'static str, test_file: &TestFile<'_>, inline_diagnostics: &[Diagno
crates/mdtest/src/lib.rs:357
↓ 2 callersFunctionvalidate_keyword_unpack_key_type
Validate the key type of a keyword-unpack argument without checking its value type.
crates/ty_python_semantic/src/types/call/bind.rs:5799
↓ 2 callersFunctionvalidate_merged_unpacked_keyword_argument
( context: &InferContext<'db, 'ast>, typed_dict: TypedDictType<'db>, expr: &'ast ast::Expr, un
crates/ty_python_semantic/src/types/typed_dict.rs:2990
↓ 2 callersFunctionvalidate_required_version
(required_version: &RequiredVersion)
crates/ruff_workspace/src/options.rs:617
↓ 2 callersMethodvalidate_satisfied_path
Having found a satisfiable path in the BDD, validates that path against the declared upper bound (TODO and constraints) of all relevant typevars.
crates/ty_python_semantic/src/types/constraints/solutions.rs:1058
↓ 2 callersMethodvalidate_subscript_assignment
Validate a subscript assignment of the form `object[key] = rhs_value`.
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:1720
↓ 2 callersFunctionvalidate_tokens
Verifies that: the ranges are strictly increasing when loop the tokens in insertion order all ranges are within the length of the source code
crates/ruff_python_parser/tests/fixtures.rs:402
↓ 2 callersFunctionvalidate_typed_dict_required_keys
Validates that all required keys are provided in a `TypedDict` construction. Reports errors for any keys that are required but not provided. Returns
crates/ty_python_semantic/src/types/typed_dict.rs:1778
↓ 2 callersMethodvalidate_typevar_default
Validate that a `TypeVar`'s default is compatible with its bound or constraints.
crates/ty_python_semantic/src/types/infer/builder/typevar.rs:166
↓ 2 callersMethodvalidation_config
Resolve compatibility behavior after inherited and local configuration has been merged.
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:469
↓ 2 callersMethodvalue
(self)
crates/ruff_formatter/src/format_element.rs:497
↓ 2 callersMethodvalue
(&self)
crates/ruff_python_formatter/src/expression/expr_yield.rs:22
↓ 2 callersMethodvalue_type_with_recursion
Resolve this alias while preserving active recursion guards. During meta-type projection, results can depend on which aliases or type variables are a
crates/ty_python_semantic/src/types/type_alias.rs:627
↓ 2 callersFunctionvariable_kind
Returns the variable kind for an attribute if it should participate in `ClassVar` override checks.
crates/ty_python_semantic/src/types/overrides.rs:1814
↓ 2 callersMethodvariance_receiver
Keeps `Self` symbolic while inspecting a class's interface. Substituting `C[T]` would incorrectly make a parameter annotated as `Self` consume the cla
crates/ty_python_semantic/src/types/variance.rs:17
↓ 2 callersMethodvariance_types
The exposed read and write types, with their positions in variance inference.
crates/ty_python_semantic/src/types/protocol_class.rs:910
↓ 2 callersMethodvariance_with_polarity
( self, db: &'db dyn Db, polarity: TypeVarVariance, )
crates/ty_python_semantic/src/types/typevar.rs:1343
↓ 2 callersMethodvendored
Looks up a vendored file by its path. Returns `Some` if a vendored file for the given path exists and `None` otherwise.
crates/ruff_db/src/files.rs:185
↓ 2 callersFunctionversion
Returns information about Ruff's version.
crates/ruff/src/version.rs:43
↓ 2 callersMethodversion
(&self)
crates/ty_server/src/session/index.rs:247
↓ 2 callersFunctionversion_always_less_than
Returns true if the `check_version` is always less than the [`PythonVersion`].
crates/ruff_linter/src/rules/pyupgrade/rules/outdated_version_block.rs:207
↓ 2 callersFunctionversion_builtin_was_added
Return `Some(version)`, where `version` corresponds to the Python minor version in which the builtin was added
crates/ruff_python_stdlib/src/builtins.rs:436
↓ 2 callersMethodviolations
(&self)
crates/ty_python_semantic/src/types/constraints.rs:4894
↓ 2 callersMethodvirtual_file
Create a new virtual file at the given path and store it for future lookups. This will always create a new file, overwriting any existing file at `pa
crates/ruff_db/src/files.rs:221
↓ 2 callersFunctionvirtual_path_not_found
(path: impl Display)
crates/ty_server/src/system.rs:352
↓ 2 callersMethodvisibility
(&self)
crates/ty_python_core/src/scope.rs:162
↓ 2 callersMethodvisible
(self)
crates/ty_python_core/src/lib.rs:895
↓ 2 callersMethodvisible_ancestor_scopes
See [`SemanticIndex::visible_ancestor_scopes`].
crates/ty_python_core/src/builder.rs:424
↓ 2 callersMethodvisit
(mut self, root: AnyNodeRef<'a>)
crates/ruff_python_formatter/src/comments/visitor.rs:54
↓ 2 callersMethodvisit_alias
(&mut self, alias: &'a Alias)
crates/ruff_python_ast/src/visitor.rs:69
↓ 2 callersMethodvisit_annotation
(&self, expr: &mut Expr)
crates/ruff_python_ast/src/visitor/transformer.rs:14
↓ 2 callersMethodvisit_annotation
(&mut self, expr: &'a Expr)
crates/ruff_linter/src/checkers/ast/mod.rs:1774
↓ 2 callersMethodvisit_arguments
(&self, arguments: &mut Arguments)
crates/ruff_python_ast/src/visitor/transformer.rs:44
↓ 2 callersFunctionvisit_assignments
(checker: &Checker, left: &Expr, right: &Expr)
crates/ruff_linter/src/rules/pylint/rules/self_assigning_variable.rs:80
↓ 2 callersMethodvisit_bool_op
(&mut self, bool_op: &'a BoolOp)
crates/ruff_python_ast/src/visitor.rs:39
↓ 2 callersMethodvisit_boolean_test
Visit a boolean test. A boolean test is an expression that Python tests for truthiness, such as an `if` condition or the operand of a `not` expressio
crates/ty_python_core/src/builder.rs:2312
↓ 2 callersMethodvisit_bytes_literal
(&mut self, bytes_literal: &'a BytesLiteral)
crates/ruff_python_ast/src/visitor.rs:114
↓ 2 callersMethodvisit_callable_type
(&self, db: &'db dyn Db, callable: CallableType<'db>)
crates/ty_python_semantic/src/types/generics.rs:840
↓ 2 callersMethodvisit_callable_type
(&self, db: &'db dyn Db, callable: CallableType<'db>)
crates/ty_python_semantic/src/types/constraints/resolution.rs:226
↓ 2 callersMethodvisit_cmp_op
(&mut self, cmp_op: &'a CmpOp)
crates/ruff_python_ast/src/visitor.rs:48
↓ 2 callersMethodvisit_comprehension
(&mut self, comprehension: &'_ crate::Comprehension)
crates/ruff_python_ast/src/helpers.rs:1240
↓ 2 callersMethodvisit_comprehension
(&mut self, comprehension: &'a Comprehension)
crates/ruff_linter/src/rules/flake8_bugbear/rules/reuse_of_groupby_generator.rs:238
↓ 2 callersMethodvisit_constraint
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Con
crates/ty_python_semantic/src/types/constraints/solutions.rs:586
↓ 2 callersMethodvisit_expr
(&mut self, expr: &'a Expr)
crates/ruff_python_ast/src/helpers.rs:1124
← previousnext →7,201–7,300 of 31,562, ranked by callers