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
↓ 9 callers
Function
test_helper
(source: &str, expected: usize)
crates/ruff_linter/src/rules/pylint/rules/too_many_return_statements.rs:106
↓ 9 callers
Function
text
Creates a text from a dynamic string. This is done by allocating a new string internally.
crates/ruff_formatter/src/builders.rs:343
↓ 9 callers
Method
text_len
Returns the length of the indentation in bytes. # Panics If the indentation is longer than 4GB.
crates/ruff_python_formatter/src/string/docstring.rs:1731
↓ 9 callers
Method
truncated_display
Return a truncated snippet for user-facing display.
crates/ruff_linter/src/fix/snippet.rs:27
↓ 9 callers
Method
try_expression_type
(&self, expr: &ast::Expr)
crates/ty_python_semantic/src/types/infer/builder.rs:1089
↓ 9 callers
Method
try_set_optional_fix
( &mut self, func: impl FnOnce() -> anyhow::Result<Option<Fix>>, )
crates/ruff_linter/src/checkers/ast/mod.rs:3945
↓ 9 callers
Method
type_expression_flags
Get metadata for a type expression from the current inference result.
crates/ty_python_semantic/src/types/infer/builder.rs:1130
↓ 9 callers
Method
typing_importer
Create a [`TypingImporter`] that will import `member` from either `typing` or `typing_extensions`. On Python <`version_added_to_typing`, `member` is
crates/ruff_linter/src/checkers/ast/mod.rs:669
↓ 9 callers
Method
visit_type_definition
Visit an [`Expr`], and treat it as a type definition.
crates/ruff_linter/src/checkers/ast/mod.rs:2780
↓ 9 callers
Function
walk_pattern
(visitor: &mut V, pattern: &'a Pattern)
crates/ruff_python_ast/src/visitor.rs:754
↓ 9 callers
Function
walk_type_with_recursion_guard
( db: &'db dyn Db, ty: Type<'db>, visitor: &impl TypeVisitor<'db>, recursion_guard: &TypeColle
crates/ty_python_semantic/src/types/visitor.rs:362
↓ 9 callers
Method
warning
Override the output style for [warnings][crate::Level::WARNING]
crates/ruff_annotate_snippets/src/renderer/mod.rs:216
↓ 9 callers
Method
with_auto_import
(mut self, enabled: bool)
crates/ty_server/src/session/options.rs:172
↓ 9 callers
Method
with_disable_language_services
(mut self, disable_language_services: bool)
crates/ty_server/src/session/options.rs:157
↓ 9 callers
Method
with_optional_range
Returns a new `Span` with the given optional `range` attached to it.
crates/ruff_db/src/diagnostic/mod.rs:1237
↓ 9 callers
Method
write_files
(&self, files: impl IntoIterator<Item = (SystemPathBuf, &'a str)>)
crates/ruff_db/src/system/os/ignore.rs:62
↓ 8 callers
Method
__init__
(self, foo)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:332
↓ 8 callers
Method
acknowledge_request
Acknowledge a successful server-to-client request.
crates/ty_server/tests/e2e/main.rs:618
↓ 8 callers
Method
add
Attempts to adds the given completion to this collection. When added, `true` is returned. This might not add the completion for a variety of reasons
crates/ty_ide/src/completion.rs:245
↓ 8 callers
Method
add
(x, y)
crates/ruff_linter/resources/test/fixtures/refurb/FURB118.py:47
↓ 8 callers
Function
add_argument
Generic function to add arguments or keyword arguments to function calls. The new argument will be inserted before the first existing keyword argumen
crates/ruff_linter/src/fix/edits.rs:278
↓ 8 callers
Method
add_definition
Add a [`Definition`] associated with the `definition_node` AST node. ## Panics This method panics if `debug_assertions` are enabled and the `definit
crates/ty_python_core/src/builder.rs:1520
↓ 8 callers
Function
add_type_expression_reference_link
( mut diag: LintDiagnosticGuard<'db, 'env>, )
crates/ty_python_semantic/src/types/diagnostic.rs:3975
↓ 8 callers
Method
as_assign_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:584
↓ 8 callers
Method
as_enum_literal
(self)
crates/ty_python_semantic/src/types.rs:3353
↓ 8 callers
Method
as_int_literal
(self)
crates/ty_python_semantic/src/types.rs:3327
↓ 8 callers
Method
as_ipy_notebook
(&self)
crates/ruff_linter/src/source_kind.rs:34
↓ 8 callers
Method
as_literal_value
(self)
crates/ty_python_semantic/src/types.rs:3214
↓ 8 callers
Method
as_protocol_instance
(self)
crates/ty_python_semantic/src/types.rs:3192
↓ 8 callers
Method
as_str
(&self)
crates/ruff_python_ast/src/name.rs:96
↓ 8 callers
Method
as_str
(self)
crates/ty_python_semantic/src/types/diagnostic.rs:2611
↓ 8 callers
Method
as_string
(self)
crates/ty_python_semantic/src/types/literal.rs:220
↓ 8 callers
Function
assert_revealed_type
(db: &TestDb, filename: &str, expected: &str)
crates/ty_python_semantic/src/types/infer/tests.rs:81
↓ 8 callers
Function
assert_workspace_diagnostics_suspends_for_long_polling
( server: &mut TestServer, request_id: &lsp_server::RequestId, )
crates/ty_server/tests/e2e/pull_diagnostics.rs:1613
↓ 8 callers
Method
at_offset
Searches the token(s) at `offset`. Returns [`TokenAt::Between`] if `offset` points directly inbetween two tokens (the left token ends at `offset` and
crates/ruff_python_ast/src/token/tokens.rs:92
↓ 8 callers
Method
at_top_level
Return `true` if the model is at the top level of the module (i.e., in the module scope, and not nested within any statements).
crates/ruff_python_semantic/src/model.rs:1838
↓ 8 callers
Function
bind_markdown_snapshot_filters
()
crates/ty_ide/src/docstring/markdown/structured.rs:1100
↓ 8 callers
Method
bind_self_with_receiver
Binds the receiver using its runtime type while using `typing_self_type` to replace occurrences of `typing.Self`. These differ for class methods: the
crates/ty_python_semantic/src/types/signatures.rs:471
↓ 8 callers
Method
bindings
Returns a tuple of the name and ID of all bindings defined in this scope.
crates/ruff_python_semantic/src/scope.rs:103
↓ 8 callers
Method
bindings_iterator
( &'map self, bindings: &'map [LiveBinding], boundness_analysis: BoundnessAnalysis,
crates/ty_python_core/src/use_def.rs:1465
↓ 8 callers
Method
block_comments
Given a [`CommentRanges`], determine which comments are grouped together in "comment blocks". A "comment block" is a sequence of consecutive own-line
crates/ruff_python_trivia/src/comment_ranges.rs:157
↓ 8 callers
Method
build
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:3349
↓ 8 callers
Method
callable
(&self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:81
↓ 8 callers
Method
callable_type_kind
Return the kind for this function when it is converted into a [`CallableType`].
crates/ty_python_semantic/src/types/function.rs:2060
↓ 8 callers
Function
check_display_graph
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, set: ConstraintSet<'db, 'c>
crates/ty_python_semantic/src/types/constraints.rs:6770
↓ 8 callers
Method
check_types
Check types for all bindings in this constructor. Provisional checks preserve downstream constructors. Final checks discard inactive ones.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:222
↓ 8 callers
Method
class_member
Look up a class-level member by iterating through the MRO.
crates/ty_python_semantic/src/types/class.rs:757
↓ 8 callers
Method
class_method
(cls)
crates/ruff_linter/resources/test/fixtures/pep8_naming/N804.py:17
↓ 8 callers
Method
clear_salsa_events
Clears the salsa events.
crates/ty_module_resolver/src/db.rs:84
↓ 8 callers
Method
clone
(&self)
crates/ruff_unicode_names2/src/lib.rs:114
↓ 8 callers
Method
cmp
(&self, other: &Self)
crates/ruff_source_file/src/lib.rs:189
↓ 8 callers
Method
code
(&self)
crates/ruff_benchmark/src/lib.rs:62
↓ 8 callers
Method
contains_inclusive
(self, offset: TextSize)
crates/ruff_text_size/src/range.rs:184
↓ 8 callers
Method
current_exception_context_stack
Retrieve the [`ExceptionContextStack`] that is relevant for the current scope.
crates/ty_python_core/src/builder/except_handlers.rs:221
↓ 8 callers
Method
current_place_table
(&self)
crates/ty_python_core/src/builder.rs:1068
↓ 8 callers
Method
current_statement_id
Return the [`NodeId`] of the current [`Stmt`], if any.
crates/ruff_python_semantic/src/model.rs:1549
↓ 8 callers
Method
dataclass_params
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:218
↓ 8 callers
Method
deprecated_properties
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:1138
↓ 8 callers
Function
deserialize
()
crates/ruff_workspace/src/pyproject.rs:288
↓ 8 callers
Function
deserialize_fixture
(content: &str)
crates/ruff_server/src/session/options.rs:520
↓ 8 callers
Method
document_diagnostic_request
Send a `textDocument/diagnostic` request for the document at the given path.
crates/ruff_server/tests/e2e/main.rs:791
↓ 8 callers
Function
document_symbols
Get all document symbols for a file with the given options.
crates/ty_ide/src/document_symbols.rs:6
↓ 8 callers
Method
downstream_constructor
(&self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:305
↓ 8 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_parser/src/lexer/cursor.rs:104
↓ 8 callers
Function
empty_line
()
crates/ruff_formatter/src/builders.rs:133
↓ 8 callers
Method
enable_diagnostic_dynamic_registration
Enable or disable dynamic registration of diagnostics capability
crates/ty_server/tests/e2e/main.rs:1458
↓ 8 callers
Method
end_of_scope_bindings
( &self, place: ScopedPlaceId, )
crates/ty_python_core/src/use_def.rs:1212
↓ 8 callers
Method
enter
Returns the type bound from a context manager with type `self`. This method should only be used outside of type checking because it omits any errors.
crates/ty_python_semantic/src/types/context_manager.rs:156
↓ 8 callers
Method
enter_string_annotation
Given a string expression, determine if it's a string annotation, and if it is, yield the parsed sub-AST and a sub-model that knows it's analyzing a s
crates/ty_python_semantic/src/semantic_model.rs:592
↓ 8 callers
Method
error
()
crates/ruff_linter/resources/test/fixtures/flake8_raise/RSE102.py:58
↓ 8 callers
Method
evaluate
Evaluate a comparison recursively, treating `left` as the operand being constrained. For example, proving that every constraint of `EQUAL_VALUES` com
crates/ty_python_semantic/src/types/equality.rs:579
↓ 8 callers
Function
exactly_one_argument_with_matching_function
( name: &str, func: &Expr, args: &'a [Expr], keywords: &[Keyword], )
crates/ruff_linter/src/rules/flake8_comprehensions/helpers.rs:3
↓ 8 callers
Method
execution_context
Return the [`ExecutionContext`] of the current scope.
crates/ruff_python_semantic/src/model.rs:2110
↓ 8 callers
Method
expand_top_level_aliases
Resolve outermost aliases and expand aliases that expose top-level union elements. Aliases nested inside non-union types remain unexpanded.
crates/ty_python_semantic/src/types.rs:3119
↓ 8 callers
Method
expect_function
(&self)
crates/ty_python_core/src/scope.rs:433
↓ 8 callers
Method
extend_back
(&mut self, elements: &'a [FormatElement])
crates/ruff_formatter/src/printer/queue.rs:105
↓ 8 callers
Method
extra
(&self)
crates/ty_python_core/src/use_def.rs:1045
↓ 8 callers
Function
extract
(metadata: &Value)
crates/ty_project/src/uv/metadata/dependencies.rs:416
↓ 8 callers
Function
extract_fixed_length_iterable_element_types
Extract the element types from an expression with a statically known fixed-length iteration. List and tuple literals are expanded directly so we pres
crates/ty_python_semantic/src/types/iteration.rs:136
↓ 8 callers
Function
f
(*args, **kwargs)
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/call.py:4
↓ 8 callers
Method
file_range
(&self)
crates/ty_ide/src/lib.rs:96
↓ 8 callers
Method
file_stem
(&self)
crates/ruff_db/src/system/path.rs:304
↓ 8 callers
Method
file_type
(&self)
crates/ruff_db/src/system.rs:321
↓ 8 callers
Method
find_first
Finds the first node that fully covers the range and fulfills the given predicate. The "first" here means that the node closest to a leaf is returned
crates/ruff_python_ast/src/find_node.rs:90
↓ 8 callers
Method
find_legacy_typevars
Locates any legacy `TypeVar`s in this type, and adds them to a set. This is used to build up a generic context from any legacy `TypeVar`s that appear
crates/ty_python_semantic/src/types.rs:10411
↓ 8 callers
Function
find_newline
(text: &str)
crates/ruff_source_file/src/newlines.rs:58
↓ 8 callers
Method
finish
Finish the code example by generating any final actions if applicable. This typically adds an action when the end of a code example coincides with th
crates/ruff_python_formatter/src/string/docstring.rs:743
↓ 8 callers
Method
fix_applicability
The lowest fix applicability to show when rendering.
crates/ruff_db/src/diagnostic/render.rs:2606
↓ 8 callers
Method
flip
Flips the polarity of the variance. Covariant becomes contravariant, contravariant becomes covariant, others remain unchanged.
crates/ty_python_semantic/src/types/variance.rs:175
↓ 8 callers
Method
flush_pending_line
Flushes content buffered for the current line.
crates/ty_ide/src/docstring/markdown/general.rs:308
↓ 8 callers
Method
fmt
(&self, item: &Identifier, f: &mut PyFormatter)
crates/ruff_python_formatter/src/other/identifier.rs:11
↓ 8 callers
Function
format
( document: &TextDocument, source_type: SourceType, formatter_settings: &FormatterSettings, pa
crates/ruff_server/src/format.rs:47
↓ 8 callers
Method
format
(&self)
crates/ruff_python_formatter/src/statement/mod.rs:74
↓ 8 callers
Method
format
(&self, file_id: &FileHandle)
crates/ty_wasm/src/lib.rs:298
↓ 8 callers
Method
formatted
Converts every item to an object that knows how to format it.
crates/ruff_python_formatter/src/shared_traits.rs:70
↓ 8 callers
Method
full_end
(&self)
crates/ruff_source_file/src/newlines.rs:217
↓ 8 callers
Method
full_line_range
Computes the range of this `offset`s line. The range starts at the beginning of the line and goes up to, and including, the new line character at the
crates/ruff_source_file/src/line_ranges.rs:98
↓ 8 callers
Method
full_lines_range
Computes the range of all lines that this `range` covers. The range starts at the beginning of the line at `range.start()` and goes up to, and includ
crates/ruff_source_file/src/line_ranges.rs:193
↓ 8 callers
Function
function_known_decorators
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer.rs:321
↓ 8 callers
Method
function_like_kind
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/callable.rs:25
← previous
next →
1,801–1,900 of 31,766, ranked by callers