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
↓ 21 callers
Method
find_positional
Return the positional argument at the given index, or `None` if no such argument exists.
crates/ruff_python_ast/src/nodes.rs:3772
↓ 21 callers
Method
format
Set the output format to use in diagnostic rendering.
crates/ruff_db/src/diagnostic/render.rs:2579
↓ 21 callers
Method
has_known_class
Returns whether this is a nominal instance of a particular [`KnownClass`].
crates/ty_python_semantic/src/types/instance.rs:322
↓ 21 callers
Function
indentation_at_offset
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:49
↓ 21 callers
Method
index
(&self, index: usize)
crates/ty_python_semantic/src/types/signatures.rs:5901
↓ 21 callers
Function
infer_same_file_expression_type
Infers the type of an `expression` that is guaranteed to be in the same file as the calling query. This is a small helper around [`infer_expression_t
crates/ty_python_semantic/src/types/infer.rs:697
↓ 21 callers
Method
insert
(mut self, insert: impl Into<CompactString>)
crates/ty_ide/src/completion.rs:584
↓ 21 callers
Method
is_directory
(&self, resolver: &ResolverContext)
crates/ty_module_resolver/src/path.rs:72
↓ 21 callers
Method
is_inferable
(self, db: &'db dyn Db, inferable: TypeVarSet<'db>)
crates/ty_python_semantic/src/types/typevar.rs:2153
↓ 21 callers
Method
is_keyword_variadic
Returns `true` if this is a keyword-variadic parameter.
crates/ty_python_semantic/src/types/signatures.rs:6277
↓ 21 callers
Method
is_trivia
(&self)
crates/ruff_python_ast/src/token.rs:452
↓ 21 callers
Method
kind
(&self)
crates/ty_python_core/src/builder.rs:6131
↓ 21 callers
Method
line_column
(&self, offset: TextSize)
crates/ruff_source_file/src/lib.rs:39
↓ 21 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:950
↓ 21 callers
Method
parse
Parses the content and returns its AST
crates/ruff_wasm/src/lib.rs:506
↓ 21 callers
Function
parse_suite
(source: &str)
crates/ruff_linter/src/rules/mccabe/rules/function_is_too_complex.rs:197
↓ 21 callers
Method
path
Returns the directory's path without permitting it to change.
crates/ty_module_resolver/src/path.rs:383
↓ 21 callers
Function
place_from_bindings
Infer the combined type from an iterator of bindings, and return it together with boundness information in a [`Place`]. The type will be a union if t
crates/ty_python_semantic/src/place.rs:791
↓ 21 callers
Method
preceding_node
Returns the comment's preceding node. The direct child node (ignoring lists) of the [`enclosing_node`](DecoratedComment::enclosing_node) that precede
crates/ruff_python_formatter/src/comments/visitor.rs:255
↓ 21 callers
Method
predicates
(&self)
crates/ty_python_core/src/use_def.rs:1059
↓ 21 callers
Method
push
(&mut self, value: T)
crates/ruff_formatter/src/printer/stack.rs:18
↓ 21 callers
Method
push
Pushes the given line as part of this code example.
crates/ruff_python_formatter/src/string/docstring.rs:1235
↓ 21 callers
Method
remove_file
(self, db: &mut dyn Db, file: File)
crates/ty_project/src/lib.rs:696
↓ 21 callers
Method
report_diagnostic
( &self, context: &CallDiagnosticContext<'_, '_, 'db, '_>, node: ast::AnyNodeRef,
crates/ty_python_semantic/src/types/call/bind.rs:10687
↓ 21 callers
Method
search_path
(&self)
crates/ty_module_resolver/src/path.rs:67
↓ 21 callers
Method
solutions
Computes default solutions for each BDD path within the default projection budget. Constraints on non-inferable typevars are not necessarily retained
crates/ty_python_semantic/src/types/constraints/projection.rs:117
↓ 21 callers
Method
sum
(iter: I)
crates/ruff_text_size/src/size.rs:216
↓ 21 callers
Method
system
(&self)
crates/ty_project/src/db.rs:680
↓ 21 callers
Method
to_notebook_or_file
Returns the database file for this document, or its containing notebook for a cell. Returns [`None`] if the file cannot be resolved.
crates/ty_server/src/session.rs:1626
↓ 21 callers
Method
to_str
(&self, db: &'a dyn Db)
crates/ty_module_resolver/src/resolve.rs:1422
↓ 21 callers
Method
tokens
Returns all the tokens for the parsed output.
crates/ruff_python_parser/src/lib.rs:409
↓ 21 callers
Method
tuple_instance_spec
If this type is an instance type where the class has a tuple spec, returns the tuple spec. I.e., for the type `tuple[int, str]`, this will return the
crates/ty_python_semantic/src/types.rs:3007
↓ 21 callers
Method
vendored
(&self)
crates/ty_module_resolver/src/resolve.rs:1909
↓ 21 callers
Method
workspace_diagnostic_request
Send a `workspace/diagnostic` request with optional previous result IDs.
crates/ty_server/tests/e2e/main.rs:1054
↓ 20 callers
Method
ancestor_ids
Returns an iterator over all [`NodeId`] ancestors, starting from the given [`NodeId`].
crates/ruff_python_semantic/src/nodes.rs:63
↓ 20 callers
Method
body
Return the body of the function-like node. If the node is a function definition that consists of more than a single return statement, returns `None`.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:179
↓ 20 callers
Method
build
(db: &'db dyn Db, input: OrderedUnionInput<'db>)
crates/ty_python_semantic/src/types/set_theoretic.rs:58
↓ 20 callers
Function
contains_effect
Return `true` if the `Expr` contains an expression that appears to include a side-effect (like a function call). Accepts a closure that determines wh
crates/ruff_python_ast/src/helpers.rs:220
↓ 20 callers
Method
cover
(self, other: TextRange)
crates/ruff_text_size/src/range.rs:249
↓ 20 callers
Method
db
(&self)
crates/ty/tests/file_watching.rs:74
↓ 20 callers
Function
default_lint_registry
Returns the default registry with all known semantic lints.
crates/ty_python_semantic/src/lib.rs:81
↓ 20 callers
Method
display
( self, db: &'db dyn Db, env: &'env ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/display.rs:737
↓ 20 callers
Method
display_with
( self, db: &'db dyn Db, env: &'env ProgramEnvironment<'db>, settings: Display
crates/ty_python_semantic/src/types/display.rs:750
↓ 20 callers
Method
exactly_one
(&self)
crates/ty_python_semantic/src/types/callable.rs:1131
↓ 20 callers
Method
extend
Extend `self` with the components of `other` # Examples ``` use ty_module_resolver::ModuleName; let mut module_name = ModuleName::new_static("foo")
crates/ty_module_resolver/src/module_name.rs:288
↓ 20 callers
Method
finish
(self)
crates/ty_python_core/src/place.rs:464
↓ 20 callers
Method
fmt
(&self, expression: &Expr, f: &mut PyFormatter)
crates/ruff_python_formatter/src/expression/mod.rs:76
↓ 20 callers
Method
focus_range
Returns the [`FileRange`] of the function's name.
crates/ty_python_semantic/src/types/function.rs:442
↓ 20 callers
Function
indentation
( logical_line: &LogicalLine, prev_logical_line: Option<&LogicalLine>, indent_char: char, inde
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/indentation.rs:270
↓ 20 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:578
↓ 20 callers
Method
into_iter
(self)
crates/ty_project/src/lib.rs:1100
↓ 20 callers
Method
is_always_true
(self)
crates/ty_python_core/src/lib.rs:1013
↓ 20 callers
Method
is_empty
Returns `true` if there are no fixes in the map.
crates/ruff/src/diagnostics.rs:136
↓ 20 callers
Method
is_empty
(&self, snapshot: &ScratchSnapshot)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:29
↓ 20 callers
Method
is_language_services_disabled
(&self)
crates/ty_server/src/session/settings.rs:51
↓ 20 callers
Method
iter
Returns an iterator over the fixes in the map, along with the file path.
crates/ruff/src/diagnostics.rs:141
↓ 20 callers
Method
kind
Returns the collection mechanism responsible for this test.
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:152
↓ 20 callers
Method
minimum
Returns the minimum length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:65
↓ 20 callers
Method
next
(&mut self)
crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs:343
↓ 20 callers
Method
primary
Add a primary annotation with a message. If the message is empty, then an annotation without any message be created. See the docs on `TestEnvironmen
crates/ruff_db/src/diagnostic/render.rs:2808
↓ 20 callers
Method
provenance
(self)
crates/ty_python_semantic/src/types/constraints/variables.rs:469
↓ 20 callers
Method
push
Pushes a new [`Binding`] and returns its [`BindingId`].
crates/ruff_python_semantic/src/binding.rs:474
↓ 20 callers
Method
qualified_name
Returns the [`QualifiedName`] of the imported name (e.g., given `from foo import bar as baz`, returns `["foo", "bar"]`).
crates/ruff_python_semantic/src/imports.rs:61
↓ 20 callers
Method
range
(&self)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:487
↓ 20 callers
Method
reachability_constraints
(&self)
crates/ty_python_core/src/use_def.rs:1055
↓ 20 callers
Function
remove_argument
Generic function to remove arguments or keyword arguments in function calls and class definitions. (For classes, `args` should be considered `bases`.)
crates/ruff_linter/src/fix/edits.rs:208
↓ 20 callers
Method
settings
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:961
↓ 20 callers
Method
sub
(mut self, sub: SubDiagnostic)
crates/ty_project/src/metadata/options.rs:2708
↓ 20 callers
Method
system
Returns the system wrapped by this test system.
crates/ruff_db/src/system/test.rs:106
↓ 20 callers
Method
to_search_paths
( &self, system: &dyn System, vendored: &VendoredFileSystem, strategy: &Strate
crates/ty_module_resolver/src/settings.rs:55
↓ 20 callers
Method
trailing
(&self, node: T)
crates/ruff_python_formatter/src/comments/mod.rs:326
↓ 20 callers
Method
try_call
Calls `self`. Returns a [`CallError`] if `self` is (always or possibly) not callable, or if the arguments are not compatible with the formal parameter
crates/ty_python_semantic/src/types.rs:8412
↓ 20 callers
Method
tuple
(tuple: TupleType<'db>)
crates/ty_python_semantic/src/types/instance.rs:98
↓ 20 callers
Method
type_argument
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:13108
↓ 19 callers
Method
add_binding
Add a binding for the given definition. Returns the result of the `infer_value_ty` closure, which is called with the declared type as type context.
crates/ty_python_semantic/src/types/infer/builder.rs:1579
↓ 19 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:450
↓ 19 callers
Function
any_over_type_expanding_aliases
Searches through type aliases without forcing other lazily inferred type attributes. Revisiting a recursive alias counts as a match because its speci
crates/ty_python_semantic/src/types/visitor.rs:1107
↓ 19 callers
Method
as_nominal_instance
(self)
crates/ty_python_semantic/src/types/instance.rs:141
↓ 19 callers
Method
as_slice
Returns a slice of all the [`TString`]s contained in this value.
crates/ruff_python_ast/src/nodes.rs:900
↓ 19 callers
Method
as_str
The code that is ignored by the `noqa` directive.
crates/ruff_linter/src/noqa.rs:103
↓ 19 callers
Method
as_str
(&self)
crates/ruff_linter/src/rules/ruff/rules/unused_noqa.rs:22
↓ 19 callers
Method
bump
(&mut self)
crates/ruff_python_trivia/src/cursor.rs:94
↓ 19 callers
Method
close
Closes the virtual file.
crates/ruff_db/src/files.rs:631
↓ 19 callers
Method
current_statements
Returns an [`Iterator`] over the current statement hierarchy, from the current [`Stmt`] through to any parents.
crates/ruff_python_semantic/src/model.rs:1482
↓ 19 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_trivia/src/cursor.rs:104
↓ 19 callers
Method
finish
(self)
crates/ruff_python_formatter/src/comments/visitor.rs:613
↓ 19 callers
Method
following_node
Returns the node following the comment. The direct child node (ignoring lists) of the [`enclosing_node`](DecoratedComment::enclosing_node) that follo
crates/ruff_python_formatter/src/comments/visitor.rs:313
↓ 19 callers
Method
is_empty
(&self)
crates/ruff_annotate_snippets/src/snippet.rs:95
↓ 19 callers
Method
is_global
(self)
crates/ty_python_core/src/scope.rs:108
↓ 19 callers
Function
is_overload
Returns `true` if a function definition is an `@overload`.
crates/ruff_python_semantic/src/analyze/visibility.rs:30
↓ 19 callers
Method
iter
(&self)
crates/ruff_unicode_names2_generator/src/trie.rs:60
↓ 19 callers
Method
join
(&self, component: &str)
crates/ty_module_resolver/src/path.rs:1001
↓ 19 callers
Method
matches
Returns `true` if the given name matches any of the ignored patterns.
crates/ruff_linter/src/rules/pep8_naming/settings.rs:140
↓ 19 callers
Function
metadata
()
crates/ty_project/src/uv/metadata/dependencies.rs:358
↓ 19 callers
Method
name
(self, db: &'db dyn Db, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/scope.rs:71
↓ 19 callers
Method
overloads_and_implementation
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/function.rs:928
↓ 19 callers
Function
parse_suite
(source: &str)
crates/ruff_linter/src/rules/pylint/helpers.rs:417
↓ 19 callers
Function
process
(__debug__)
crates/ruff_linter/resources/test/fixtures/semantic_errors/write_to_debug.py:3
↓ 19 callers
Method
program_file
(self, db: &'db dyn Db, file: File)
crates/ty_python_core/src/program.rs:51
↓ 19 callers
Method
program_file
(&self)
crates/ty_python_semantic/src/semantic_model.rs:78
← previous
next →
801–900 of 31,766, ranked by callers