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
autofix_with_literal
Wraps a literal in `Literal[...]`, preserving its spelling, quotes, and escapes. String annotations retain their original source offsets: `parse_strin
crates/ty_python_semantic/src/types/diagnostic.rs:3401
↓ 2 callers
Method
available_submodule_attributes
Get the submodule attributes we believe to be defined on this module. Note that `ModuleLiteralType` is per-importing-file, so this analysis includes
crates/ty_python_semantic/src/types.rs:12694
↓ 2 callers
Method
await_expression_fix
Suggest awaiting an expression, adding parentheses if its precedence requires them.
crates/ty_python_semantic/src/types/infer/builder/awaitable.rs:143
↓ 2 callers
Function
b
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/return_type_parameters.py:144
↓ 2 callers
Function
b
()
crates/ruff_linter/resources/test/fixtures/refurb/FURB187.py:9
↓ 2 callers
Method
b
(self)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:247
↓ 2 callers
Method
bake_bound_type_into_overloads
Rewrites overload signatures as if an implicit bound receiver argument had already been consumed, preserving the corresponding source-parameter offset
crates/ty_python_semantic/src/types/call/bind.rs:3636
↓ 2 callers
Method
banned_module_level_imports
(&self)
crates/ruff_linter/src/rules/flake8_tidy_imports/settings.rs:204
↓ 2 callers
Function
bar
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/lambda.py:847
↓ 2 callers
Function
bar
()
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI010.py:1
↓ 2 callers
Function
bar
()
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:47
↓ 2 callers
Method
bar
(self, b: str)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/dummy_implementations.py:25
↓ 2 callers
Function
baselines
(db: &dyn Db)
crates/ty_project/src/baseline.rs:203
↓ 2 callers
Method
baz
(self, c: bytes)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/dummy_implementations.py:26
↓ 2 callers
Method
before_stdlib
Returns indexed paths that precede stdlib in normal typing resolution.
crates/ty_module_resolver/src/resolve.rs:584
↓ 2 callers
Method
begin_active_visit
(&self, db: &'db dyn Db, item: T)
crates/ty_python_semantic/src/types/cyclic.rs:969
↓ 2 callers
Function
benchmark
(bencher: Bencher, layout: Layout, mode: Mode)
crates/ruff_benchmark/benches/ty_ide.rs:459
↓ 2 callers
Function
benchmark_environment
Keep machine-specific user configuration out of benchmark settings.
scripts/ty_benchmark/src/benchmark/__init__.py:20
↓ 2 callers
Method
bind_and_find_all_legacy_typevars
Bind all unbound legacy type variables to the given context and then add all legacy typevars to the provided set.
crates/ty_python_semantic/src/types.rs:10777
↓ 2 callers
Function
bind_attribute
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, owner: ClassType<'db>, receiver: Type<'db>,
crates/ty_python_semantic/src/types/overrides/attributes.rs:259
↓ 2 callers
Function
bind_new_for_override
Resolve `__new__` descriptors and normalize callable objects before binding the constructor's implicit `cls`. This consumes a classmethod's bound `cls
crates/ty_python_semantic/src/types/overrides.rs:1426
↓ 2 callers
Method
bind_unused_self
Binds the `Self` receiver if it is unused in the rest of the signature. This is purely a performance optimization. Eagerly binding the type of `Self`
crates/ty_python_semantic/src/types/signatures.rs:1958
↓ 2 callers
Function
binding
( bound_typevar: BoundTypeVarInstance<'db>, solution: Type<'db>, )
crates/ty_python_semantic/src/types/constraints/projection/tests.rs:76
↓ 2 callers
Function
binding_names
Find the names in a `for` loop target that are assigned to during iteration. ```python for ((), [(a,), [[b]]], c.d, e[f], *[*g]) in h: # ^
crates/ruff_linter/src/rules/refurb/rules/for_loop_writes.rs:118
↓ 2 callers
Method
binding_type
( &self, owner: Definition<'db>, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer.rs:1281
↓ 2 callers
Function
binding_value_type
(db: &'db dyn Db, binding: Definition<'db>)
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:269
↓ 2 callers
Method
bindings_at_snapshot
( &self, snapshot: BindingsSnapshotId, )
crates/ty_python_core/src/use_def.rs:1112
↓ 2 callers
Method
binds_named_typevar
( self, db: &'db dyn Db, name: &'db ast::name::Name, )
crates/ty_python_semantic/src/types/generics.rs:965
↓ 2 callers
Method
bit
(&self, node: ast::NodeIndex)
crates/ty_python_core/src/ast_ids.rs:159
↓ 2 callers
Method
block_body_range
Returns a folding range for just the body of a block.
crates/ty_ide/src/folding_range.rs:521
↓ 2 callers
Method
body
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/recursive.rs:315
↓ 2 callers
Method
body
(self)
crates/ruff_linter/src/rules/flake8_simplify/rules/collapsible_if.rs:176
↓ 2 callers
Method
body_before_else
Returns the suite before the else block.
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:242
↓ 2 callers
Function
body_without_leading_docstring
Returns `body` without its leading docstring statement, if present.
crates/ruff_python_ast/src/helpers.rs:1272
↓ 2 callers
Function
bound_name_replacement
Returns the new bound name if changing the imported name also changes its binding.
crates/ty_ide/src/will_rename.rs:536
↓ 2 callers
Function
bound_typevar
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, name: &'static str, kind: Ty
crates/ty_python_semantic/src/types/typevar.rs:2591
↓ 2 callers
Method
bound_typevar
(&self)
crates/ty_python_semantic/src/types/generics.rs:5112
↓ 2 callers
Method
bound_typevar
(self)
crates/ty_python_semantic/src/types/bound_super.rs:34
↓ 2 callers
Method
bounded_filter_map_positive
Filter-map the positive members and intersect the results. Return `None` if no members map successfully or the intersection exceeds the expansion budg
crates/ty_python_semantic/src/types/set_theoretic.rs:1334
↓ 2 callers
Method
bracket_text
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_before_parameters.rs:36
↓ 2 callers
Method
branch_id
(&self, node_id: NodeId)
crates/ruff_python_semantic/src/nodes.rs:58
↓ 2 callers
Method
build
(&mut self)
crates/ruff_db/src/system/walk_directory.rs:139
↓ 2 callers
Method
build
(mut self)
crates/ty_python_semantic/src/place.rs:2132
↓ 2 callers
Method
build
Builds a mock environment, and returns the path to the environment root.
crates/ty_site_packages/src/lib.rs:2481
↓ 2 callers
Function
build_cfg
Returns the control flow graph associated to an array of statements
crates/ruff_python_semantic/src/cfg/graph.rs:7
↓ 2 callers
Function
build_definite_sequence_pattern_type
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, kind: &SequencePatternPredicateKind<'db>, mu
crates/ty_python_semantic/src/types/match_pattern.rs:1418
↓ 2 callers
Method
build_diagnostic_inference_with
Build a diagnostic specialization after the call-wide constraints were unsatisfiable. Each argument relation is solved independently, then its soluti
crates/ty_python_semantic/src/types/generics.rs:2932
↓ 2 callers
Function
build_diagnostics
Convert a sequence of [Codes] into [Diagnostic]s and append them to `diagnostics`.
crates/ruff_linter/src/rules/ruff/rules/redirected_noqa.rs:77
↓ 2 callers
Function
build_exclude_filter
Helper function to build an exclude filter from patterns with proper error handling.
crates/ty_project/src/metadata/options.rs:1493
↓ 2 callers
Function
build_include_filter
Helper function to build an include filter from patterns with proper error handling.
crates/ty_project/src/metadata/options.rs:1407
↓ 2 callers
Method
build_index
Build and return the [`NotebookIndex`]. ## Notes Each cell range includes its synthetic newline separator. Counting the lines in the concatenated so
crates/ruff_notebook/src/notebook.rs:351
↓ 2 callers
Method
build_union_type
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, mut builder: UnionBuil
crates/ty_python_semantic/src/types/union_type_instance.rs:288
↓ 2 callers
Method
builtin
(mut self, yes: bool)
crates/ty_ide/src/completion.rs:614
↓ 2 callers
Function
builtin_literal_constraint
Return a constraint for comparison with an `int`, `bool`, `str`, or `bytes` literal. For example: ```py x = "B" if random(): x = "C" if x != "C": wh
crates/ty_python_semantic/src/types/equality.rs:1001
↓ 2 callers
Function
builtin_tuple_spec
Returns the tuple shape for a specialization of the built-in `tuple` class.
crates/ty_python_semantic/src/types/instance.rs:533
↓ 2 callers
Method
bump_complex
(&mut self)
crates/ruff_python_parser/src/parser/mod.rs:468
↓ 2 callers
Method
bump_float
(&mut self)
crates/ruff_python_parser/src/parser/mod.rs:461
↓ 2 callers
Method
bump_identifier
(&mut self)
crates/ruff_python_parser/src/parser/mod.rs:418
↓ 2 callers
Method
bump_int
(&mut self)
crates/ruff_python_parser/src/parser/mod.rs:443
↓ 2 callers
Method
bump_ipython_escape_command
( &mut self, context: IpyEscapeContext, )
crates/ruff_python_parser/src/parser/mod.rs:488
↓ 2 callers
Method
bump_match_statement_keyword
Consume `match` as a keyword and report an error if the compound statement follows a semicolon. If `match` turns out to be an identifier, rewinding di
crates/ruff_python_parser/src/parser/statement.rs:2538
↓ 2 callers
Method
cached_constraint_bound_depth
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, constraint_id: At
crates/ty_python_semantic/src/types/constraints.rs:1422
↓ 2 callers
Function
call
( argumentable: Argumentable, parameters: impl Iterator<Item = &'a Parameter>, scope: &Scope,
crates/ruff_linter/src/rules/flake8_unused_arguments/rules/unused_arguments.rs:346
↓ 2 callers
Function
call_inference
( db: &'db TestDb, callable: Type<'db>, arguments: impl IntoIterator<Item = Type<'db>>
crates/ty_python_semantic/src/types/call/bind.rs:11753
↓ 2 callers
Function
call_signature_details
Extract signature details from a function call expression. This function analyzes the callable being invoked and returns zero or more `CallSignatureDe
crates/ty_python_semantic/src/types/ide_support.rs:1142
↓ 2 callers
Method
callable_by_name
(&self, name: &str)
crates/ty_python_semantic/src/types/signatures.rs:6299
↓ 2 callers
Method
callables
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:509
↓ 2 callers
Method
callables_with_receiver
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, receiver_type: Type<'d
crates/ty_python_semantic/src/types/method.rs:282
↓ 2 callers
Method
can_await_here
Returns `true` if adding `await` at `expression` would produce valid Python. Accounts for asynchronous functions, notebook cells, annotation restrict
crates/ty_python_semantic/src/types/infer/builder/awaitable.rs:80
↓ 2 callers
Method
can_skip
Try to skip the subtree if there are no comments if the next comment comes after this node (meaning, this nodes subtree contains no comments)
crates/ruff_python_formatter/src/comments/visitor.rs:65
↓ 2 callers
Method
can_skip
(&mut self, node_end: TextSize)
crates/ruff_linter/src/rules/ruff/rules/suppression_comment_visitor.rs:59
↓ 2 callers
Method
can_specialize_typevar
Whether every valid specialization of this variable is also valid for `other`.
crates/ty_python_semantic/src/types/typevar.rs:1170
↓ 2 callers
Method
cancellation_token
Returns the cancellation token for the given request id if the request is still pending.
crates/ty_server/src/session/request_queue.rs:90
↓ 2 callers
Method
candidate_evidence
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constra
crates/ty_python_semantic/src/types/constraints/solutions.rs:785
↓ 2 callers
Method
candidate_relations
The assignability relations that place a candidate between its lower and upper bounds.
crates/ty_python_semantic/src/types/constraints.rs:3458
↓ 2 callers
Method
canonicalize_path
(&self, path: &SystemPath)
crates/ty_server/src/system.rs:182
↓ 2 callers
Method
capture
(&mut self, comment: SuppressionCommentData<'src>)
crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs:213
↓ 2 callers
Method
cell_document_by_uri
Get the text document representing the contents of a cell by the cell URI.
crates/ruff_server/src/edit/notebook.rs:221
↓ 2 callers
Method
cell_index
(&self)
crates/ruff_notebook/src/index.rs:89
↓ 2 callers
Method
cell_index_by_uri
(&self, cell_uri: &lsp_types::Uri)
crates/ty_server/src/document/notebook.rs:196
↓ 2 callers
Function
cell_range
Returns the range of the notebook cell identified by `cell_uri` in the notebook's concatenated Python source, including the newline that separates it
crates/ty_server/src/document/range.rs:118
↓ 2 callers
Method
cell_range
Returns the text range in the concatenated document of the cell with index `cell`. `cell` is the cell's index among all of the notebook's cells, the
crates/ruff_notebook/src/notebook.rs:408
↓ 2 callers
Method
cell_uri_by_index
Get the URI for a cell by its index within the cell array.
crates/ty_server/src/document/notebook.rs:185
↓ 2 callers
Method
cell_uri_by_index
Get the URI for a cell by its index within the cell array.
crates/ruff_server/src/edit/notebook.rs:216
↓ 2 callers
Method
cell_uris
Returns a list of cell URIs in the order they appear in the array.
crates/ty_server/src/document/notebook.rs:192
↓ 2 callers
Method
changed
(&self)
crates/ruff_python_literal/src/escape.rs:19
↓ 2 callers
Function
char_width
(ch: char)
crates/ruff_annotate_snippets/src/renderer/render.rs:2401
↓ 2 callers
Method
characters_between
( &self, range: TextRange, text: &str, encoding: PositionEncoding, )
crates/ruff_source_file/src/line_index.rs:191
↓ 2 callers
Function
check
( query: &DocumentQuery, encoding: PositionEncoding, show_syntax_errors: bool, supports_relate
crates/ruff_server/src/lint.rs:76
↓ 2 callers
Method
check
Checks the files in the project and its dependencies as per the project's check mode. Uses current settings and environments without starting or wait
crates/ty_project/src/db.rs:234
↓ 2 callers
Function
check_annotation
(checker: &Checker<'a>, unresolved_annotation: &'b Expr)
crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs:99
↓ 2 callers
Method
check_attribute_write
Checks a required attribute write using normal attribute-assignment lookup. Resolution is shared with real assignments, but this path evaluates the r
crates/ty_python_semantic/src/types/attribute_write.rs:1564
↓ 2 callers
Method
check_boolean_test
Check `test` and the boolean tests contributing to its outcome. Diagnostic selection follows these rules: - Within a condition with fixed truthiness
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:1013
↓ 2 callers
Method
check_bound_method_pair
( &self, db: &'db dyn Db, source: BoundMethodType<'db>, target: BoundMethodTyp
crates/ty_python_semantic/src/types/method.rs:331
↓ 2 callers
Method
check_bound_super_pair
Check whether two `BoundSuperType`s are equivalent by recursing into their fields. This method is necessary because [`super::relation::TypeRelationCh
crates/ty_python_semantic/src/types/bound_super.rs:1045
↓ 2 callers
Method
check_callable_signature_pair_inner
Implementation of subtyping and assignability between two, possible overloaded, callable types.
crates/ty_python_semantic/src/types/signatures.rs:2714
↓ 2 callers
Method
check_callable_write_parameter
( &self, db: &'db dyn Db, callable_ty: Type<'db>, parameter_index: usize,
crates/ty_python_semantic/src/types/attribute_write.rs:1827
↓ 2 callers
Method
check_callables_vs_callable
( &self, db: &'db dyn Db, source: &CallableTypes<'db>, target: CallableType<'d
crates/ty_python_semantic/src/types/callable.rs:1206
↓ 2 callers
Method
check_condition_redundancy
Check a condition, for which types have already been inferred, to see if it is redundant. Report a diagnostic if so. If `test` is part of a larger ex
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:440
↓ 2 callers
Method
check_covering_node
(&mut self, covering_node: &CoveringNode<'_>, kind: OccurrenceKind)
crates/ty_ide/src/references.rs:782
← previous
next →
5,101–5,200 of 31,766, ranked by callers