MCPcopy Create free account

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

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

↓ 3 callersMethodsource_parameter_index
Returns the original source parameter's position before variadic expansion.
crates/ty_python_semantic/src/types/signatures.rs:6119
↓ 3 callersFunctionsource_position
Creates a source map entry from the passed source `position` to the position in the formatted output. ## Examples ``` use ruff_formatter::format; us
crates/ruff_formatter/src/builders.rs:319
↓ 3 callersMethodsource_type
(self, db: &dyn Db)
crates/ruff_db/src/files.rs:577
↓ 3 callersFunctionspam
()
crates/ruff_python_parser/resources/inline/ok/decorator_expression_py39.py:3
↓ 3 callersMethodspan
Conveniently create a `Span` that points into a file in this environment. The path given must have been added via `TestEnvironment::add`. The offset
crates/ruff_db/src/diagnostic/render.rs:2631
↓ 3 callersMethodspan
Attempt to resolve a [`Span`] that corresponds to the location of the configuration setting that specified the Python version. Useful for subdiagnost
crates/ty_site_packages/src/version.rs:68
↓ 3 callersMethodspan_to_lines
(&self, span: Range<usize>)
crates/ruff_annotate_snippets/src/renderer/source_map.rs:150
↓ 3 callersMethodspan_to_snippet
(&self, span: Range<usize>)
crates/ruff_annotate_snippets/src/renderer/source_map.rs:146
↓ 3 callersMethodspeak
()
crates/ruff_linter/resources/test/fixtures/pylint/super_without_brackets.py:3
↓ 3 callersMethodspec
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/enum_literal.rs:155
↓ 3 callersMethodspecialize_tuple
Creates a specialization of this generic context for the `tuple` class.
crates/ty_python_semantic/src/types/generics.rs:1120
↓ 3 callersFunctionsplit_once_at_top_level_colon
Splits at the first top-level colon, ignoring colons inside brackets and quoted strings. Bracket kinds are tracked independently, so mismatched nesti
crates/ty_ide/src/docstring/document/syntax.rs:506
↓ 3 callersFunctionsplit_whitespace_with_maxsplit
From the Python documentation: > If sep is not specified or is None, a different splitting algorithm is applied: runs of > consecutive whitespace are
crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs:381
↓ 3 callersMethodstart_token
(self)
crates/ruff_python_parser/src/string.rs:50
↓ 3 callersFunctionstarts_with_markdown_list_item
Returns whether `line` starts with a `CommonMark` list-item marker. `CommonMark` limits ordered-list markers to nine digits to avoid integer overflow
crates/ty_ide/src/docstring/document/syntax.rs:45
↓ 3 callersMethodstate_mut
(&mut self)
crates/ruff_formatter/src/buffer.rs:155
↓ 3 callersMethodstore_expected_type
(&mut self, expression: impl Into<ExpressionNodeKey>, ty: Type<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:7344
↓ 3 callersMethodstore_typed_dict_key_expected_type
(&mut self, slice: &ast::Expr, value_ty: Type<'db>)
crates/ty_python_semantic/src/types/infer/builder/subscript.rs:123
↓ 3 callersMethodstring_flags
Returns true if the current token is a string and it is raw.
crates/ruff_python_ast/src/token.rs:82
↓ 3 callersFunctionstring_parser_escaped_eol
(eol: &str)
crates/ruff_python_parser/src/string.rs:548
↓ 3 callersFunctionstrip_underscores
(text: &str)
crates/ruff_python_parser/src/parser/mod.rs:997
↓ 3 callersMethodstructural_member_priority
Returns the priority for structurally comparing this member. Simple finite members are cheapest, followed by finite overloads. Recursive members and
crates/ty_python_semantic/src/types/protocol_class.rs:2278
↓ 3 callersFunctionstub_package_index
( db: &dyn Db, resolver_environment: ResolverEnvironment<'_>, )
crates/ty_module_resolver/src/resolve.rs:597
↓ 3 callersMethodsub_builder
Returns a builder for tersely constructing sub-diagnostics.
crates/ruff_db/src/diagnostic/render.rs:2695
↓ 3 callersMethodsub_warn
A convenience function for returning a builder for a sub-diagnostic with "error" severity and canned values for its identifier and message.
crates/ruff_db/src/diagnostic/render.rs:2673
↓ 3 callersMethodsubtract
(mut self, other: &Self)
crates/ruff_linter/src/registry/rule_set.rs:109
↓ 3 callersMethodsuffix
Return the suffix for the [`NoqaCode`], e.g., `101` for `SIM101`.
crates/ruff_linter/src/codes.rs:29
↓ 3 callersFunctionsuite_ends_with_exit
Return `true` if `suite` ends in an exit recognized by the redundant-condition heuristic. Both kinds of exit accept the following final statements: -
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:1267
↓ 3 callersMethodsummary_after_section_name
Returns the rest of the summary line after the section name.
crates/ruff_linter/src/docstrings/sections.rs:340
↓ 3 callersFunctionsupertypes
Sends a `typeHierarchy/supertypes` request.
crates/ty_server/tests/e2e/type_hierarchy.rs:178
↓ 3 callersMethodsupport_data
(&self, support: SupportId)
crates/ty_python_semantic/src/types/constraints.rs:1547
↓ 3 callersMethodsupports_inlay_hint_refresh
Returns `true` if the client supports inlay hint refresh.
crates/ty_server/src/capabilities.rs:104
↓ 3 callersMethodsupports_self_binding
Returns `true` if this type supports eager `Self` binding via `bind_self_typevars`. `FunctionLiteral`, `BoundMethod`, and function-like `Callable` ty
crates/ty_python_semantic/src/types.rs:2597
↓ 3 callersMethodsupports_variance_inference
Structural variance inference currently excludes recursive type aliases and descriptor writes whose accepted values cannot be represented by a single
crates/ty_python_semantic/src/types/protocol_class.rs:86
↓ 3 callersMethodsuppress_diagnostics
Prevents diagnostic construction for this inference context.
crates/ty_python_semantic/src/types/context.rs:301
↓ 3 callersFunctionsuspicious_function
S301, S302, S303, S304, S305, S306, S307, S308, S310, S311, S312, S313, S314, S315, S316, S317, S318, S319, S320, S321, S323
crates/ruff_linter/src/rules/flake8_bandit/rules/suspicious_function_call.rs:1018
↓ 3 callersFunctionsynthesize_typed_dict_method
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, typed_dict: TypedDictType<'db>, method_name:
crates/ty_python_semantic/src/types/class/typed_dict.rs:34
↓ 3 callersMethodtarget
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1299
↓ 3 callersMethodtargets
Returns iterator over indices of blocks targeted by given edges
crates/ruff_python_semantic/src/cfg/graph.rs:129
↓ 3 callersFunctiontest_contents_syntax_errors
A custom test runner that prints syntax errors in addition to other diagnostics. Adapted from `flakes` in pyflakes/mod.rs.
crates/ruff_linter/src/linter.rs:947
↓ 3 callersMethodtest_system
(&self)
crates/ty_project/src/db.rs:850
↓ 3 callersMethodtest_system
(&self)
crates/ruff_db/src/lib.rs:206
↓ 3 callersMethodtext
Returns the source text
crates/ruff_source_file/src/lib.rs:83
↓ 3 callersMethodtext_document_language_id
(&self)
crates/ruff_server/src/session/index.rs:671
↓ 3 callersMethodtext_documents_diagnostics_async
( self, files: list[Path] )
scripts/ty_benchmark/src/benchmark/lsp_client.py:139
↓ 3 callersMethodto_absolute_line_number
Returns the absolute line number in the markdown file for a given line number relative to the concatenated code blocks. Returns an `Err` if the relat
crates/mdtest/src/parser.rs:317
↓ 3 callersMethodto_class_type
Turn a class literal (`Type::ClassLiteral` or `Type::GenericAlias`) into a `ClassType`. Since a `ClassType` must be specialized, apply the default spe
crates/ty_python_semantic/src/types.rs:3242
↓ 3 callersMethodto_code_block_backtick_offsets
(&self)
crates/mdtest/src/lib.rs:309
↓ 3 callersMethodto_import_alias_resolution
(self)
crates/ty_ide/src/references.rs:61
↓ 3 callersMethodto_index
(&self)
crates/ruff_linter/src/locator.rs:36
↓ 3 callersMethodto_log_function
(self)
crates/ruff_linter/src/rules/refurb/rules/redundant_log_base.rs:128
↓ 3 callersFunctionto_lsp_diagnostic
Converts the tool specific [`Diagnostic`][ruff_db::diagnostic::Diagnostic] to an LSP [`Diagnostic`].
crates/ty_server/src/server/api/diagnostics.rs:440
↓ 3 callersMethodto_meta_type
Compute the metatype of this `type[T]`. For a concrete class `C`, this returns `type[M]`, where `M` is its guaranteed metaclass, excluding the lookup
crates/ty_python_semantic/src/types/subclass_of.rs:347
↓ 3 callersMethodto_meta_type_with_recursion
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, context: &TypeRecursio
crates/ty_python_semantic/src/types.rs:9461
↓ 3 callersMethodto_metaclass_instance
Return a type representing "the set of all instances of the metaclass of this type".
crates/ty_python_semantic/src/types/subclass_of.rs:328
↓ 3 callersMethodto_non_generic_instance
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:3405
↓ 3 callersMethodto_notebook_range
( &self, text: &str, source_index: &LineIndex, notebook_index: &NotebookIndex,
crates/ruff_server/src/edit/range.rs:82
↓ 3 callersMethodto_py_format_options
(&self, file: &Path)
crates/ruff_dev/src/format_dev.rs:947
↓ 3 callersMethodto_ruff_args
(self)
python/ruff-ecosystem/ruff_ecosystem/projects.py:308
↓ 3 callersMethodto_ruff_notebook
Generates a pseudo-representation of a notebook that lacks per-cell metadata and contextual information but should still work with Ruff's linter.
crates/ty_server/src/document/notebook.rs:71
↓ 3 callersMethodto_source_code
(&self)
crates/ruff_linter/src/locator.rs:41
↓ 3 callersFunctionto_string
TODO: rewrite using format_general
crates/ruff_python_literal/src/float.rs:6
↓ 3 callersMethodto_text_range
( &self, db: &dyn Db, file: File, uri: &lsp_types::Uri, encoding: Posi
crates/ty_server/src/document/range.rs:99
↓ 3 callersMethodto_text_range
( &self, text: &str, index: &LineIndex, encoding: PositionEncoding, )
crates/ruff_server/src/edit/range.rs:35
↓ 3 callersMethodto_update_patch
Returns a patch version of this `TypedDict` for in-place mutations such as `update()` and `__ior__` (`|=`). All fields become optional, and read-only
crates/ty_python_semantic/src/types/typed_dict.rs:671
↓ 3 callersMethodtop_kind
Returns the [`TagKind`] of the current stack frame or [None] if this is the root stack frame.
crates/ruff_formatter/src/printer/call_stack.rs:170
↓ 3 callersMethodtop_materialized_upper_bound
Returns the static upper bound used when materializing a gradual type argument. Constraints are unioned only when materializing an exposed member, wh
crates/ty_python_semantic/src/types/typevar.rs:1561
↓ 3 callersFunctiontrailing_comment_start_offset
If a [`Ranged`] has a trailing comment, return the index of the hash.
crates/ruff_python_ast/src/whitespace.rs:26
↓ 3 callersMethodtransform
(&self, filesystem_configuration: Configuration)
crates/ruff_server/src/session/index/ruff_settings.rs:372
↓ 3 callersMethodtranslate_source_location
Translates the given [`SourceLocation`] based on the indexing table. This will translate the line/character in the concatenated source code to the li
crates/ruff_notebook/src/index.rs:64
↓ 3 callersMethodtraversal_budget
(&self)
crates/ty_python_semantic/src/types/constraints.rs:3781
↓ 3 callersFunctiontraverse_union_and_optional
Traverse a "union" type annotation, applying `func` to each union member. Supports traversal of `Union`, `|`, and `Optional` union expressions. The
crates/ruff_python_semantic/src/analyze/typing.rs:490
↓ 3 callersMethodtruthiness
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, left: Type<'db>,
crates/ty_python_semantic/src/types/infer/comparisons.rs:702
↓ 3 callersMethodtry_compare
(self, other: Indentation)
crates/ruff_python_parser/src/lexer/indentation.rs:72
↓ 3 callersMethodtry_into_expression
Attempts to convert the [`Parsed<Mod>`] into a [`Parsed<ModExpression>`]. This method checks if the `syntax` field of the output is a [`Mod::Expressi
crates/ruff_python_parser/src/lib.rs:521
↓ 3 callersMethodtry_member_lookup
Performs member lookup while retaining errors from implicit attribute-access methods.
crates/ty_python_semantic/src/types.rs:5926
↓ 3 callersMethodtry_mro
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/enum_literal.rs:203
↓ 3 callersMethodtry_parse_type_params
Try to parse a type parameter list. If the parser is not at the start of a type parameter list, return `None`. See: <https://docs.python.org/3/refere
crates/ruff_python_parser/src/parser/statement.rs:3625
↓ 3 callersMethodtry_scoped_use
( &self, scope: FileScopeId, key: impl Into<ExpressionNodeKey>, )
crates/ty_python_core/src/ast_ids.rs:100
↓ 3 callersMethodtry_stop_watch
( &mut self, mut matcher: M, timeout: Duration, )
crates/ty/tests/file_watching.rs:142
↓ 3 callersMethodtry_upcast_to_callable_with_policy_and_context
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, policy: UpcastPolicy,
crates/ty_python_semantic/src/types/callable.rs:217
↓ 3 callersMethodtry_visit
( &self, db: &'db dyn Db, item: T, reuse_cached: impl FnOnce(&R) -> bool,
crates/ty_python_semantic/src/types/cyclic.rs:931
↓ 3 callersFunctiontuple_literal_needs_promotion
Applies the tuple precision limit after expanding literal elements. For `(*[1, 2], 3)`, all three positions count, even though the outer tuple has onl
crates/ty_python_semantic/src/types/unpacker.rs:657
↓ 3 callersMethodty
Return the union of all contributions to this binding.
crates/ty_python_semantic/src/types/narrow.rs:354
↓ 3 callersFunctiontype_alias_arguments
Find the `name` and `value` arguments to `TypeAliasType`. If either is supplied twice, use the positional argument for error recovery.
crates/ty_python_semantic/src/types/type_alias.rs:313
↓ 3 callersMethodtype_check_only
(mut self, yes: bool)
crates/ty_ide/src/completion.rs:619
↓ 3 callersMethodtype_form_argument
Return the type denoted by this retained special-form value when it is valid without parameters or a surrounding inference scope.
crates/ty_python_semantic/src/types/special_form.rs:215
↓ 3 callersFunctiontype_hierarchy_class_to_item
( db: &'db dyn Db, class: TypeHierarchyClass<'db>, )
crates/ty_ide/src/type_hierarchy.rs:104
↓ 3 callersFunctiontype_narrowed_by_previous_patterns
Narrow the subject by preceding match patterns with no guard or an always-true guard. Caching the subject type narrowed by the patterns before each c
crates/ty_python_semantic/src/reachability.rs:254
↓ 3 callersFunctiontype_param_name
Returns the value of the `name` parameter to, e.g., a `TypeVar` constructor.
crates/ruff_linter/src/rules/pylint/helpers.rs:19
↓ 3 callersMethodtype_satisfies_protocol_member
Return `true` if `ty` provides every access required by this protocol member.
crates/ty_python_semantic/src/types/protocol_class.rs:3030
↓ 3 callersFunctiontyped_dict_class_member
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, class: ClassType<'db>, module: TypingModule,
crates/ty_python_semantic/src/types/class/typed_dict.rs:1096
↓ 3 callersFunctiontyped_dict_fallback_class_member
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, module: TypingModule, lookup_policy: MemberL
crates/ty_python_semantic/src/types/class/typed_dict.rs:1078
↓ 3 callersFunctiontypeshed_test_case
( typeshed: MockedTypeshed, python_version: PythonVersion, )
crates/ty_module_resolver/src/path.rs:1251
↓ 3 callersMethodtypeshed_versions
(&self)
crates/ty_module_resolver/src/resolve.rs:1006
↓ 3 callersMethodtypevartuple
(self)
crates/ty_python_semantic/src/types/tuple.rs:945
↓ 3 callersFunctiontyping_extensions_symbol
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, symbol: &str, )
crates/ty_python_semantic/src/place.rs:753
↓ 3 callersFunctiontyping_module_for_fix
Selects a runtime typing module for a fix, checking declared dependencies and installed exports when the requested member needs a backport.
crates/ty_python_semantic/src/types/diagnostic.rs:3347
↓ 3 callersMethodunannotated_collection_initializer
If this is a potentially constraining use of an unannotated collection initializer, returns its definition.
crates/ty_python_core/src/lib.rs:596
↓ 3 callersMethodundeclared_reachability_constraint
( &self, )
crates/ty_python_core/src/use_def/place_state.rs:182
← previousnext →4,701–4,800 of 31,766, ranked by callers