Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
29,290 in github.com/astral-sh/ruff
⨍
Functions
29,290
◇
Types & classes
6,786
↳
Endpoints
82
↓ 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
(self, kind: TokenKind)
crates/ruff_python_parser/src/token_set.rs:24
↓ 21 callers
Method
suffix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1247
↓ 21 callers
Method
sum
(iter: I)
crates/ruff_text_size/src/size.rs:216
↓ 21 callers
Function
test_contents
A convenient wrapper around [`check_path`], that additionally asserts that fixes converge after a fixed number of iterations.
crates/ruff_linter/src/test.rs:245
↓ 21 callers
Method
to_lsp_range
( &self, db: &dyn Db, file: File, encoding: PositionEncoding, )
crates/ty_server/src/document/range.rs:288
↓ 21 callers
Method
write_files_all
Writes the files to the file system. The operation overrides existing files with the same normalized path. Enclosing directories are automatically c
crates/ruff_db/src/system/memory_fs.rs:212
↓ 20 callers
Method
apply_specialization
( self, db: &'db dyn Db, f: impl FnOnce(GenericContext<'db>) -> Specialization<'db>,
crates/ty_python_semantic/src/types/class/static_literal.rs:539
↓ 20 callers
Method
as_system_path
(&self)
crates/ty_module_resolver/src/path.rs:720
↓ 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
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:221
↓ 20 callers
Function
create_dir
Helper function to create a directory and all parent directories
crates/ruff_linter/src/rules/isort/categorize.rs:448
↓ 20 callers
Method
definition
(&self, id: ScopedDefinitionId)
crates/ty_python_core/src/use_def.rs:972
↓ 20 callers
Method
display
( self, db: &'db dyn Db, env: &'env ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/display.rs:642
↓ 20 callers
Method
display_with
( self, db: &'db dyn Db, env: &'env ProgramEnvironment<'db>, settings: Display
crates/ty_python_semantic/src/types/display.rs:655
↓ 20 callers
Method
expression_type
( &self, expression: impl Into<ExpressionNodeKey>, )
crates/ty_python_semantic/src/types/infer.rs:244
↓ 20 callers
Method
extend_from_slice
(&mut self, segments: &[&'a str])
crates/ruff_python_ast/src/name.rs:477
↓ 20 callers
Method
file_type
(&self)
crates/ruff_db/src/system.rs:312
↓ 20 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:3586
↓ 20 callers
Method
fmt
(&self, expression: &Expr, f: &mut PyFormatter)
crates/ruff_python_formatter/src/expression/mod.rs:76
↓ 20 callers
Function
global_symbol
(db: &'db TestDb, file: File, name: &str)
crates/ty_python_semantic/src/types/infer/tests.rs:29
↓ 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
Method
interior_node_data
(&self, node: NodeId)
crates/ty_python_semantic/src/types/constraints.rs:1463
↓ 20 callers
Method
is_disjoint_from
Return true if `self & other` should simplify to `Never`: if the intersection of the two types could never be inhabited by any possible runtime value.
crates/ty_python_semantic/src/types/relation.rs:869
↓ 20 callers
Method
is_known
Returns whether this is a known class.
crates/ty_python_semantic/src/types/class.rs:751
↓ 20 callers
Method
is_trivia
(&self)
crates/ruff_python_ast/src/token.rs:437
↓ 20 callers
Method
is_typevartuple
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:292
↓ 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
iter_all_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:964
↓ 20 callers
Method
kind
(&self)
crates/ty_ide/src/lib.rs:216
↓ 20 callers
Method
pop
(&mut self)
crates/ty_python_semantic/src/types/constraints.rs:5317
↓ 20 callers
Method
push
Pushes a new [`Binding`] and returns its [`BindingId`].
crates/ruff_python_semantic/src/binding.rs:466
↓ 20 callers
Method
range
(&self)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:487
↓ 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
report_diagnostic
( &self, context: &CallDiagnosticContext<'_, '_, 'db, '_>, node: ast::AnyNodeRef,
crates/ty_python_semantic/src/types/call/bind.rs:8915
↓ 20 callers
Method
scope
(&self)
crates/ty_python_semantic/src/types/context.rs:206
↓ 20 callers
Method
set_fix
Set the fix for this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:369
↓ 20 callers
Method
to_notebook_or_file
(&self, db: &dyn Db)
crates/ty_server/src/session.rs:1420
↓ 20 callers
Method
trailing
(&self, node: T)
crates/ruff_python_formatter/src/comments/mod.rs:310
↓ 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:6831
↓ 20 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:6854
↓ 20 callers
Method
when_all
( self, _db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, mut f: impl
crates/ty_python_semantic/src/types/constraints.rs:224
↓ 19 callers
Method
ancestor_ids
Returns an iterator over all [`NodeId`] ancestors, starting from the given [`NodeId`].
crates/ruff_python_semantic/src/nodes.rs:63
↓ 19 callers
Method
as_str
(&self)
crates/ruff_db/src/diagnostic/mod.rs:956
↓ 19 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/private_type_parameter.rs:82
↓ 19 callers
Function
bool
()
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM210.py:12
↓ 19 callers
Method
bump
Consumes the next character
crates/ruff_python_trivia/src/cursor.rs:82
↓ 19 callers
Method
collect_publish_diagnostic_notifications
( &mut self, count: usize, )
crates/ty_server/tests/e2e/main.rs:557
↓ 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:1466
↓ 19 callers
Method
default_type
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:364
↓ 19 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_trivia/src/cursor.rs:91
↓ 19 callers
Method
file
(self, db: &dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:512
↓ 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
Function
indentation_at_offset
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:49
↓ 19 callers
Method
is_ascii
Returns `true` if the text only consists of ASCII characters
crates/ruff_source_file/src/line_index.rs:227
↓ 19 callers
Method
is_empty
(&self)
crates/ruff_annotate_snippets/src/snippet.rs:95
↓ 19 callers
Method
is_empty
(&self, snapshot: &ScratchSnapshot)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:29
↓ 19 callers
Method
is_file
(self)
crates/ty_project/src/watch.rs:162
↓ 19 callers
Function
is_identifier
Returns `true` if a string is a valid Python identifier (e.g., variable name).
crates/ruff_python_stdlib/src/identifiers.rs:7
↓ 19 callers
Method
is_keyword_variadic
Returns `true` if this is a keyword-variadic parameter.
crates/ty_python_semantic/src/types/signatures.rs:5648
↓ 19 callers
Method
is_language_services_disabled
(&self)
crates/ty_server/src/session/settings.rs:43
↓ 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
is_string_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2318
↓ 19 callers
Method
load
Loads a reference to the parsed module. Note that holding on to the reference will prevent garbage collection of the AST. This method will reparse th
crates/ruff_db/src/parsed.rs:133
↓ 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
Method
metadata
Executes `uv workspace metadata` and parses and validates its output.
crates/ty_project/src/uv.rs:83
↓ 19 callers
Method
next
(&mut self)
crates/ruff_db/src/system/path.rs:979
↓ 19 callers
Method
paramspec_attr
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:1030
↓ 19 callers
Method
parse
Parses the content and returns its AST
crates/ruff_wasm/src/lib.rs:506
↓ 19 callers
Function
parse_suite
(source: &str)
crates/ruff_linter/src/rules/pylint/helpers.rs:414
↓ 19 callers
Function
predicate
(index: usize)
crates/ty_python_core/src/narrowing_constraints.rs:434
↓ 19 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:2750
↓ 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:48
↓ 19 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:60
↓ 19 callers
Method
range
Returns the [`TextRange`] for the diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:520
↓ 19 callers
Function
render_docstring
(raw: &str)
crates/ty_ide/src/docstring/markdown/structured/rst.rs:834
↓ 19 callers
Method
return_type
Compute the overall effective return type of this `ConstructorBinding`.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:311
↓ 19 callers
Method
seen_typing
(&self)
crates/ruff_python_semantic/src/model.rs:1716
↓ 19 callers
Method
source
(&self)
crates/ruff_linter/src/rules/pep8_naming/settings.rs:63
↓ 19 callers
Method
stmt
Generate source code from a [`Stmt`].
crates/ruff_python_codegen/src/generator.rs:140
↓ 19 callers
Method
tokens
Returns all the tokens for the parsed output.
crates/ruff_python_parser/src/lib.rs:401
↓ 19 callers
Function
trailing
()
crates/ruff_python_formatter/src/comments/map.rs:643
↓ 19 callers
Method
ty
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:1276
↓ 19 callers
Method
vendored
(&self)
crates/ty_module_resolver/src/resolve.rs:1887
↓ 19 callers
Function
walk_stmt
(visitor: &mut V, stmt: &'a Stmt)
crates/ruff_python_ast/src/visitor.rs:135
↓ 19 callers
Method
workspace_settings
Returns the client settings for the workspace that this document belongs to.
crates/ty_server/src/session.rs:1407
↓ 18 callers
Method
append
(self)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/preview_long_strings__regression.py:109
↓ 18 callers
Method
as_str
(self)
crates/ty_module_resolver/src/module.rs:414
↓ 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
bytes
Returns an iterator over the bytes of the concatenated bytestring.
crates/ruff_python_ast/src/nodes.rs:1908
↓ 18 callers
Method
child_scopes
Returns an iterator over the direct child scopes of `scope`.
crates/ty_python_core/src/lib.rs:562
↓ 18 callers
Method
close
Closes the virtual file.
crates/ruff_db/src/files.rs:629
↓ 18 callers
Method
constraint_data
(&self, constraint: ConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1401
↓ 18 callers
Method
contents
Return the underlying source code.
crates/ruff_linter/src/locator.rs:106
↓ 18 callers
Method
element_type
(self, _db: &'db dyn Db)
crates/ty_python_semantic/src/types/tuple.rs:917
↓ 18 callers
Method
enter_node
(&mut self, node: T)
crates/ruff_python_ast_integration_tests/tests/visitor.rs:205
↓ 18 callers
Method
exactly_one
(self)
crates/ty_python_semantic/src/types/callable.rs:653
↓ 18 callers
Method
exit_node
(&mut self)
crates/ruff_python_ast_integration_tests/tests/visitor.rs:213
← previous
next →
701–800 of 29,290, ranked by callers