Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,766 in github.com/astral-sh/ruff
⨍
Functions
31,766
◇
Types & classes
7,128
↳
Endpoints
82
↓ 2 callers
Function
thread_priority_to_qos_class
(priority: ThreadPriority)
crates/ty_server/src/server/schedule/thread/priority.rs:50
↓ 2 callers
Function
thread_priority_to_qos_class
(priority: ThreadPriority)
crates/ruff_server/src/server/schedule/thread/priority.rs:50
↓ 2 callers
Function
toDisplayDiagnosticDetail
(item: { message: string; severity?: string; location: DiagnosticLocation | null; })
playground/ty/src/Editor/Diagnostics.tsx:260
↓ 2 callers
Method
to_annotate
Convert this to an "annotate" snippet.
crates/ruff_db/src/diagnostic/render.rs:474
↓ 2 callers
Method
to_callable_type
Reifies captured parameter lists as callables for argument matching and checking.
crates/ty_python_semantic/src/types.rs:2237
↓ 2 callers
Method
to_diagnostic_message
(&self, path: Option<impl std::fmt::Display>)
crates/ruff_db/src/panic.rs:43
↓ 2 callers
Method
to_hierarchical
Turns this flat sequence of symbols into a hierarchy of symbols.
crates/ty_ide/src/symbols.rs:162
↓ 2 callers
Method
to_iter
(self)
crates/ruff_linter/src/rules/flake8_pyi/rules/bad_generator_return_type.rs:338
↓ 2 callers
Function
to_lsp_diagnostic
Generates an LSP diagnostic with an associated cell index for the diagnostic to go in. If the source kind is a text document, the cell index will alwa
crates/ruff_server/src/lint.rs:371
↓ 2 callers
Method
to_lsp_diagnostics
( &self, db: &ProjectDatabase, client_capabilities: ResolvedClientCapabilities, )
crates/ty_server/src/server/api/diagnostics.rs:108
↓ 2 callers
Method
to_lsp_position
( &self, db: &dyn Db, file: File, encoding: PositionEncoding, )
crates/ty_server/src/document/range.rs:205
↓ 2 callers
Method
to_module_name
(&self)
crates/ty_module_resolver/src/path.rs:169
↓ 2 callers
Function
to_module_path
Create a module path from a (package, path) pair. For example, if the package is `foo/bar` and the path is `foo/bar/baz.py`, the call path is `["baz"
crates/ruff_python_ast/src/helpers.rs:1003
↓ 2 callers
Method
to_partial
Returns a partial version of this `TypedDict` where all fields are optional. This is used to model non-mutating PEP 584 merge operands, accepting dict
crates/ty_python_semantic/src/types/typed_dict.rs:655
↓ 2 callers
Function
to_pep604_operator
Return the PEP 604 operator variant to which the given subscript [`Expr`] corresponds, if any.
crates/ruff_python_semantic/src/analyze/typing.rs:221
↓ 2 callers
Method
to_python_version
(self)
crates/ty_project/src/metadata/python_version.rs:68
↓ 2 callers
Method
to_settings
Lazily resolves the client options to the settings.
crates/ruff_server/src/session/settings.rs:55
↓ 2 callers
Method
to_settings_arc
Lazily resolves the client options to the settings.
crates/ruff_server/src/session/settings.rs:60
↓ 2 callers
Method
to_string
Construct the line from the components
python/ruff-ecosystem/ruff_ecosystem/check.py:388
↓ 2 callers
Method
to_text_range
( self, line_index: &LineIndex, source: &str, position_encoding: PositionEncod
crates/ty_wasm/src/lib.rs:1134
↓ 2 callers
Method
to_unpromotable
(self)
crates/ty_python_semantic/src/types/literal.rs:169
↓ 2 callers
Function
toggleTheme
(theme: Theme)
playground/shared/src/theme.ts:37
↓ 2 callers
Function
token_kind_to_cmp_op
Converts a [`TokenKind`] into its corresponding [`CmpOp`]. `next` is only needed to distinguish `is not` and `not in`.
crates/ruff_python_parser/src/parser/helpers.rs:36
↓ 2 callers
Method
token_range
(&self)
crates/ruff_linter/src/noqa.rs:690
↓ 2 callers
Function
tokenize_range
(source: &'static str, range: TextRange)
crates/ruff_python_trivia_integration_tests/tests/simple_tokenizer.rs:35
↓ 2 callers
Method
tokens_trimmed
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:156
↓ 2 callers
Function
top_level_field_lists
Returns top-level field lists that begin at a reST block boundary. `source` must have already undergone PEP-257 trimming and universal newline normal
crates/ty_ide/src/docstring/document/rst.rs:25
↓ 2 callers
Method
total_ordering_root_method
Returns the type of the ordering method used by `@total_ordering`, if any. Following `functools.total_ordering` precedence, we prefer `__lt__` > `__l
crates/ty_python_semantic/src/types/class/static_literal.rs:331
↓ 2 callers
Method
trace_level
(self)
crates/ty_server/src/logging.rs:94
↓ 2 callers
Method
trace_level
(self)
crates/ruff_server/src/logging.rs:102
↓ 2 callers
Method
trailing
The text between the expression and the conversion, the `format_spec`, or the `}`.
crates/ruff_python_ast/src/nodes.rs:541
↓ 2 callers
Method
trailing_binary_comments
(&self)
crates/ruff_python_formatter/src/expression/binary_like.rs:837
↓ 2 callers
Function
trailing_function_or_class_def
Find nested class or function definitions that need an empty line after them. ```python def f(): if True: def double(s): return s + s print("below
crates/ruff_python_formatter/src/statement/suite.rs:521
↓ 2 callers
Function
trailing_quote
Return the trailing quote string for a string, template, or bytes literal (e.g., `"""`).
crates/ruff_python_ast/src/str.rs:309
↓ 2 callers
Method
translate_line_column
Translates the given [`LineColumn`] based on the indexing table. This will translate the row/column in the concatenated source code to the row/column
crates/ruff_notebook/src/index.rs:51
↓ 2 callers
Function
transparent_callable_decorator_result
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, bindings: &Bindings<'db>, decorated_ty: Type
crates/ty_python_semantic/src/types/infer/builder.rs:444
↓ 2 callers
Function
traverse_union_options
( func: &mut F, semantic: &SemanticModel, expr: &'a Expr, options: UnionTraversalOptions, )
crates/ruff_python_semantic/src/analyze/typing.rs:512
↓ 2 callers
Method
trim_start_str
Trims at most `indent_len` indentation from the beginning of `line`. This is useful when one needs to trim some minimum level of indentation from a c
crates/ruff_python_formatter/src/string/docstring.rs:1816
↓ 2 callers
Method
truthiness
Return `Uninhabited` when evaluation cannot produce either boolean outcome.
crates/ty_python_semantic/src/types/infer/expression_truthiness.rs:66
↓ 2 callers
Method
try_add_project_root
(&self, db: &dyn Db)
crates/ty_project/src/metadata.rs:432
↓ 2 callers
Method
try_bool_impl
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, allow_short_circuit:
crates/ty_python_semantic/src/types/bool.rs:66
↓ 2 callers
Method
try_build
(self)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1438
↓ 2 callers
Method
try_check_protocol_receiver_pair
Prove receiver compatibility without unfolding two instances of the same protocol. A target receiver restriction `P[B]` implies a source restriction
crates/ty_python_semantic/src/types/protocol_class.rs:2712
↓ 2 callers
Method
try_class_metadata_ancestors
Resolve ancestors in MRO order without specializing a synthetic tuple base with its fields.
crates/ty_python_semantic/src/types/class/static_literal.rs:911
↓ 2 callers
Method
try_expected_type
( &self, expression: impl Into<ExpressionNodeKey>, )
crates/ty_python_semantic/src/types/infer.rs:1159
↓ 2 callers
Method
try_expression_use_id
Returns the recorded use of an expression, if it loads a tracked place.
crates/ty_python_core/src/lib.rs:370
↓ 2 callers
Method
try_from_string
Parse the rule code from a diagnostic line string
python/ruff-ecosystem/ruff_ecosystem/check.py:415
↓ 2 callers
Method
try_get_for_declared_type
Returns the type of this argument when inferred against the provided declared type. An unannotated parameter supplies no expected type. Use the resul
crates/ty_python_semantic/src/types/call/arguments.rs:491
↓ 2 callers
Method
try_map_impl
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, mut transform_fn: impl
crates/ty_python_semantic/src/types/set_theoretic.rs:482
↓ 2 callers
Method
try_map_union
Limit intermediate unions as well as the final result: waiting until all operands have been expanded can first construct an exponentially large union
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:81
↓ 2 callers
Method
try_mro_ancestors
Return this class's ancestors in [method resolution order] ("MRO"), excluding the class itself. If the MRO is unresolvable, return an error indicating
crates/ty_python_semantic/src/types/class/static_literal.rs:895
↓ 2 callers
Function
try_pattern_binding_fallthrough_type
Compute binding fallthrough while charging every nested exact-tuple expansion to `budget`. An error means that the caller must discard the partially
crates/ty_python_semantic/src/types/match_pattern.rs:1040
↓ 2 callers
Method
try_solve_with
Checks each retained solution before collecting it or solving the next path.
crates/ty_python_semantic/src/types/constraints.rs:4174
↓ 2 callers
Method
try_take_watch_changes
( &self, mut matcher: M, timeout: Duration, )
crates/ty/tests/file_watching.rs:199
↓ 2 callers
Method
try_typed_dict_pep_584_dunder
( &mut self, update: &ast::Expr, update_context_typed_dict: TypedDictType<'db>,
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:318
↓ 2 callers
Method
try_use_id
(&self, key: impl Into<ExpressionNodeKey>)
crates/ty_python_core/src/ast_ids.rs:250
↓ 2 callers
Method
tuple_class_type
Returns the type used for the builtin tuple class's single generic parameter. Preserve the `TypeVarTuple` here so that variance inference and generic
crates/ty_python_semantic/src/types/tuple.rs:963
↓ 2 callers
Function
two_cell_notebook
()
crates/ruff_notebook/src/notebook.rs:825
↓ 2 callers
Method
ty
(&self)
crates/ty_project/src/metadata/pyproject.rs:24
↓ 2 callers
Method
type
(self)
crates/ruff_linter/resources/test/fixtures/pycodestyle/E721.py:112
↓ 2 callers
Method
type_at_nonnegative_index_unbounded
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, index: usize, )
crates/ty_python_semantic/src/types/tuple.rs:2037
↓ 2 callers
Method
type_check_only
Returns whether this class is type-check only.
crates/ty_python_semantic/src/types/class.rs:873
↓ 2 callers
Function
type_expr
Given a [`PythonType`], return an [`Expr`] that resolves to that type. If the [`Expr`] relies on importing any external symbols, those imports will b
crates/ruff_linter/src/rules/flake8_annotations/helpers.rs:246
↓ 2 callers
Method
type_for_argument
Returns the inferred type for the argument at the specified index.
crates/ty_python_semantic/src/types/call/bind.rs:1538
↓ 2 callers
Function
type_hierarchy_subtypes
Get the subtypes (derived classes) of a type hierarchy item. This scans all available modules and can be expensive in large projects.
crates/ty_ide/src/type_hierarchy.rs:66
↓ 2 callers
Function
type_hierarchy_supertypes
Get the supertypes (base classes) of a type hierarchy item.
crates/ty_ide/src/type_hierarchy.rs:48
↓ 2 callers
Function
type_narrowed_after_pattern
( db: &'db dyn Db, predicate: PatternPredicate<'db>, expansion: PatternSubjectExpansion, )
crates/ty_python_semantic/src/reachability.rs:292
↓ 2 callers
Function
type_narrowed_by_pattern
Narrow `subject_ty` by a match pattern. If the case has no guard, or its guard is always true, the result is the subject type remaining after the cas
crates/ty_python_semantic/src/reachability.rs:329
↓ 2 callers
Function
type_retains_original_class
Return true if a type still contains the original class object, even if it also carries extra intersection members.
crates/ty_python_semantic/src/types/infer/builder/class.rs:597
↓ 2 callers
Method
type_satisfies_protocol_member_access
Checks the read and write capabilities required through instance access or class access. Reads are checked covariantly and writes contravariantly. Fo
crates/ty_python_semantic/src/types/protocol_class.rs:2941
↓ 2 callers
Method
type_signatures
When set, type signatures of each completion item are included in the snapshot. This is useful when one wants to specifically test types, but it usual
crates/ty_ide/src/completion.rs:11745
↓ 2 callers
Method
type_was_already_seen
(&self, ty: Type<'db>)
crates/ty_python_semantic/src/types/visitor.rs:384
↓ 2 callers
Function
typed_dict_inherited_class_member
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, typed_dict: TypedDictType<'db>, module: Typi
crates/ty_python_semantic/src/types/class/typed_dict.rs:1121
↓ 2 callers
Function
typed_dict_pattern_domain_satisfies
Return whether every value in `ty` belongs to a `TypedDict` domain accepted by `predicate`.
crates/ty_python_semantic/src/types/match_pattern.rs:132
↓ 2 callers
Function
typed_dict_subscript_key_lint
Uses `non-literal-typed-dict-key` only when every alternative in the rejected key type is a string of unknown value. This keeps a misspelled literal o
crates/ty_python_semantic/src/types/diagnostic.rs:4626
↓ 2 callers
Function
typed_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:2323
↓ 2 callers
Method
types
(&self)
crates/ty_python_semantic/src/types/signatures.rs:799
↓ 2 callers
Function
typing_optional
Format the expression as a `typing.Optional`-style optional.
crates/ruff_python_ast/src/helpers.rs:1722
↓ 2 callers
Function
typing_symbol
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, symbol: &str, )
crates/ty_python_semantic/src/place.rs:741
↓ 2 callers
Function
u32_index_to_usize
(index: u32)
crates/ty_server/src/document/range.rs:246
↓ 2 callers
Method
unannotated_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 callers
Method
unavailable_message
(self)
crates/ty_python_semantic/src/types/overrides/attributes.rs:418
↓ 2 callers
Method
unbound_instance_method
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/protocol_class.rs:1471
↓ 2 callers
Function
unbound_member_contract
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, owner: ClassType<'db>, name: &str, kind:
crates/ty_python_semantic/src/types/overrides/attributes.rs:154
↓ 2 callers
Method
underline
(&self, is_primary: bool)
crates/ruff_annotate_snippets/src/renderer/mod.rs:350
↓ 2 callers
Function
unescape_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 callers
Function
unicode_identifiers
(mut source: &str)
crates/ruff_python_trivia/src/name_matcher.rs:68
↓ 2 callers
Method
union
(self, other: Self)
crates/ty_python_core/src/lib.rs:1040
↓ 2 callers
Function
unique_value
(log: str, pattern: str, label: str)
scripts/collect_ty_ecosystem_run_metadata.py:80
↓ 2 callers
Function
unittest_raises_assertion
(call: &ast::ExprCall, extra_edits: Vec<Edit>, checker: &Checker)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/assertion.rs:478
↓ 2 callers
Method
unknown_type_mappings
( &self, generic_context: GenericContext<'db>, )
crates/ty_python_semantic/src/types/generics.rs:3477
↓ 2 callers
Function
unnecessary_hint_to_lsp_diagnostic
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, hint: &Hint, )
crates/ty_server/src/server/api/diagnostics.rs:413
↓ 2 callers
Function
unnecessary_hints_to_lsp_diagnostics
( db: &ProjectDatabase, file: File, encoding: PositionEncoding, hints: &[Hint], )
crates/ty_server/src/server/api/diagnostics.rs:400
↓ 2 callers
Method
unpack
Unpack the value to the target expression.
crates/ty_python_semantic/src/types/unpacker.rs:80
↓ 2 callers
Function
unpacked_keyword_is_gradual
(db: &'db dyn Db, ty: Type<'db>)
crates/ty_python_semantic/src/types/typed_dict.rs:2186
↓ 2 callers
Function
unparse_expr_in_sequence
(expr: &Expr, checker: &Checker)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:791
↓ 2 callers
Method
unparse_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 callers
Method
unparse_interpolated_string_body
( &mut self, values: &[ast::InterpolatedStringElement], flags: AnyStringFlags, )
crates/ruff_python_codegen/src/generator.rs:1493
↓ 2 callers
Method
unparse_parameter
(&mut self, parameter: &Parameter)
crates/ruff_python_codegen/src/generator.rs:1432
↓ 2 callers
Method
unparse_string_literal
(&mut self, string_literal: &ast::StringLiteral)
crates/ruff_python_codegen/src/generator.rs:1465
← previous
next →
7,201–7,300 of 31,766, ranked by callers