Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,562 in github.com/astral-sh/ruff
⨍
Functions
31,562
◇
Types & classes
7,116
↳
Endpoints
82
↓ 1 callers
Function
bare_except
E722
crates/ruff_linter/src/rules/pycodestyle/rules/bare_except.rs:60
↓ 1 callers
Function
base_class_runtime_semantics
Returns `RuntimeSemantics` based on a class's base class.
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:155
↓ 1 callers
Function
base_top_intersection
Intersect a fully static nominal base with a generic subclass. The subclass's identity MRO determines which subclass type variables specialize the ba
crates/ty_python_semantic/src/types/set_theoretic/generic_gradual_intersections.rs:61
↓ 1 callers
Function
baseline
Returns the baseline for `file` without depending on the query when baselines are disabled.
crates/ty_project/src/baseline.rs:187
↓ 1 callers
Function
batched_without_explicit_strict
B911
crates/ruff_linter/src/rules/flake8_bugbear/rules/batched_without_explicit_strict.rs:71
↓ 1 callers
Function
baz
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/top_level.py:34
↓ 1 callers
Function
baz
(x, y, z)
crates/ruff_python_parser/resources/inline/err/duplicate_keyword_args.py:3
↓ 1 callers
Function
baz
()
crates/ruff_linter/resources/test/fixtures/flake8_return/RET503.py:357
↓ 1 callers
Function
baz
()
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:237
↓ 1 callers
Function
baz
f"""I'm probably a docstring: {VARIABLE}!
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B021.py:73
↓ 1 callers
Function
baz
()
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B039.py:39
↓ 1 callers
Method
baz
Baz.
crates/ruff_linter/resources/test/fixtures/pyflakes/F811_30.py:18
↓ 1 callers
Method
before_already_present
Returns only the candidates that can precede an already present contextual keyword. `candidates` must be ordered as the keywords can appear in source
crates/ty_ide/src/completion.rs:1246
↓ 1 callers
Method
before_drop
Register a function to call before dropping the guard. This is intended for use with the [`Checker::report_custom_diagnostic`] or [`LintContext::repo
crates/ruff_linter/src/checkers/ast/mod.rs:3883
↓ 1 callers
Method
before_type_params
(self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:572
↓ 1 callers
Method
begin
Return a cached result or register the comparison as active. If the comparison is already active, return `Ambiguous`. This fallback can depend on whi
crates/ty_python_semantic/src/types/equality.rs:463
↓ 1 callers
Method
begin_annotated_assignment
Declare an annotated name assignment whose value will be bound after visiting its RHS. Other targets and annotations without a RHS are recorded in ful
crates/ty_python_core/src/builder.rs:1668
↓ 1 callers
Method
best_failing_overload
Returns the overload which call arguments should be inferred against, if every overload is non-matching.
crates/ty_python_semantic/src/types/call/bind.rs:4691
↓ 1 callers
Function
best_match
Returns the import binding that shares the longest prefix with the `prototype` and is of minimal length amongst these. See also [`rank_matches`].
crates/ruff_linter/src/rules/pyflakes/rules/unused_import.rs:915
↓ 1 callers
Method
between
Creates a [`Replacement`] that describes the `source_range` of `source` to replace with `modified` sliced by `modified_range`.
crates/ruff_server/src/edit/replacement.rs:12
↓ 1 callers
Method
between_alternative_blocks_empty_line
Add an empty line between a function or class and an alternative body. We only insert an empty if we're between suites in a multi-suite statement. In
crates/ruff_python_formatter/src/statement/suite.rs:466
↓ 1 callers
Method
between_operators
Creates a subslice that contains the operands coming after `last_operator` and up to, but not including the `end` operator.
crates/ruff_python_formatter/src/expression/binary_like.rs:570
↓ 1 callers
Function
bidirectional_unicode
PLE2502
crates/ruff_linter/src/rules/pylint/rules/bidirectional_unicode.rs:65
↓ 1 callers
Function
bin_data
creates arrays t1, t2 and a shift such that `dat[i] == t2[t1[i >> shift] << shift + i & mask]`; this allows us to share blocks of length `1 << shift`,
crates/ruff_unicode_names2_generator/src/lib.rs:188
↓ 1 callers
Function
bin_op
Return the name of the `operator` implemented by the given binary expression.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:404
↓ 1 callers
Method
binary_lower_bound_visits
Count the visits required to validate independent binary choices of lower bounds, e.g. `(A ≤ T or B ≤ T) and (C ≤ T or D ≤ T)`. Each rejected path rep
crates/ty_python_semantic/src/types/constraints/solutions.rs:229
↓ 1 callers
Function
binary_op_exception
PLW0711
crates/ruff_linter/src/rules/pylint/rules/binary_op_exception.rs:69
↓ 1 callers
Method
binary_search_by_start
Performs a binary search to find the index of the **first** token that starts at the given `offset`. Unlike `binary_search_by_key`, this method ensur
crates/ruff_python_ast/src/token/tokens.rs:30
↓ 1 callers
Method
bind
Bind references to this alias's query cycle in a closed inference result. Each bound occurrence retains its arguments and refers to the graph's root n
crates/ty_python_semantic/src/types/recursive.rs:402
↓ 1 callers
Method
bind
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>, receiver: Typ
crates/ty_python_semantic/src/types/variance.rs:74
↓ 1 callers
Method
bind_by_keyword
Marks the parameter at `parameter_index` as bound by keyword and records the synthesized default type that should appear in the reduced signature, if
crates/ty_python_semantic/src/types/signatures.rs:933
↓ 1 callers
Method
bind_method_receiver
Binds a method receiver after specializing type variables determined by it and filtering overloads whose explicit receiver annotations are incompatibl
crates/ty_python_semantic/src/types/signatures.rs:521
↓ 1 callers
Method
bind_pep695
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:870
↓ 1 callers
Method
bind_positionally
Marks the parameter at `parameter_index` as consumed by a positional binding.
crates/ty_python_semantic/src/types/signatures.rs:927
↓ 1 callers
Function
bind_type_guard_return_type
( db: &'db dyn Db, scope: ScopeId<'db>, return_ty: Type<'db>, bindings: &Bindings<'db>, ar
crates/ty_python_semantic/src/types/infer/builder/typeguard.rs:10
↓ 1 callers
Method
binding_assigns_alias
( &self, definition: Definition<'db>, alias: ExpressionNodeKey, unbound_is_ter
crates/ty_python_semantic/src/types/narrow.rs:1902
↓ 1 callers
Function
binding_decorator_inconsistencies
Finds binding-affecting decorator inconsistencies across an overload set. `@classmethod` and `@staticmethod` affect the callable shape used for overl
crates/ty_python_semantic/src/types/infer/builder/post_inference/overloaded_function.rs:478
↓ 1 callers
Method
binding_has_reachable_explicit_declaration
(&self, binding: Definition<'a>)
crates/ty_ide/src/references.rs:1045
↓ 1 callers
Method
binding_is_first_assignment_on_some_path
(&self, binding: Definition<'a>)
crates/ty_ide/src/references.rs:1053
↓ 1 callers
Method
binding_sources
Returns every nested binding source and whether it was declared `global`. Use [`Self::visible_binding_sources`] when resolving the binding in a parti
crates/ty_python_core/src/definition.rs:1681
↓ 1 callers
Function
bindings
Run lint rules over the [`Binding`]s.
crates/ruff_linter/src/checkers/ast/analyze/bindings.rs:12
↓ 1 callers
Function
bindings_in_different_forks
( checker: &Checker, shadow: &ShadowedBinding, left: NodeId, right: NodeId, )
crates/ruff_linter/src/rules/pyflakes/rules/redefined_while_unused.rs:325
↓ 1 callers
Function
bindings_in_search_scope
Resolves a request against the fixture exposures in `search_scope`.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:931
↓ 1 callers
Method
bindings_with_receiver
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, recursion_guard: &Acti
crates/ty_python_semantic/src/types.rs:7099
↓ 1 callers
Function
bit_count
FURB161
crates/ruff_linter/src/rules/refurb/rules/bit_count.rs:68
↓ 1 callers
Function
blank_after_summary
D205
crates/ruff_linter/src/rules/pydocstyle/rules/blank_after_summary.rs:75
↓ 1 callers
Function
blank_before_after_class
D203, D204, D211
crates/ruff_linter/src/rules/pydocstyle/rules/blank_before_after_class.rs:169
↓ 1 callers
Function
blank_before_after_function
D201, D202
crates/ruff_linter/src/rules/pydocstyle/rules/blank_before_after_function.rs:120
↓ 1 callers
Function
blanket_noqa
PGH004
crates/ruff_linter/src/rules/pygrep_hooks/rules/blanket_noqa.rs:79
↓ 1 callers
Function
blanket_type_ignore
PGH003
crates/ruff_linter/src/rules/pygrep_hooks/rules/blanket_type_ignore.rs:57
↓ 1 callers
Function
blanks_and_section_underline
( checker: &Checker, docstring: &Docstring, context: &SectionContext, style: SectionStyle, )
crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs:1476
↓ 1 callers
Function
blind_except
BLE001
crates/ruff_linter/src/rules/flake8_blind_except/rules/blind_except.rs:101
↓ 1 callers
Method
block_range_starts
Returns the start offsets for a block's full fold and body fold. The first offset marks the line on which we should start the full fold (the actual c
crates/ty_ide/src/folding_range.rs:450
↓ 1 callers
Function
blocking_http_call
ASYNC210
crates/ruff_linter/src/rules/flake8_async/rules/blocking_http_call.rs:74
↓ 1 callers
Function
blocking_http_call_httpx
ASYNC212
crates/ruff_linter/src/rules/flake8_async/rules/blocking_http_call_httpx.rs:107
↓ 1 callers
Function
blocking_input
ASYNC250
crates/ruff_linter/src/rules/flake8_async/rules/blocking_input.rs:48
↓ 1 callers
Function
blocking_open_call
ASYNC230
crates/ruff_linter/src/rules/flake8_async/rules/blocking_open_call.rs:49
↓ 1 callers
Function
blocking_os_path
ASYNC240
crates/ruff_linter/src/rules/flake8_async/rules/blocking_path_methods.rs:81
↓ 1 callers
Function
blocking_process_invocation
ASYNC220, ASYNC221, ASYNC222
crates/ruff_linter/src/rules/flake8_async/rules/blocking_process_invocation.rs:137
↓ 1 callers
Function
blocking_sleep
ASYNC251
crates/ruff_linter/src/rules/flake8_async/rules/blocking_sleep.rs:54
↓ 1 callers
Method
body_1
(self)
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B027.py:79
↓ 1 callers
Function
body_has_dict_return
Returns `true` if any return statement in the function body returns an inline dict literal, a dict comprehension, or a `dict(...)` call.
crates/ruff_linter/src/rules/airflow/rules/task_implicit_multiple_outputs.rs:243
↓ 1 callers
Function
body_is_no_op
Whether `body` contains only one `pass` or `...` statement.
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:81
↓ 1 callers
Method
body_kind
Returns the [`FunctionBodyKind`] of this function. For functions without an implementation (e.g., overloaded functions), returns [`FunctionBodyKind::
crates/ty_python_semantic/src/types/function.rs:1088
↓ 1 callers
Function
body_may_skip_else
Whether `body` contains a `break`, `return`, or `raise` that would cause the enclosing loop's `else` clause to be skipped. See [the Python tutorial o
crates/ruff_linter/src/rules/flake8_bugbear/rules/loop_iterator_mutation.rs:122
↓ 1 callers
Function
body_range
Return the [`TextRange`] of an [`IfElifBranch`]'s body (from the end of the test to the end of the body).
crates/ruff_linter/src/rules/flake8_simplify/rules/if_with_same_arms.rs:176
↓ 1 callers
Method
bom_start_offset
(&self)
crates/ruff_source_file/src/line_ranges.rs:349
↓ 1 callers
Function
boolean_chained_comparison
PLR1716
crates/ruff_linter/src/rules/pylint/rules/boolean_chained_comparison.rs:54
↓ 1 callers
Function
boolean_default_value_positional_argument
FBT002
crates/ruff_linter/src/rules/flake8_boolean_trap/rules/boolean_default_value_positional_argument.rs:114
↓ 1 callers
Function
boolean_positional_value_in_call
FBT003
crates/ruff_linter/src/rules/flake8_boolean_trap/rules/boolean_positional_value_in_call.rs:57
↓ 1 callers
Function
boolean_type_hint_positional_argument
FBT001
crates/ruff_linter/src/rules/flake8_boolean_trap/rules/boolean_type_hint_positional_argument.rs:113
↓ 1 callers
Method
bound_depth
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/constraints/variables.rs:657
↓ 1 callers
Method
bound_scope
(&self, enclosing_scope: FileScopeId, symbol: &Symbol)
crates/ty_python_core/src/builder.rs:603
↓ 1 callers
Function
bound_typevar_default_type
( db: &'db dyn Db, bound_typevar: BoundTypeVarInstance<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:2054
↓ 1 callers
Method
bounded_add_negative
Add a negative element without expanding multiple disjunctions beyond the intersection budget. Returns `None` if the exact result exceeds the budget.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1757
↓ 1 callers
Method
boundness
(&self)
crates/ruff_python_semantic/src/analyze/class.rs:149
↓ 1 callers
Method
branch
Combine two [`Terminal`] operators from different branches.
crates/ruff_python_semantic/src/analyze/terminal.rs:233
↓ 1 callers
Function
branch_python_operator_as_short_circuit
AIR004 (operator form)
crates/ruff_linter/src/rules/airflow/rules/task_branch_as_short_circuit.rs:120
↓ 1 callers
Function
broken
()
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B901.py:7
↓ 1 callers
Function
btreemap_items_with_same_key
Yield each shared key and its values from both `BTreeMap`s. Take advantage of the fact that keys are sorted to walk through each map once without doin
crates/ty_python_semantic/src/types/typed_dict.rs:3358
↓ 1 callers
Method
build
Builds the [`ModuleGlobSet`] from the added patterns. # Errors Returns an error if the regex set fails to compile.
crates/ty_module_resolver/src/module_glob.rs:187
↓ 1 callers
Method
build
(&mut self)
crates/ruff_workspace/src/resolver.rs:639
↓ 1 callers
Function
build_cargo_publish_command
Build the `cargo publish` command for all not-yet-published workspace crates.
scripts/publish-crates.py:139
↓ 1 callers
Method
build_command
Build the command with all necessary arguments
crates/ruff_server/src/format.rs:221
↓ 1 callers
Function
build_fix
(decorator: &Decorator, annotation_is_mapping: bool, checker: &Checker)
crates/ruff_linter/src/rules/airflow/rules/task_implicit_multiple_outputs.rs:258
↓ 1 callers
Function
build_fstring
Build an f-string consisting of `joinees` joined by `joiner` with `flags`.
crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs:74
↓ 1 callers
Function
build_intersection_simplify_split_bool_impl
(db: &TestDb, t_splitter: Type)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:3144
↓ 1 callers
Function
build_job
(jobs: Sequence[dict[str, Any]])
scripts/collect_ty_ecosystem_run_metadata.py:239
↓ 1 callers
Function
build_module_glob_set
( db: &dyn Db, patterns: &[RangedValue<String>], option_name: &str, context: AnalysisOptionsCo
crates/ty_project/src/metadata/options.rs:1939
↓ 1 callers
Function
build_suppression_edits_by_diagnostic
( comments: Vec<Option<SuppressionComment>>, locator: &Locator, line_ending: LineEnding, reaso
crates/ruff_linter/src/noqa.rs:871
↓ 1 callers
Function
build_suppression_edits_by_line
( comments: Vec<Option<SuppressionComment<'a>>>, locator: &Locator<'a>, line_ending: LineEnding,
crates/ruff_linter/src/noqa.rs:899
↓ 1 callers
Method
builtin
(self)
crates/ruff_linter/src/rules/pyupgrade/types.rs:29
↓ 1 callers
Function
builtin_argument_shadowing
A002
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_argument_shadowing.rs:72
↓ 1 callers
Function
builtin_attribute_shadowing
A003
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_attribute_shadowing.rs:83
↓ 1 callers
Function
builtin_import_shadowing
A004
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_import_shadowing.rs:59
↓ 1 callers
Function
builtin_lambda_argument_shadowing
A006
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_lambda_argument_shadowing.rs:39
↓ 1 callers
Function
builtin_literals_equal_to
Return the builtin literal values that compare equal to `literal_type`.
crates/ty_python_semantic/src/types/equality.rs:1011
↓ 1 callers
Function
builtin_modules_on_version
(minor_version: int)
scripts/generate_builtin_modules.py:64
↓ 1 callers
Function
builtin_open
PTH123
crates/ruff_linter/src/rules/flake8_use_pathlib/rules/builtin_open.rs:71
↓ 1 callers
Method
bump_cmp_op
Bump the appropriate token(s) for the given comparison operator.
crates/ruff_python_parser/src/parser/expression.rs:1194
← previous
next →
8,001–8,100 of 31,562, ranked by callers