Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,807 in github.com/astral-sh/ruff
⨍
Functions
27,807
◇
Types & classes
6,608
↳
Endpoints
82
↓ 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
match_parameters
Match parameters for this constructor method and downstream constructors.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:68
↓ 12 callers
Method
minimum
Returns the minimum length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:68
↓ 12 callers
Method
name
The absolute name of the module (e.g. `foo.bar`)
crates/ty_module_resolver/src/module.rs:44
↓ 12 callers
Method
open_text_document
Send a `textDocument/didOpen` notification
crates/ruff_server/tests/e2e/main.rs:685
↓ 12 callers
Method
or_fall_back_to
Fallback (wholly or partially) to `fallback` to create a new [`LookupResult`].
crates/ty_python_semantic/src/place.rs:414
↓ 12 callers
Method
overloads_and_implementation
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/function.rs:779
↓ 12 callers
Method
parent
(&'a self)
crates/ty_module_resolver/src/path.rs:845
↓ 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
primary_annotation
Returns a shared borrow of the "primary" annotation of this diagnostic if one exists. When there are multiple primary annotations, then the first one
crates/ruff_db/src/diagnostic/mod.rs:263
↓ 12 callers
Method
push
(&mut self, line_number: OneIndexed, messages: Vec<Failure>)
crates/mdtest/src/matcher.rs:41
↓ 12 callers
Method
range
(&self)
crates/ruff_python_formatter/src/lib.rs:109
↓ 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:941
↓ 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
Returns the resolved client capabilities that were captured during initialization.
crates/ty_server/src/session.rs:1375
↓ 12 callers
Method
resolved_client_capabilities
(&self)
crates/ruff_server/src/session.rs:188
↓ 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:280
↓ 12 callers
Method
run
(self)
crates/ty_site_packages/src/lib.rs:2406
↓ 12 callers
Method
scope_id
The scope in which the reference is defined.
crates/ruff_python_semantic/src/reference.rs:36
↓ 12 callers
Method
send
(&mut self, message: Message)
crates/ruff_server/tests/e2e/main.rs:313
↓ 12 callers
Method
set_parent
Set the offset of the diagnostic's parent statement.
crates/ruff_db/src/diagnostic/mod.rs:398
↓ 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:254
↓ 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:750
↓ 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:7186
↓ 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
tokens
(&self)
crates/ruff_python_formatter/src/context.rs:85
↓ 12 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:32
↓ 12 callers
Method
union
(self, other: TokenSet)
crates/ruff_python_parser/src/token_set.rs:20
↓ 12 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:462
↓ 12 callers
Method
with_default_type
(mut self, default: Type<'db>)
crates/ty_python_semantic/src/types/signatures.rs:4682
↓ 12 callers
Method
with_extension
(&self, extension: &str)
crates/ruff_db/src/system/path.rs:365
↓ 12 callers
Method
with_site_packages
Convert to a builder that supports site-packages (third-party dependencies).
crates/ty_ide/src/lib.rs:616
↓ 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:332
↓ 11 callers
Method
add_token
( &mut self, ranged: impl Ranged, token_type: SemanticTokenType, modifiers: Se
crates/ty_ide/src/semantic_tokens.rs:224
↓ 11 callers
Method
apply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:445
↓ 11 callers
Method
as_bytes
(self)
crates/ty_python_semantic/src/types/literal.rs:186
↓ 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
↓ 11 callers
Method
as_notebook
(&self)
crates/ty_server/src/session/index.rs:262
↓ 11 callers
Method
as_ref
(&self)
crates/ruff_db/src/files/path.rs:106
↓ 11 callers
Method
as_typed_dict
(self)
crates/ty_python_semantic/src/types.rs:1727
↓ 11 callers
Function
assert_no_match
(set: &ModuleGlobSet, name: &str)
crates/ty_module_resolver/src/module_glob.rs:380
↓ 11 callers
Method
attach_to
Render the error context tree as info sub-diagnostics on `diag`.
crates/ty_python_semantic/src/types/relation_error.rs:541
↓ 11 callers
Method
bind_self_typevars
Bind `Self` type variables in this type to a concrete self type. Uses MRO-based matching: a `Self` typevar is only bound if its owner class is in the
crates/ty_python_semantic/src/types.rs:1238
↓ 11 callers
Method
bindings
(&self)
crates/ty_python_core/src/use_def/place_state.rs:588
↓ 11 callers
Method
build
(self)
crates/ruff_db/src/testing.rs:196
↓ 11 callers
Method
cache_key
(&self, state: &mut CacheKeyHasher)
crates/ruff_cache/src/globset.rs:6
↓ 11 callers
Method
capabilities
Derives the instance/class read/write capabilities exposed by this member. These are views of the canonical method, property, or attribute representa
crates/ty_python_semantic/src/types/protocol_class.rs:1130
↓ 11 callers
Method
cell
Returns the (raw) cell number (1-based) for the given row (1-based).
crates/ruff_notebook/src/index.rs:29
↓ 11 callers
Method
change_text_document
Send a `textDocument/didChange` notification with the given content changes
crates/ty_server/tests/e2e/main.rs:812
↓ 11 callers
Method
class_origin
Return the class that defines this protocol, if it is class-backed.
crates/ty_python_semantic/src/types/instance.rs:995
↓ 11 callers
Method
closer_len
The total length of the string's closer. This is always equal to `self.quote_len()`, except when the string is unclosed, in which case the length is z
crates/ruff_python_ast/src/nodes.rs:847
↓ 11 callers
Method
context
Return the [`LintContext`] for the current analysis. Note that you should always prefer calling methods like `settings`, `report_diagnostic`, or `is_
crates/ruff_linter/src/checkers/ast/mod.rs:665
↓ 11 callers
Method
cover
(self, other: TextRange)
crates/ruff_text_size/src/range.rs:249
↓ 11 callers
Method
create_directory_all
Creates a directory at `path`. All enclosing directories are created if they don't exist.
crates/ruff_db/src/system/memory_fs.rs:324
↓ 11 callers
Function
enum_metadata
( db: &'db dyn Db, class: ClassLiteral<'db>, )
crates/ty_python_semantic/src/types/enums.rs:924
↓ 11 callers
Method
file
Returns the `UnifiedFile` attached to this `Span`.
crates/ruff_db/src/diagnostic/mod.rs:1244
↓ 11 callers
Method
file
(self, db: &'db dyn Db)
crates/ty_python_core/src/expression.rs:73
↓ 11 callers
Method
file_path
(&self, path: impl AsRef<SystemPath>)
crates/ty_server/tests/e2e/main.rs:774
↓ 11 callers
Function
file_system
()
crates/ty_vendored/src/lib.rs:18
↓ 11 callers
Method
files
(&self)
crates/ruff_db/src/lib.rs:182
↓ 11 callers
Method
filter_union
If the type is a union (or a type alias that resolves to a union), filters union elements based on the provided predicate. Otherwise, returns the typ
crates/ty_python_semantic/src/types.rs:2105
↓ 11 callers
Method
first
(&self)
crates/ruff_linter/src/suppression.rs:187
↓ 11 callers
Method
hide_severity
Whether to hide a diagnostic's severity or not.
crates/ruff_db/src/diagnostic/mod.rs:1523
↓ 11 callers
Method
includes
Returns `true` if the string list of `codes` includes `code` (or an alias thereof).
crates/ruff_linter/src/noqa.rs:134
↓ 11 callers
Method
infer_definition
(&mut self, node: impl Into<DefinitionNodeKey> + std::fmt::Debug + Copy)
crates/ty_python_semantic/src/types/infer/builder.rs:2012
↓ 11 callers
Method
into_inner
(self)
crates/ty_python_semantic/src/types/callable.rs:709
↓ 11 callers
Method
into_suite
Consumes the [`Parsed`] output and returns the module body as a [`Suite`].
crates/ruff_python_parser/src/lib.rs:533
↓ 11 callers
Method
is_always_true
(self)
crates/ty_python_core/src/lib.rs:957
↓ 11 callers
Method
is_assignment
(&self, expr: &Expr)
crates/ruff_linter/src/rules/pylint/helpers.rs:91
↓ 11 callers
Function
is_const_true
Return `true` if an [`Expr`] is a literal `True`.
crates/ruff_python_ast/src/helpers.rs:831
↓ 11 callers
Method
is_empty
(&self)
crates/mdtest/src/matcher.rs:50
↓ 11 callers
Method
is_implicitly_open
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:117
↓ 11 callers
Method
is_keyword
(self)
crates/ruff_python_ast/src/token.rs:344
↓ 11 callers
Method
is_positional
Returns `true` if this is either a positional-only or standard (positional or keyword) parameter.
crates/ty_python_semantic/src/types/signatures.rs:4889
↓ 11 callers
Method
is_protocol
Return `true` if this class is a protocol class. In an ideal world, perhaps we wouldn't hardcode this knowledge here; instead, we'd just look at the
crates/ty_python_semantic/src/types/class/known.rs:652
↓ 11 callers
Method
is_required
(&self)
crates/ty_python_semantic/src/types/class.rs:2499
↓ 11 callers
Method
item
Returns the field exposed by a literal key. Undeclared keys synthesize a field only for explicit extra items. Hidden items on an implicitly open `Typ
crates/ty_python_semantic/src/types/typed_dict.rs:361
↓ 11 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:839
↓ 11 callers
Method
iter_mut
(&mut self)
crates/ruff_index/src/slice.rs:89
↓ 11 callers
Method
join_comma_separated
( &'fmt mut self, sequence_end: TextSize, )
crates/ruff_python_formatter/src/builders.rs:73
↓ 11 callers
Method
join_with
Joins the objects by placing the specified separator between every two items. ## Examples Joining different tokens by separating them with a comma a
crates/ruff_formatter/src/formatter.rs:101
↓ 11 callers
Function
known_module_symbol
Lookup the type of `symbol` in a given known module. Returns `Place::Undefined` if the given known module cannot be resolved for some reason.
crates/ty_python_semantic/src/place.rs:618
↓ 11 callers
Method
leading_dangling_trailing
Returns an iterator over the [leading](self#leading-comments), [dangling](self#dangling-comments), and [trailing](self#trailing) comments of `node`.
crates/ruff_python_formatter/src/comments/mod.rs:349
↓ 11 callers
Function
leading_indentation
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:93
↓ 11 callers
Method
len
(&self)
crates/ty_server/src/server/schedule/thread/pool.rs:133
↓ 11 callers
Method
len
(&self)
crates/ruff_server/src/server/schedule/thread/pool.rs:130
↓ 11 callers
Method
mark_formatted
Marks the comment as formatted
crates/ruff_python_formatter/src/comments/mod.rs:146
↓ 11 callers
Method
materialize
Applies both constraint kinds between the place's last materialized nodes and `target`. The place's node must be an ancestor of `target`. After mater
crates/ty_python_core/src/use_def.rs:1432
↓ 11 callers
Method
next
(&mut self)
crates/ruff_python_semantic/src/analyze/class.rs:99
↓ 11 callers
Method
offset
(self)
crates/ty_python_core/src/member.rs:747
↓ 11 callers
Method
parameter_documentation
Extract parameter documentation from popular docstring formats. Returns a map of parameter names to their documentation.
crates/ty_ide/src/docstring.rs:60
↓ 11 callers
Method
parent_statement_id
Given a [`NodeId`], return the [`NodeId`] of the parent statement, if any.
crates/ruff_python_semantic/src/model.rs:1647
↓ 11 callers
Function
parenthesized
Formats `content` enclosed by the `left` and `right` parentheses. The implementation also ensures that expanding the parenthesized expression (or any
crates/ruff_python_formatter/src/expression/parentheses.rs:109
↓ 11 callers
Method
permissions
(&self)
crates/ruff_db/src/system.rs:288
← previous
next →
1,101–1,200 of 27,807, ranked by callers