Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,349 in github.com/astral-sh/ruff
⨍
Functions
27,349
◇
Types & classes
6,530
↳
Endpoints
82
↓ 19 callers
Method
tokens
Returns all the tokens for the parsed output.
crates/ruff_python_parser/src/lib.rs:401
↓ 19 callers
Method
top_materialization
Returns the top materialization for this class.
crates/ty_python_semantic/src/types/class.rs:901
↓ 19 callers
Function
trailing
()
crates/ruff_python_formatter/src/comments/map.rs:643
↓ 19 callers
Function
walk_stmt
(visitor: &mut V, stmt: &'a Stmt)
crates/ruff_python_ast/src/visitor.rs:135
↓ 18 callers
Method
anonymized_line_numbers
Anonymize line numbers This enables (or disables) line number anonymization. When enabled, line numbers are replaced with `LL`. # Example ```text -
crates/ruff_annotate_snippets/src/renderer/mod.rs:99
↓ 18 callers
Method
append
(self)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/preview_long_strings__regression.py:109
↓ 18 callers
Method
as_function
(&self)
crates/ty_python_core/src/scope.rs:413
↓ 18 callers
Method
binding_id
Returns the [`BindingId`] if this symbol resolves to a concrete binding.
crates/ruff_python_semantic/src/model.rs:44
↓ 18 callers
Method
class
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/instance.rs:233
↓ 18 callers
Method
collect_publish_diagnostic_notifications
( &mut self, count: usize, )
crates/ty_server/tests/e2e/main.rs:568
↓ 18 callers
Method
contents
Return the underlying source code.
crates/ruff_linter/src/locator.rs:128
↓ 18 callers
Method
definition
(&self, id: ScopedDefinitionId)
crates/ty_python_core/src/use_def.rs:946
↓ 18 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_trivia/src/cursor.rs:91
↓ 18 callers
Method
end_of_scope_symbol_bindings
( &self, symbol: ScopedSymbolId, )
crates/ty_python_core/src/use_def.rs:978
↓ 18 callers
Method
enter_node
(&mut self, node: T)
crates/ruff_python_ast_integration_tests/tests/visitor.rs:205
↓ 18 callers
Method
exact_tuple_instance_spec
If this type is an *exact* tuple type (*not* a subclass of `tuple`), returns the tuple spec. You usually don't want to use this method, as you usuall
crates/ty_python_semantic/src/types.rs:1498
↓ 18 callers
Method
exit_node
(&mut self)
crates/ruff_python_ast_integration_tests/tests/visitor.rs:213
↓ 18 callers
Method
expression_type
( &self, expression: impl Into<ExpressionNodeKey>, )
crates/ty_python_semantic/src/types/infer.rs:219
↓ 18 callers
Function
file_to_module
(db: &dyn Db, file: File)
crates/ty_module_resolver/src/resolve.rs:293
↓ 18 callers
Method
finish
(self)
crates/ty_python_core/src/place.rs:419
↓ 18 callers
Method
format
Whether to enable concise diagnostic output or not.
crates/ruff_db/src/diagnostic/mod.rs:1471
↓ 18 callers
Method
generic_context
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:259
↓ 18 callers
Method
has_leading
(&self, node: T)
crates/ruff_python_formatter/src/comments/mod.rs:272
↓ 18 callers
Method
inference_flags
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:10566
↓ 18 callers
Method
into_iter
(self)
crates/ty_site_packages/src/lib.rs:255
↓ 18 callers
Method
is_file
(self)
crates/ruff_db/src/system.rs:305
↓ 18 callers
Method
is_language_services_disabled
(&self)
crates/ty_server/src/session/settings.rs:39
↓ 18 callers
Method
is_string_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2318
↓ 18 callers
Method
is_triple_quoted
Returns `true` if the current f-string is a triple-quoted f-string.
crates/ruff_python_parser/src/lexer/interpolated_string.rs:75
↓ 18 callers
Method
kind
(&self)
crates/ty_python_core/src/builder.rs:4980
↓ 18 callers
Method
node_index
Returns the anchor node index for this scope, or `None` for the module scope. This is used to compute relative node indices for expressions within th
crates/ty_python_core/src/scope.rs:439
↓ 18 callers
Method
open
(self, server: &mut TestServer)
crates/ty_server/tests/e2e/notebook.rs:629
↓ 18 callers
Method
p
(&mut self, s: &str)
crates/ruff_python_codegen/src/generator.rs:171
↓ 18 callers
Function
predicate
(index: usize)
crates/ty_python_core/src/narrowing_constraints.rs:425
↓ 18 callers
Method
prefix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:912
↓ 18 callers
Method
push
(&mut self, bindings: &Bindings)
crates/ty_python_core/src/use_def.rs:465
↓ 18 callers
Function
render_docstring
(raw: &str)
crates/ty_ide/src/docstring/markdown/structured/rst.rs:819
↓ 18 callers
Method
report_diagnostic
( &self, context: &InferContext<'db, '_>, node: ast::AnyNodeRef, callable_ty:
crates/ty_python_semantic/src/types/call/bind.rs:7116
↓ 18 callers
Method
sum
(iter: I)
crates/ruff_text_size/src/size.rs:216
↓ 18 callers
Method
try_call_dunder
Look up a dunder method on the meta-type of `self` and call it. Returns an `Err` if the dunder method can't be called, or the given arguments are not
crates/ty_python_semantic/src/types.rs:5451
↓ 18 callers
Method
vendored
(&self)
crates/ty_module_resolver/src/resolve.rs:1748
↓ 18 callers
Method
with_file
( mut self, path: &'a (impl AsRef<SystemPath> + ?Sized), content: &'a str,
crates/ty_python_semantic/src/db.rs:202
↓ 18 callers
Method
workspace_settings
Returns the client settings for the workspace that this document belongs to.
crates/ty_server/src/session.rs:1398
↓ 17 callers
Method
as_str
(self)
crates/ty_module_resolver/src/module.rs:357
↓ 17 callers
Function
binding_type
Infer the type of a binding.
crates/ty_python_semantic/src/types.rs:220
↓ 17 callers
Function
check_os_pathlib_single_arg_calls
We check functions that take only 1 argument, this does not apply to functions with `dir_fd` argument, because `dir_fd` is not supported by pathlib,
crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs:53
↓ 17 callers
Function
create_typevar
(db: &'db dyn Db, name: &'static str)
crates/ty_python_semantic/src/types/constraints.rs:7031
↓ 17 callers
Function
delete_stmt
Return the [`Edit`] to use when deleting a [`Stmt`]. In some cases, this is as simple as deleting the [`TextRange`] of the [`Stmt`] itself. However,
crates/ruff_linter/src/fix/edits.rs:39
↓ 17 callers
Method
display
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/display.rs:605
↓ 17 callers
Method
drain
(&mut self, range: R)
crates/ruff_index/src/vec.rs:42
↓ 17 callers
Method
explicit_extra_items
Returns extra items only when they were explicitly declared. An implicitly open `TypedDict` returns `None` here because its hidden items are not dire
crates/ty_python_semantic/src/types/typed_dict.rs:93
↓ 17 callers
Method
extension
(&self)
crates/ty_module_resolver/src/path.rs:838
↓ 17 callers
Method
first_public_binding
(&self, symbol: ScopedSymbolId)
crates/ty_python_core/src/lib.rs:1088
↓ 17 callers
Method
format
(&self)
crates/ruff_python_formatter/src/generated.rs:24
↓ 17 callers
Method
in_range
Initialize [`NoqaLexer`] in the given range of source text.
crates/ruff_linter/src/noqa.rs:408
↓ 17 callers
Function
indentation_at_offset
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:5
↓ 17 callers
Method
insert
(mut self, insert: impl Into<Name>)
crates/ty_ide/src/completion.rs:516
↓ 17 callers
Method
into_iter
(self)
crates/ty_python_semantic/src/types/infer/builder.rs:11065
↓ 17 callers
Method
into_iter
(self)
crates/ruff_linter/src/registry/rule_set.rs:337
↓ 17 callers
Method
is_ellipsis_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2503
↓ 17 callers
Method
is_ipynb
(self)
crates/ruff_python_ast/src/lib.rs:148
↓ 17 callers
Method
iter_all_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:652
↓ 17 callers
Method
len
(&self)
crates/ruff_db/src/parsed.rs:477
↓ 17 callers
Method
len
Returns the number of rules in this set. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; assert_eq!(RuleSet::empty().len(), 0); as
crates/ruff_linter/src/registry/rule_set.rs:181
↓ 17 callers
Method
name
(self, db: &'db dyn Db, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/scope.rs:57
↓ 17 callers
Method
node
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1442
↓ 17 callers
Method
node_level
(&self)
crates/ruff_python_formatter/src/context.rs:65
↓ 17 callers
Method
paramspec_attr
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:883
↓ 17 callers
Method
pop
(&mut self)
crates/ty_python_semantic/src/types/constraints.rs:6720
↓ 17 callers
Method
prefix
Return the prefix for the [`NoqaCode`], e.g., `SIM` for `SIM101`.
crates/ruff_linter/src/codes.rs:19
↓ 17 callers
Method
remove_file
(self, db: &mut dyn Db, file: File)
crates/ty_project/src/lib.rs:595
↓ 17 callers
Function
rename
Perform a rename operation on the symbol at the given position. Returns all locations that need to be updated with the new name.
crates/ty_ide/src/rename.rs:51
↓ 17 callers
Method
search
Returns a sequence of symbols that matches the given query.
crates/ty_ide/src/symbols.rs:152
↓ 17 callers
Method
shrink_to_fit
(&mut self)
crates/ty_python_semantic/src/types/diagnostic.rs:1314
↓ 17 callers
Function
site_packages_directories_from_sys_prefix
Attempt to retrieve the `site-packages` directories associated with a given Python installation. The location of the `site-packages` directories can
crates/ty_site_packages/src/lib.rs:1597
↓ 17 callers
Method
suffix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:927
↓ 17 callers
Method
system
(&self)
crates/ruff_db/src/system/test.rs:90
↓ 17 callers
Method
try_upcast_to_callable
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/callable.rs:44
↓ 17 callers
Method
type_argument
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:8815
↓ 17 callers
Method
visit_body
(&mut self, body: &'db [ast::Stmt])
crates/ty_ide/src/symbols.rs:817
↓ 17 callers
Method
with_failure_code
(self, code: server::ErrorCode)
crates/ruff_server/src/server/api.rs:383
↓ 16 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:1238
↓ 16 callers
Method
add_python_cell
(&mut self, content: &str)
crates/ty_server/tests/e2e/notebook.rs:596
↓ 16 callers
Method
as_code
Access the resulting code, borrowing the result
crates/ruff_formatter/src/lib.rs:414
↓ 16 callers
Method
as_function_def
Return the [`ast::StmtFunctionDef`] of the definition, if it's a function definition.
crates/ruff_python_semantic/src/definition.rs:174
↓ 16 callers
Method
as_function_def_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:399
↓ 16 callers
Method
as_system
(&self)
crates/ty_test/src/db.rs:330
↓ 16 callers
Method
as_type
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:1558
↓ 16 callers
Method
assert_progressing
(&mut self, p: &Parser)
crates/ruff_python_parser/src/parser/progress.rs:35
↓ 16 callers
Method
build
(self)
crates/ty_python_semantic/src/db.rs:211
↓ 16 callers
Function
catch_unwind
Invokes a closure, capturing and returning the cause of an unwinding panic if one occurs. ### Thread safety This is implemented by installing a cust
crates/ruff_db/src/panic.rs:145
↓ 16 callers
Method
current_expressions
Returns an [`Iterator`] over the current expression hierarchy, from the current [`Expr`] through to any parents.
crates/ruff_python_semantic/src/model.rs:1487
↓ 16 callers
Method
default_specialization
Returns the default specialization for this class. For static classes, this applies default type arguments. For dynamic classes, this returns a non-g
crates/ty_python_semantic/src/types/class.rs:620
↓ 16 callers
Method
files
Returns the files belonging to this project.
crates/ty_project/src/lib.rs:688
↓ 16 callers
Method
focus_range
Returns the [`FileRange`] of the function's name.
crates/ty_python_semantic/src/types/function.rs:404
↓ 16 callers
Method
get
Looks up a lint by its name.
crates/ty_python_semantic/src/lint.rs:413
↓ 16 callers
Method
into_inner
(self)
crates/ty_python_semantic/src/types/callable.rs:659
↓ 16 callers
Method
is_global
Returns `true` if this is the id of the global scope
crates/ruff_python_semantic/src/scope.rs:252
↓ 16 callers
Method
is_global
(self)
crates/ty_python_core/src/scope.rs:94
↓ 16 callers
Method
is_literal_expr
Returns `true` if the expression is a literal expression. A literal expression is either a string literal, bytes literal, integer, float, complex num
crates/ruff_python_ast/src/nodes.rs:63
← previous
next →
701–800 of 27,349, ranked by callers