Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
28,707 in github.com/astral-sh/ruff
⨍
Functions
28,707
◇
Types & classes
6,694
↳
Endpoints
82
↓ 13 callers
Method
to_zero_indexed
Return the zero-indexed primitive value for this [`OneIndexed`]
crates/ruff_source_file/src/line_index.rs:604
↓ 13 callers
Method
try_bool
Resolves the boolean value of a type. This is used to determine the value that would be returned when `bool(x)` is called on an object `x`. Returns
crates/ty_python_semantic/src/types/bool.rs:36
↓ 13 callers
Method
try_into_module
Attempts to convert the [`Parsed<Mod>`] into a [`Parsed<ModModule>`]. This method checks if the `syntax` field of the output is a [`Mod::Module`]. If
crates/ruff_python_parser/src/lib.rs:494
↓ 13 callers
Method
try_iterate
Given the type of an object that is iterated over in some way, return a tuple spec describing the type of objects that are yielded by that iteration.
crates/ty_python_semantic/src/types/iteration.rs:93
↓ 13 callers
Function
undefined
()
crates/ruff_linter/src/rules/pyflakes/mod.rs:1046
↓ 13 callers
Method
when_constraint_set_assignable_to_owned
Returns an _owned_ (i.e. salsa-cached) constraint set that describes when `self` is constraint-set assignable to `target`. Recursive relations are ev
crates/ty_python_semantic/src/types/relation.rs:542
↓ 13 callers
Method
with_extra_file
(&mut self, file_name: &str, content: &str)
crates/ty_ide/src/inlay_hints.rs:880
↓ 13 callers
Method
with_max_recursion_depth
(mut self, depth: u16)
crates/ruff_python_parser/src/parser/options.rs:63
↓ 12 callers
Method
add_atom
(&mut self, predicate: ScopedPredicateId)
crates/ty_python_core/src/narrowing_constraints.rs:236
↓ 12 callers
Method
any_rule_enabled
(&self, rules: &[Rule])
crates/ruff_linter/src/checkers/ast/mod.rs:558
↓ 12 callers
Method
apply_optional_specialization
Applies an optional specialization to this specialization.
crates/ty_python_semantic/src/types/generics.rs:1519
↓ 12 callers
Method
apply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:560
↓ 12 callers
Method
as_expr_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:1139
↓ 12 callers
Method
as_literal_value_kind
(self)
crates/ty_python_semantic/src/types.rs:2152
↓ 12 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/refurb/rules/sorted_min_max.rs:219
↓ 12 callers
Method
as_u32
(self)
crates/ty_python_core/src/reachability_constraints.rs:107
↓ 12 callers
Function
assert_example
(target: &str, expected: snapbox::Data)
crates/ruff_annotate_snippets/tests/examples.rs:88
↓ 12 callers
Method
clear
Clear the parsed module, dropping the AST once all references to it are dropped.
crates/ruff_db/src/parsed.rs:160
↓ 12 callers
Method
color
Whether to enable colors or not.
crates/ruff_db/src/diagnostic/mod.rs:1474
↓ 12 callers
Method
concat
(slices: &[T])
crates/ruff_python_ast/src/name.rs:80
↓ 12 callers
Method
content
Returns the new content for an insertion or deletion.
crates/ruff_diagnostics/src/edit.rs:61
↓ 12 callers
Method
content_range
The range of the string literal's contents. This excludes any prefixes, opening quotes or closing quotes.
crates/ruff_python_ast/src/nodes.rs:1756
↓ 12 callers
Method
create
Creates a new, empty virtual environment.
scripts/ty_benchmark/src/benchmark/venv.py:41
↓ 12 callers
Function
create_syntax_error_diagnostics
Create Ruff-style syntax error diagnostics for testing the various output formats.
crates/ruff_db/src/diagnostic/render.rs:2992
↓ 12 callers
Method
current_place_table_mut
(&mut self)
crates/ty_python_core/src/builder.rs:1081
↓ 12 callers
Method
definition
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:239
↓ 12 callers
Method
diagnostic_source
(&self, resolver: &dyn FileResolver)
crates/ruff_db/src/diagnostic/mod.rs:1198
↓ 12 callers
Function
directory_listing
( db: &'db dyn Db, path: &SystemPath, )
crates/ruff_db/src/files/directory.rs:94
↓ 12 callers
Method
entries
(&mut self, entries: I)
crates/ruff_python_formatter/src/builders.rs:188
↓ 12 callers
Method
enum_class_instance
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/literal.rs:410
↓ 12 callers
Method
expect_ty_file
Returns the [`File`] attached to this [`Span`]. Panics if the file is a [`UnifiedFile::Ruff`] instead of a [`UnifiedFile::Ty`].
crates/ruff_db/src/diagnostic/mod.rs:1270
↓ 12 callers
Method
explicit_bases
Returns all of the explicit base class types for this class. Note that when this is a namedtuple this always returns a sequence of length one corresp
crates/ty_python_semantic/src/types/class.rs:1053
↓ 12 callers
Method
file
The file to the source code that defines this module This is `None` for namespace packages.
crates/ty_module_resolver/src/module.rs:76
↓ 12 callers
Method
fix
Returns the fix for this diagnostic if it exists.
crates/ruff_db/src/diagnostic/mod.rs:359
↓ 12 callers
Function
format
(root: &dyn Format<SimpleFormatContext>)
crates/ruff_formatter/src/printer/mod.rs:1678
↓ 12 callers
Function
format_module_source
( source: &str, options: PyFormatOptions, )
crates/ruff_python_formatter/src/lib.rs:137
↓ 12 callers
Function
get_assertions
(source: &str)
crates/mdtest/src/assertion.rs:547
↓ 12 callers
Method
get_span
Returns the `Span` associated with this annotation.
crates/ruff_db/src/diagnostic/mod.rs:895
↓ 12 callers
Function
global_symbol
(db: &'db TestDb, file: File, name: &str)
crates/ty_python_semantic/src/types/infer/tests.rs:26
↓ 12 callers
Method
identity_specialization
Returns a specialization of this class where each typevar is mapped to itself.
crates/ty_python_semantic/src/types/class/static_literal.rs:603
↓ 12 callers
Method
imports
When set, include the import associated with the completion. Not enabled by default.
crates/ty_ide/src/completion.rs:11275
↓ 12 callers
Method
inferable_typevars
Returns the typevars that are inferable in this generic context. This set might include more typevars than the ones directly bound by the generic cont
crates/ty_python_semantic/src/types/generics.rs:516
↓ 12 callers
Method
into_iter
(self)
crates/ruff_python_ast/src/nodes.rs:219
↓ 12 callers
Method
is_always_true
(self)
crates/ty_python_core/src/lib.rs:957
↓ 12 callers
Function
is_dict
Test whether the given binding can be considered a dictionary. For this, we check what value might be associated with it through it's initialization,
crates/ruff_python_semantic/src/analyze/typing.rs:1052
↓ 12 callers
Method
is_implicitly_open
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:118
↓ 12 callers
Method
is_module
(&self)
crates/ruff_python_ast/src/generated.rs:48
↓ 12 callers
Method
is_read_only
(&self)
crates/ty_python_semantic/src/types/class.rs:2695
↓ 12 callers
Method
is_required
(&self)
crates/ty_python_semantic/src/types/class.rs:2680
↓ 12 callers
Function
is_stub
Returns `true` if a function has an empty body, and is therefore a stub. A function body is considered to be empty if it contains only `pass` stateme
crates/ruff_python_semantic/src/analyze/function_type.rs:165
↓ 12 callers
Method
is_typed_dict
Return `true` if this class constitutes a typed dict specification (inherits from `typing.TypedDict` or `typing_extensions.TypedDict`, either directly
crates/ty_python_semantic/src/types/class/static_literal.rs:977
↓ 12 callers
Method
iter
Returns an iterator over every symbol along with its ID.
crates/ty_ide/src/symbols.rs:146
↓ 12 callers
Method
iter_element_types
( &self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/tuple.rs:2443
↓ 12 callers
Method
iter_flat
Returns an iterator over all `CallableBinding`s, flattening the two-level structure. Note: This loses the union/intersection distinction. The returne
crates/ty_python_semantic/src/types/call/bind.rs:899
↓ 12 callers
Method
iter_overloads_and_implementation
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/function.rs:905
↓ 12 callers
Method
keys
(&self)
crates/ruff_python_formatter/src/comments/map.rs:213
↓ 12 callers
Method
literals
Returns an iterator over the [`StringLiteral`] parts contained in this value. Note that this doesn't recurse into the f-string parts. For example, `
crates/ruff_python_ast/src/nodes.rs:553
↓ 12 callers
Method
map_type
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/member.rs:47
↓ 12 callers
Function
match_call_mut
( expression: &'a mut Expression<'b>, )
crates/ruff_linter/src/cst/matchers.rs:69
↓ 12 callers
Function
match_expression
Given the source code for an expression, return the parsed [`Expression`]. If the expression is not guaranteed to be valid as a standalone expression
crates/ruff_linter/src/cst/matchers.rs:223
↓ 12 callers
Method
name
The absolute name of the module (e.g. `foo.bar`)
crates/ty_module_resolver/src/module.rs:66
↓ 12 callers
Method
offset
(self)
crates/ty_python_core/src/member.rs:747
↓ 12 callers
Method
opener_len
The total length of the string's opener, i.e., the length of the prefixes plus the length of the quotes used to open the string.
crates/ruff_python_ast/src/nodes.rs:840
↓ 12 callers
Method
or
Merge the provenance from two places.
crates/ty_python_semantic/src/place.rs:127
↓ 12 callers
Method
parent
(&'a self)
crates/ty_module_resolver/src/path.rs:847
↓ 12 callers
Method
path
(&'a self, resolver: &'a dyn FileResolver)
crates/ruff_db/src/diagnostic/mod.rs:1179
↓ 12 callers
Method
pop
(&mut self)
crates/ruff_python_parser/src/lexer/interpolated_string.rs:135
↓ 12 callers
Method
prefix
(self)
crates/ruff_python_ast/src/nodes.rs:994
↓ 12 callers
Method
push
(&mut self, line_number: OneIndexed, messages: Vec<Failure>)
crates/mdtest/src/matcher.rs:43
↓ 12 callers
Method
range
(&self)
crates/ruff_python_formatter/src/lib.rs:110
↓ 12 callers
Method
report_context
If error context collection is enabled, returns the current error context tree. You will typically use [`push`][ErrorContextTree::push] to add additio
crates/ty_python_semantic/src/types/relation.rs:1175
↓ 12 callers
Function
resolve
Resolve the relevant settings strategy and defaults for the current invocation.
crates/ruff/src/resolve.rs:20
↓ 12 callers
Method
resolved_client_capabilities
(&self)
crates/ruff_server/src/session.rs:188
↓ 12 callers
Method
return_type
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:10125
↓ 12 callers
Method
root
(&self)
crates/ty/tests/cli/main.rs:980
↓ 12 callers
Method
rules
Returns rules matching the selector, taking into account rule groups like preview and deprecated.
crates/ruff_linter/src/rule_selector.rs:281
↓ 12 callers
Method
send
(&mut self, message: Message)
crates/ruff_server/tests/e2e/main.rs:314
↓ 12 callers
Method
set_parent
Set the offset of the diagnostic's parent statement.
crates/ruff_db/src/diagnostic/mod.rs:411
↓ 12 callers
Method
severity
Returns the severity of this diagnostic. Note that this may be different than the severity of sub-diagnostics.
crates/ruff_db/src/diagnostic/mod.rs:272
↓ 12 callers
Method
site_packages
Add a file to site-packages (simulating a third-party dependency). The path should be relative to site-packages root (e.g., "numpy/__init__.py").
crates/ty_ide/src/lib.rs:756
↓ 12 callers
Method
start
(&self)
crates/ruff_source_file/src/newlines.rs:211
↓ 12 callers
Method
take
Takes a snapshot of the current state of the matched overload bindings. # Panics Panics if the indexes of the matched overloads are not valid for th
crates/ty_python_semantic/src/types/call/bind.rs:7885
↓ 12 callers
Function
test_helper
(source: &str, members_to_remove: &[&str])
crates/ruff_linter/src/rules/pyupgrade/fixes.rs:75
↓ 12 callers
Method
to_file_path
Returns the corresponding [`AnySystemPath`] for this document key. Note, calling this method on a `DocumentKey::Opaque` representing a cell document
crates/ty_server/src/document.rs:94
↓ 12 callers
Method
to_location
Converts this range into an LSP location. Returns `None` if the URI for this file couldn't be resolved.
crates/ty_server/src/document/range.rs:40
↓ 12 callers
Method
tokens
(&self)
crates/ruff_python_formatter/src/context.rs:85
↓ 12 callers
Method
tuple
(tuple: Option<TupleType<'db>>)
crates/ty_python_semantic/src/types/instance.rs:102
↓ 12 callers
Method
union
(self, other: TokenSet)
crates/ruff_python_parser/src/token_set.rs:20
↓ 12 callers
Method
verify_builder
(self, builder: &'c ConstraintSetBuilder<'db>)
crates/ty_python_semantic/src/types/constraints.rs:480
↓ 12 callers
Method
with_default_type
(mut self, default: Type<'db>)
crates/ty_python_semantic/src/types/signatures.rs:5279
↓ 12 callers
Method
with_site_packages
Convert to a builder that supports site-packages (third-party dependencies).
crates/ty_ide/src/lib.rs:626
↓ 12 callers
Method
write
(&self, f: &mut std::fmt::Formatter)
crates/ruff_db/src/diagnostic/render/full.rs:121
↓ 12 callers
Method
write
(&self, f: &mut std::fmt::Formatter, start_range: bool)
crates/ruff/src/args.rs:1326
↓ 12 callers
Method
write_element
(&mut self, element: FormatElement)
crates/ruff_formatter/src/buffer.rs:139
↓ 11 callers
Method
add_and_constraint
( &mut self, a: ScopedNarrowingConstraint, b: ScopedNarrowingConstraint, )
crates/ty_python_core/src/narrowing_constraints.rs:326
↓ 11 callers
Method
add_token
( &mut self, ranged: impl Ranged, token_type: SemanticTokenType, modifiers: Se
crates/ty_ide/src/semantic_tokens.rs:228
↓ 11 callers
Method
all_end_of_scope_symbol_declarations
( &'map self, )
crates/ty_python_core/src/use_def.rs:1146
↓ 11 callers
Method
analysis_settings
(&self, _file: File)
crates/ty_python_semantic/src/db.rs:195
↓ 11 callers
Method
as_char
(self)
crates/ruff_python_ast/src/str.rs:20
↓ 11 callers
Method
as_char
Get the character used to represent this quote.
crates/ruff_linter/src/rules/flake8_quotes/settings.rs:75
← previous
next →
1,101–1,200 of 28,707, ranked by callers