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
↓ 5 callers
Method
associated_place_ids
(&self, place: ScopedPlaceId)
crates/ty_python_core/src/place.rs:371
↓ 5 callers
Method
at_identifier_or_soft_keyword
Returns `true` if the parser is at an identifier or soft keyword token.
crates/ruff_python_parser/src/parser/expression.rs:126
↓ 5 callers
Method
at_sequence_end
Returns `true` if the current token ends a sequence.
crates/ruff_python_parser/src/parser/expression.rs:141
↓ 5 callers
Function
attribute_write_requirement
Resolve the receiver-level requirements for writing `object_ty.attribute`. This expands aliases, preserves the all-arms rule for unions and the any-p
crates/ty_python_semantic/src/types/attribute_write.rs:338
↓ 5 callers
Function
autofix_with_notimplementederror
Add an autofix to `diagnostic` that replaces the given node with `NotImplementedError` iff `NotImplementedError` definitely has a builtin binding from
crates/ty_python_semantic/src/types/diagnostic.rs:3393
↓ 5 callers
Function
b
(arg: int)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/dummy_implementations.py:40
↓ 5 callers
Method
baseline
(&self)
crates/ty_project/src/metadata/settings.rs:43
↓ 5 callers
Function
binary_choice
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, typevar: BoundTypeVarInstance<'db>,
crates/ty_python_semantic/src/types/constraints/projection/tests.rs:65
↓ 5 callers
Method
bind_self
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, self_type: Type<'db>,
crates/ty_python_semantic/src/types/protocol_class.rs:1225
↓ 5 callers
Method
bind_self
Binds a method receiver, specializing its signatures and removing incompatible overloads. `typing_self_type` is used to replace `typing.Self`, which
crates/ty_python_semantic/src/types/callable.rs:963
↓ 5 callers
Method
builder
Returns a builder for tersely constructing diagnostics.
crates/ruff_db/src/diagnostic/render.rs:2649
↓ 5 callers
Method
bump
Moves the cursor to the next character, returning the previous character. Returns [`None`] if there is no next character.
crates/ruff_python_parser/src/lexer/cursor.rs:93
↓ 5 callers
Method
bump_back
Consumes the next character from the back
crates/ruff_python_trivia/src/cursor.rs:99
↓ 5 callers
Function
can_rename
Returns the range of the symbol if it can be renamed, None if not.
crates/ty_ide/src/rename.rs:10
↓ 5 callers
Method
cancel
(&mut self, request_id: &RequestId)
crates/ty_server/tests/e2e/main.rs:784
↓ 5 callers
Method
canonical_module
Return the module in which we should look up the definition for this class
crates/ty_python_semantic/src/types/class/known.rs:1525
↓ 5 callers
Method
canonicalize
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/memory_fs.rs:96
↓ 5 callers
Method
category
(&self, in_stub: bool, module: &ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1136
↓ 5 callers
Method
category
(&self, db: &dyn Db)
crates/ty_python_semantic/src/types/definition_resolution.rs:70
↓ 5 callers
Method
check_class_pair
( &self, db: &'db dyn Db, source: ClassType<'db>, target: ClassType<'db>,
crates/ty_python_semantic/src/types/class.rs:2621
↓ 5 callers
Function
check_file_unwrap
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/lib.rs:229
↓ 5 callers
Method
check_specialization_pair
( &self, db: &'db dyn Db, source: Specialization<'db>, target: Specialization<
crates/ty_python_semantic/src/types/generics.rs:1709
↓ 5 callers
Method
choose
(&self, preferred_quote: Quote)
crates/ruff_python_formatter/src/string/normalize.rs:336
↓ 5 callers
Method
class_literal_and_specialization
Returns the underlying class literal and specialization, if any. For a non-generic class, this returns the class literal directly. For a generic alia
crates/ty_python_semantic/src/types/class.rs:1239
↓ 5 callers
Method
clear_env_vars
Clears the inherited environment and any previously set variables.
crates/ruff_db/src/system/test.rs:49
↓ 5 callers
Method
clone
(&self)
crates/ruff_formatter/src/arguments.rs:10
↓ 5 callers
Method
close
De-registers a document, specified by its key. Calling this multiple times for the same document is a logic error. Returns `true` if the client needs
crates/ty_server/src/session.rs:2165
↓ 5 callers
Method
collect_hints
(&self, settings: &InlayHintSettings)
crates/ty_ide/src/inlay_hints.rs:1331
↓ 5 callers
Function
combine_definite_truthiness
Combine results when the caller only needs definite truthiness. Any ambiguous or narrowing result, or any disagreement between definite results, make
crates/ty_python_semantic/src/types/equality.rs:1328
↓ 5 callers
Method
config_file_override
Returns the explicit configuration file that replaces normal project discovery, if any.
crates/ty_project/src/metadata.rs:406
↓ 5 callers
Method
contains_definition
Returns `true` if this function includes `definition` as one of its overload signatures or implementation.
crates/ty_python_semantic/src/types/function.rs:1656
↓ 5 callers
Method
contains_member
Return whether `name` is an enum member, including aliases.
crates/ty_python_semantic/src/types/enums.rs:532
↓ 5 callers
Method
context_result
Returns the diagnostics and semantic validity of this unpacking assignment.
crates/ty_python_semantic/src/types/unpacker.rs:402
↓ 5 callers
Method
count_lines
The number of lines `range` spans. ## Examples ``` # use ruff_text_size::{Ranged, TextRange}; # use ruff_source_file::LineRanges; assert_eq!("a\nb"
crates/ruff_source_file/src/line_ranges.rs:314
↓ 5 callers
Function
create_compacted_owned_set
(db: &TestDb)
crates/ty_python_semantic/src/types/constraints.rs:7170
↓ 5 callers
Function
create_typevar
(db: &'db TestDb, name: &'static str)
crates/ty_python_semantic/src/types/constraints/sequents.rs:2235
↓ 5 callers
Function
create_typevar
(db: &'db TestDb, name: &str)
crates/ty_python_semantic/src/types/constraints/resolution.rs:264
↓ 5 callers
Function
create_workspace_server_with_file
Helper functions for long-polling tests
crates/ty_server/tests/e2e/pull_diagnostics.rs:1530
↓ 5 callers
Method
current
(&self)
crates/ruff_python_parser/src/lexer/indentation.rs:125
↓ 5 callers
Method
decorators
Return the types of the decorators on this class
crates/ty_python_semantic/src/types/class/static_literal.rs:816
↓ 5 callers
Method
default
(&self)
crates/ty_python_semantic/src/types/signatures.rs:6481
↓ 5 callers
Method
definition
(&self)
crates/ty_python_semantic/src/types/protocol_class.rs:2421
↓ 5 callers
Method
definition
(&self)
crates/ty_python_semantic/src/types/definition_resolution.rs:83
↓ 5 callers
Method
defuse
Consume the underlying `Diagnostic` without emitting it. In general you should avoid constructing diagnostics that may not be emitted, but this metho
crates/ruff_linter/src/checkers/ast/mod.rs:3815
↓ 5 callers
Function
delete_comment
Generate a [`Edit`] to delete a comment (for example: a `noqa` directive).
crates/ruff_linter/src/fix/edits.rs:67
↓ 5 callers
Function
dependency_workspace_case
()
crates/ty/tests/cli/uv_workspace.rs:148
↓ 5 callers
Function
derive_impl
(input: DeriveInput)
crates/ruff_macros/src/config.rs:12
↓ 5 callers
Function
descriptor_setter_domain
Derive the values accepted by every possible descriptor setter when they fit in [`Type`].
crates/ty_python_semantic/src/types/attribute_write.rs:1186
↓ 5 callers
Method
difference
(db: &'db dyn Db, types: TypePair<'db>)
crates/ty_python_semantic/src/types/set_theoretic.rs:1182
↓ 5 callers
Method
discard_disjoint_union_elements
If the type is a union, removes union elements that are disjoint from `target`. Returns [`DiscardDisjointUnionElementsResult::AllDisjoint`] if every
crates/ty_python_semantic/src/types.rs:3681
↓ 5 callers
Function
discovery_test
(source: &str)
crates/ty_ide/src/pytest_test_discovery.rs:317
↓ 5 callers
Method
display
Return a `std::fmt::Display` implementation that renders this diagnostic in the full, human-readable format. Note that this `Display` impl includes a
crates/ruff_db/src/diagnostic/mod.rs:212
↓ 5 callers
Method
display
(&self, source: &'src str)
crates/ruff_linter/src/rules/refurb/helpers.rs:165
↓ 5 callers
Method
do_bump
Moves the parser to the next token.
crates/ruff_python_parser/src/parser/mod.rs:358
↓ 5 callers
Function
dunder_all_names
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/dunder_all.rs:16
↓ 5 callers
Method
durability
(self, db: &dyn Db)
crates/ruff_db/src/files/file_root.rs:26
↓ 5 callers
Method
dynamic_class_scope_offset
Identify a dangling dynamic-class call without retaining an absolute source position.
crates/ty_python_semantic/src/types/infer/builder/dynamic_class.rs:40
↓ 5 callers
Method
eager_default_type
Returns a default type stored directly in the signature, without running inference. Deferred source defaults return `None`, even if their type is alre
crates/ty_python_semantic/src/types/signatures.rs:6499
↓ 5 callers
Method
emit
(&mut self, text: &dyn Debug)
crates/ruff_python_ast_integration_tests/tests/visitor.rs:217
↓ 5 callers
Function
empty_parenthesized
Format comments inside empty parentheses, brackets or curly braces. Empty `()`, `[]` and `{}` are special because there can be dangling comments, and
crates/ruff_python_formatter/src/expression/parentheses.rs:384
↓ 5 callers
Function
end_of_statement
()
crates/ruff_linter/resources/test/fixtures/flake8_return/RET503.py:299
↓ 5 callers
Method
ensure_overlay_identity_caches
(&mut self)
crates/ty_python_semantic/src/types/constraints.rs:1129
↓ 5 callers
Method
entries
(&mut self, items: I)
crates/ty_python_semantic/src/types/display.rs:513
↓ 5 callers
Method
evaluate_expression_node_predicate
( &mut self, expression_node: &ruff_python_ast::Expr, expression: Expression<'db>,
crates/ty_python_semantic/src/types/narrow.rs:1743
↓ 5 callers
Method
execute
(self, context)
crates/ruff_linter/resources/test/fixtures/airflow/AIR003.py:58
↓ 5 callers
Function
expand_type
Expands a type into its possible subtypes, if applicable. Returns [`None`] if the type cannot be expanded.
crates/ty_python_semantic/src/types/type_expansion.rs:19
↓ 5 callers
Method
expect_atomic
(self, storage: &ConstraintSetStorage<'_>)
crates/ty_python_semantic/src/types/constraints.rs:1871
↓ 5 callers
Method
expect_module
(mut self, name: &'a str)
crates/ty_module_resolver/src/resolve/search.rs:1555
↓ 5 callers
Method
expect_symbol
(self)
crates/ty_python_core/src/place.rs:489
↓ 5 callers
Method
expect_venv
(self)
crates/ty_site_packages/src/lib.rs:2361
↓ 5 callers
Method
expression
Compute possibly narrowed places for an expression predicate.
crates/ty_python_core/src/place.rs:629
↓ 5 callers
Function
f
()
crates/ruff_python_formatter/resources/test/fixtures/black/cases/slices.py:22
↓ 5 callers
Method
f_strings
Returns an iterator over the [`FString`] parts contained in this value. Note that this doesn't recurse into the f-string parts. For example, ```pyth
crates/ruff_python_ast/src/nodes.rs:624
↓ 5 callers
Function
field_lists
Parses all reST field lists in a docstring.
crates/ty_ide/src/docstring/document/rst.rs:12
↓ 5 callers
Method
fields
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/named_tuple.rs:476
↓ 5 callers
Method
file
Returns the underlying [`File`].
crates/ruff_db/src/files.rs:617
↓ 5 callers
Method
file
(&self)
crates/ty_python_semantic/src/suppression.rs:279
↓ 5 callers
Method
fill
Concatenates a list of [`crate::Format`] objects with spaces and line breaks to fit them on as few lines as possible. Each element introduces a concep
crates/ruff_formatter/src/formatter.rs:171
↓ 5 callers
Method
final_assignment_is_valid
( &mut self, object_ty: Type<'db>, qualifiers: TypeQualifiers, emit_diagnostic
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:514
↓ 5 callers
Function
find_fallback_target_version
Derive target version from `required-version` in `pyproject.toml`, if such a file exists in an ancestor directory.
crates/ruff_workspace/src/pyproject.rs:147
↓ 5 callers
Method
finish
(&mut self)
crates/ruff_python_formatter/src/builders.rs:215
↓ 5 callers
Method
finish
Finalizes the lower and upper bounds that have been accumulated for this typevar. Returns `None` if the accumulated bounds are not compatible with eac
crates/ty_python_semantic/src/types/constraints.rs:3225
↓ 5 callers
Method
first_component
(&self)
crates/ty_module_resolver/src/module_name.rs:96
↓ 5 callers
Function
first_public_binding
(db: &'db TestDb, file: File, name: &str)
crates/ty_python_semantic/src/types/infer/tests.rs:1151
↓ 5 callers
Function
fits
Returns `true` if the fix fits within the maximum configured line length.
crates/ruff_linter/src/fix/edits.rs:628
↓ 5 callers
Method
fix
(diagnostic: &'a Diagnostic, uri: &str, source_code: &SourceCode)
crates/ruff_db/src/diagnostic/render/sarif.rs:339
↓ 5 callers
Function
fixture_bindings_for_parameter
( db: &'db dyn Db, parameter: Definition<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:131
↓ 5 callers
Function
fixture_declaration
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1046
↓ 5 callers
Method
fixture_path
(&self, filename: &str)
crates/ruff/tests/cli/main.rs:190
↓ 5 callers
Method
flatten_typevars
Flatten typevars in a union or intersection by resolving them to their upper bounds or constraints. This function is used to properly handle iteratio
crates/ty_python_semantic/src/types.rs:8737
↓ 5 callers
Method
flow_merge
(&mut self, state: FlowSnapshot)
crates/ty_python_core/src/builder.rs:1368
↓ 5 callers
Method
flow_restore
(&mut self, state: FlowSnapshot)
crates/ty_python_core/src/builder.rs:1364
↓ 5 callers
Method
fmt
(&self, pattern: &Pattern, f: &mut PyFormatter)
crates/ruff_python_formatter/src/pattern/mod.rs:43
↓ 5 callers
Method
following_lines
Returns the lines belonging to this section after the summary line.
crates/ruff_linter/src/docstrings/sections.rs:405
↓ 5 callers
Function
foo
()
crates/ruff_python_parser/resources/invalid/expressions/arguments/unclosed_0.py:3
↓ 5 callers
Function
foo
(d: dict[str, str])
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM911.py:1
↓ 5 callers
Function
foo
()
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM105_0.py:1
↓ 5 callers
Function
foo
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF059_3.py:7
↓ 5 callers
Method
for_inheritance
Return the metaclass guaranteed by class declarations, without the typeshed fallback.
crates/ty_python_semantic/src/types/class.rs:3521
↓ 5 callers
Function
format
The `format` function takes an [`Arguments`] struct and returns the resulting formatting IR. The [`Arguments`] instance can be created with the [`for
crates/ruff_formatter/src/lib.rs:899
← previous
next →
2,601–2,700 of 31,562, ranked by callers