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
↓ 13 callers
Method
get_default
Returns the most appropriate type of this argument when there is no specific declared type.
crates/ty_python_semantic/src/types/call/arguments.rs:67
↓ 13 callers
Method
has_known_decorator
(self, db: &dyn Db, decorator: FunctionDecorators)
crates/ty_python_semantic/src/types/function.rs:333
↓ 13 callers
Method
id
(&self)
crates/ruff_python_ast/src/nodes.rs:2510
↓ 13 callers
Method
id
(&self)
crates/ty_wasm/src/lib.rs:924
↓ 13 callers
Function
infer_expression_types
Infer all types for an [`Expression`] (including sub-expressions). Use rarely; only for cases where we'd otherwise risk double-inferring an expression
crates/ty_python_semantic/src/types/infer.rs:359
↓ 13 callers
Method
inferred_type
(&self, model: &SemanticModel<'db>)
crates/ty_ide/src/goto.rs:448
↓ 13 callers
Method
into_uri
Converts the key back into its original URI.
crates/ruff_server/src/edit.rs:55
↓ 13 callers
Function
into_vec
(assertions: InlineFileAssertions<'_>)
crates/mdtest/src/assertion.rs:564
↓ 13 callers
Method
is_empty
(&self)
crates/ruff_linter/src/noqa.rs:337
↓ 13 callers
Method
is_instance_of
Return `true` if `self` is a nominal instance of the given known class.
crates/ty_python_semantic/src/types/instance.rs:145
↓ 13 callers
Function
is_override
Returns `true` if a function definition is an `@override` (PEP 698).
crates/ruff_python_semantic/src/analyze/visibility.rs:37
↓ 13 callers
Method
is_self
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:220
↓ 13 callers
Method
is_standard_library
(&self)
crates/ty_module_resolver/src/path.rs:34
↓ 13 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:766
↓ 13 callers
Method
iter_prefix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1088
↓ 13 callers
Method
join
(mut self)
crates/ruff_server/src/server/schedule/thread.rs:88
↓ 13 callers
Method
kind
(mut self, kind: impl Into<Option<CompletionKind>>)
crates/ty_ide/src/completion.rs:545
↓ 13 callers
Method
last
(mut self)
crates/ruff_python_ast/src/nodes.rs:248
↓ 13 callers
Method
len
(&self)
crates/ruff_linter/src/noqa.rs:139
↓ 13 callers
Method
lookup_symbol
Lookup a symbol in the current scope without materializing lazy builtins.
crates/ruff_python_semantic/src/model.rs:795
↓ 13 callers
Method
map
( self, db: &'db dyn Db, transform_fn: impl FnMut(&Type<'db>) -> Type<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:1619
↓ 13 callers
Method
materialized_divergent_fallback
If `self` is a materialized `Divergent` type, returns the concrete type it should behave as: `object` for top-materialized, `Never` for bottom-materia
crates/ty_python_semantic/src/types.rs:1158
↓ 13 callers
Method
name
(&self)
crates/ruff_benchmark/src/lib.rs:79
↓ 13 callers
Method
normalize_path
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/memory_fs.rs:371
↓ 13 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
↓ 13 callers
Function
original_class_type
Return the original class literal for a class definition. For decorated classes, this is the class object before applying decorators. The public bind
crates/ty_python_semantic/src/types/infer.rs:720
↓ 13 callers
Function
parameter_documentation
Returns the parameter documentation recognized in a reST docstring. `normalized_source` must have already undergone PEP-257 trimming and universal ne
crates/ty_ide/src/docstring/document/rst.rs:38
↓ 13 callers
Method
parse_conditional_expression_or_higher
Parses every Python expression except unparenthesized tuple and named expressions. Matches the `expression` rule in the [Python grammar]. This uses
crates/ruff_python_parser/src/parser/expression.rs:205
↓ 13 callers
Method
pop
(&mut self)
crates/ruff_formatter/src/printer/stack.rs:14
↓ 13 callers
Method
provenance
(&self)
crates/ty_python_semantic/src/types/call.rs:331
↓ 13 callers
Method
range
(&self)
crates/ty_ide/src/semantic_tokens.rs:158
↓ 13 callers
Method
recursive_type_normalized
Normalize recursive types for cycle recovery when there's no previous value. See [`Type::recursive_type_normalized`] for more details.
crates/ty_python_semantic/src/types/typevar.rs:1737
↓ 13 callers
Method
remove
Removes `rule` from the set. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; let mut set = RuleSet::from_rules(&[Rule::AmbiguousFun
crates/ruff_linter/src/registry/rule_set.rs:233
↓ 13 callers
Method
resolve_member
(self, db: &'db dyn Db, name: &Name)
crates/ty_python_semantic/src/types/enums.rs:378
↓ 13 callers
Method
return_type
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:8940
↓ 13 callers
Method
root
Returns the path to the test directory root.
crates/ruff/tests/cli/main.rs:179
↓ 13 callers
Method
set_search_paths
(&mut self, search_paths: SearchPaths)
crates/ty_module_resolver/src/db.rs:69
↓ 13 callers
Method
snapshot
Generate a [`Snapshot`] of the current semantic model.
crates/ruff_python_semantic/src/model.rs:2053
↓ 13 callers
Function
space
()
crates/ruff_formatter/src/builders.rs:658
↓ 13 callers
Method
span
Create a span with the range of the given expression in the file being currently type checked. If you're creating a diagnostic with snippets in files
crates/ty_python_semantic/src/types/context.rs:88
↓ 13 callers
Function
suffixed_err
Return a `TOMLDecodeError` where error message is suffixed with coordinates in source.
crates/ruff_benchmark/resources/tomllib/_parser.py:652
↓ 13 callers
Method
target
(self, db: &'db dyn Db, parsed: &'ast ParsedModuleRef)
crates/ty_python_core/src/unpack.rs:58
↓ 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_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:86
↓ 13 callers
Method
tuple
(tuple: Option<TupleType<'db>>)
crates/ty_python_semantic/src/types/instance.rs:95
↓ 13 callers
Function
undefined
()
crates/ruff_linter/src/rules/pyflakes/mod.rs:1064
↓ 13 callers
Method
verify_builder
(self, builder: &'c ConstraintSetBuilder<'db>)
crates/ty_python_semantic/src/types/constraints.rs:436
↓ 13 callers
Method
visit
(&self, db: &'db dyn Db, item: T, compute: impl FnOnce() -> R)
crates/ty_python_semantic/src/types/cyclic.rs:366
↓ 13 callers
Method
with_extra_file
(&mut self, file_name: &str, content: &str)
crates/ty_ide/src/inlay_hints.rs:872
↓ 13 callers
Method
with_max_recursion_depth
(mut self, depth: u16)
crates/ruff_python_parser/src/parser/options.rs:63
↓ 13 callers
Method
with_preview_mode
(mut self)
crates/ruff_linter/src/settings/mod.rs:868
↓ 12 callers
Method
add_atom
(&mut self, predicate: ScopedPredicateId)
crates/ty_python_core/src/narrowing_constraints.rs:236
↓ 12 callers
Method
add_in_place
Adds a type to this union.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:670
↓ 12 callers
Method
all_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:821
↓ 12 callers
Method
ancestor_scopes
Returns the scopes enclosing `node`, starting with the scope containing the node itself. Like [`Self::scope`], this handles nodes inside string annot
crates/ty_python_semantic/src/semantic_model.rs:342
↓ 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:1421
↓ 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:1716
↓ 12 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/refurb/rules/sorted_min_max.rs:215
↓ 12 callers
Method
as_symbol
Returns `Some` if the reference is a `Symbol`, otherwise `None`.
crates/ty_python_core/src/place.rs:113
↓ 12 callers
Method
checked_add
(self, rhs: TextSize)
crates/ruff_text_size/src/size.rs:100
↓ 12 callers
Method
class_specialization
If this type is a class instance, returns the class and its specialization.
crates/ty_python_semantic/src/types.rs:1487
↓ 12 callers
Method
clear
Clear the parsed module, dropping the AST once all references to it are dropped.
crates/ruff_db/src/parsed.rs:153
↓ 12 callers
Method
cmp
(&self, rhs: &CompletionRanker<'_>)
crates/ty_ide/src/completion.rs:3186
↓ 12 callers
Method
color
Whether to enable colors or not.
crates/ruff_db/src/diagnostic/mod.rs:1471
↓ 12 callers
Method
concat
(slices: &[T])
crates/ruff_python_ast/src/name.rs:80
↓ 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:1734
↓ 12 callers
Method
create
Creates a new, empty virtual environment.
scripts/ty_benchmark/src/benchmark/venv.py:39
↓ 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:3027
↓ 12 callers
Method
debug
Returns a nice debug representation that prints the source code for every comment (and not just the range).
crates/ruff_python_formatter/src/comments/mod.rs:165
↓ 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
entries
(&mut self, items: I)
crates/ruff_db/src/display.rs:38
↓ 12 callers
Method
enum_class_instance
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/literal.rs:405
↓ 12 callers
Method
enum_complement
Return the compact enum-complement view of this intersection, if it has one.
crates/ty_python_semantic/src/types/set_theoretic.rs:733
↓ 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:962
↓ 12 callers
Method
file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:327
↓ 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:136
↓ 12 callers
Function
get_assertions
(source: &str)
crates/mdtest/src/assertion.rs:545
↓ 12 callers
Method
get_span
Returns the `Span` associated with this annotation.
crates/ruff_db/src/diagnostic/mod.rs:882
↓ 12 callers
Function
global_symbol
( db: &'db dyn Db, file: File, name: &str, )
crates/ty_python_semantic/src/place.rs:498
↓ 12 callers
Method
id
Returns the identifier for this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:202
↓ 12 callers
Method
into_iter
(self)
crates/ruff_python_ast/src/nodes.rs:219
↓ 12 callers
Method
is_async
(self)
crates/ty_python_core/src/lib.rs:1025
↓ 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:1053
↓ 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:2514
↓ 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_variadic
(&self, index: usize)
crates/ty_python_semantic/src/types/call/arguments.rs:198
↓ 12 callers
Method
iter
Returns an iterator over every symbol along with its ID.
crates/ty_ide/src/symbols.rs:145
↓ 12 callers
Method
iter_element_types
( &self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/tuple.rs:2342
↓ 12 callers
Method
iter_overloads_and_implementation
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/function.rs:828
↓ 12 callers
Method
line_starts
Returns the [byte offsets](TextSize) for every line
crates/ruff_source_file/src/line_index.rs:533
↓ 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
Function
match_call_mut
( expression: &'a mut Expression<'b>, )
crates/ruff_linter/src/cst/matchers.rs:69
← previous
next →
1,001–1,100 of 27,807, ranked by callers