Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
28,707 in github.com/astral-sh/ruff
⨍
Functions
28,707
◇
Types & classes
6,694
↳
Endpoints
82
↓ 9 callers
Method
raw_value_type
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/type_alias.rs:82
↓ 9 callers
Method
remove_directory
Deletes the directory at `path`. ## Errors If the directory is not empty The `path` is not a directory The `path` does not exist
crates/ruff_db/src/system/memory_fs.rs:337
↓ 9 callers
Function
remove_file
()
crates/ruff_db/src/system/memory_fs.rs:971
↓ 9 callers
Method
root
(&self)
crates/ty_server/tests/e2e/main.rs:1532
↓ 9 callers
Function
rule
Explain a `Rule` to the user.
crates/ruff/src/commands/rule.rs:101
↓ 9 callers
Method
run
(mut self)
crates/ty_server/src/server.rs:162
↓ 9 callers
Method
scope
(&self, id: FileScopeId)
crates/ty_python_core/src/lib.rs:428
↓ 9 callers
Method
secondary_code_or_id
Returns the secondary code for the diagnostic if it exists, or the lint name otherwise. This is a common pattern for Ruff diagnostics, which want to
crates/ruff_db/src/diagnostic/mod.rs:441
↓ 9 callers
Function
sequence_pattern_type_builder
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/match_pattern.rs:120
↓ 9 callers
Method
settings
(&self)
crates/ty_test/src/db.rs:56
↓ 9 callers
Method
show_error_message
Sends a request to display an error to the client with a formatted message. The error is sent in a `window/showMessage` notification. Logs an error i
crates/ty_server/src/session/client.rs:193
↓ 9 callers
Method
show_fix_status
(&self)
crates/ruff_db/src/diagnostic/mod.rs:1568
↓ 9 callers
Method
site_packages_paths
( &self, system: &dyn System, )
crates/ty_site_packages/src/lib.rs:379
↓ 9 callers
Function
skip_chars
(src: str, pos: Pos, chars: Iterable[str])
crates/ruff_benchmark/resources/tomllib/_parser.py:232
↓ 9 callers
Function
soft_line_break_or_space
()
crates/ruff_formatter/src/builders.rs:190
↓ 9 callers
Method
source_location
( &self, offset: TextSize, position_encoding: PositionEncoding, )
crates/ruff_source_file/src/lib.rs:44
↓ 9 callers
Method
split_around_star
Return the patterns before and after the starred element.
crates/ty_python_core/src/predicate.rs:173
↓ 9 callers
Function
test_helper
(source: &str, expected: usize)
crates/ruff_linter/src/rules/pylint/rules/too_many_return_statements.rs:105
↓ 9 callers
Function
text
Creates a text from a dynamic string. This is done by allocating a new string internally.
crates/ruff_formatter/src/builders.rs:343
↓ 9 callers
Method
text_len
Returns the length of the indentation in bytes. # Panics If the indentation is longer than 4GB.
crates/ruff_python_formatter/src/string/docstring.rs:1734
↓ 9 callers
Method
text_len
(&self)
crates/ruff_python_trivia/src/cursor.rs:64
↓ 9 callers
Method
text_len
(self)
crates/ruff_python_ast/src/str_prefix.rs:39
↓ 9 callers
Method
to_module_path
(&self)
crates/ty_module_resolver/src/path.rs:581
↓ 9 callers
Method
truncated_display
Return a truncated snippet for user-facing display.
crates/ruff_linter/src/fix/snippet.rs:27
↓ 9 callers
Method
try_call_dunder_with_policy
Same as `try_call_dunder`, but allows specifying a policy for the member lookup. In particular, this allows to specify `MemberLookupPolicy::MRO_NO_OBJ
crates/ty_python_semantic/src/types.rs:6495
↓ 9 callers
Method
try_map
A fallible version of [`UnionType::map`]. For each element in `self`, `transform_fn` is called on that element. If `transform_fn` returns `Some()` fo
crates/ty_python_semantic/src/types/set_theoretic.rs:227
↓ 9 callers
Method
try_register_static_roots
Registers file roots for all non-dynamically discovered search paths.
crates/ty_module_resolver/src/resolve.rs:851
↓ 9 callers
Method
try_set_optional_fix
( &mut self, func: impl FnOnce() -> anyhow::Result<Option<Fix>>, )
crates/ruff_linter/src/checkers/ast/mod.rs:3743
↓ 9 callers
Method
typing_importer
Create a [`TypingImporter`] that will import `member` from either `typing` or `typing_extensions`. On Python <`version_added_to_typing`, `member` is
crates/ruff_linter/src/checkers/ast/mod.rs:640
↓ 9 callers
Function
update_file
Updates the content of a file and ensures that the last modified file time is updated.
crates/ty/tests/file_watching.rs:547
↓ 9 callers
Function
vendored_path_to_file
( db: &dyn Db, path: impl AsRef<VendoredPath>, )
crates/ruff_db/src/files.rs:51
↓ 9 callers
Function
walk_pattern
(visitor: &mut V, pattern: &'a Pattern)
crates/ruff_python_ast/src/visitor.rs:760
↓ 9 callers
Method
warning
Override the output style for [warnings][crate::Level::WARNING]
crates/ruff_annotate_snippets/src/renderer/mod.rs:216
↓ 9 callers
Function
workspace_case
()
crates/ty/tests/cli/uv_workspace.rs:13
↓ 9 callers
Method
write
Write the notebook back to the given [`Write`] implementer.
crates/ruff_notebook/src/notebook.rs:461
↓ 9 callers
Method
write_files
(&self, files: impl IntoIterator<Item = (SystemPathBuf, &'a str)>)
crates/ruff_db/src/system/os/ignore.rs:62
↓ 8 callers
Method
__init__
(self, foo)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:332
↓ 8 callers
Method
absolute
Makes a path absolute and normalizes it without accessing the file system. Adapted from [cargo](https://github.com/rust-lang/cargo/blob/fede83ccf9734
crates/ruff_db/src/system/path.rs:447
↓ 8 callers
Method
add
Attempts to adds the given completion to this collection. When added, `true` is returned. This might not add the completion for a variety of reasons
crates/ty_ide/src/completion.rs:244
↓ 8 callers
Method
add
(x, y)
crates/ruff_linter/resources/test/fixtures/refurb/FURB118.py:47
↓ 8 callers
Function
add_argument
Generic function to add arguments or keyword arguments to function calls. The new argument will be inserted before the first existing keyword argumen
crates/ruff_linter/src/fix/edits.rs:274
↓ 8 callers
Method
after
Returns a slice of tokens after the given [`TextSize`] offset. If the given offset is between two tokens, the returned slice will start from the foll
crates/ruff_python_ast/src/token/tokens.rs:174
↓ 8 callers
Method
all_rules
Return all matching rules, regardless of rule group filters like preview and deprecated.
crates/ruff_linter/src/rule_selector.rs:260
↓ 8 callers
Method
applies
Return [`true`] if this [`Fix`] should be applied with at a given [`Applicability`].
crates/ruff_diagnostics/src/fix.rs:163
↓ 8 callers
Method
as_assign_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:584
↓ 8 callers
Method
as_fixed_length
Returns the inner fixed-length tuple if this is a `Tuple::Fixed` variant.
crates/ty_python_semantic/src/types/tuple.rs:2346
↓ 8 callers
Method
as_ipy_notebook
(&self)
crates/ruff_linter/src/source_kind.rs:34
↓ 8 callers
Method
as_str
(&self)
crates/ruff_python_ast/src/name.rs:96
↓ 8 callers
Method
as_string
(self)
crates/ty_python_semantic/src/types/literal.rs:203
↓ 8 callers
Function
attribute_scopes
Returns all attribute assignments as scope IDs for a specific class body scope. Only call this when doing type inference on the same file as `class_b
crates/ty_python_core/src/lib.rs:175
↓ 8 callers
Method
base
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/newtype.rs:49
↓ 8 callers
Method
binary_search
(&self, value: &T)
crates/ruff_index/src/slice.rs:121
↓ 8 callers
Function
bind_markdown_snapshot_filters
()
crates/ty_ide/src/docstring/markdown/structured.rs:1100
↓ 8 callers
Method
bindings
Returns a tuple of the name and ID of all bindings defined in this scope.
crates/ruff_python_semantic/src/scope.rs:103
↓ 8 callers
Method
block_comments
Given a [`CommentRanges`], determine which comments are grouped together in "comment blocks". A "comment block" is a sequence of consecutive own-line
crates/ruff_python_trivia/src/comment_ranges.rs:157
↓ 8 callers
Method
bool
Determine whether instances of this class are always truthy, always falsy, or have an ambiguous truthiness. Returns `None` for `KnownClass::Tuple`, s
crates/ty_python_semantic/src/types/class/known.rs:181
↓ 8 callers
Method
build
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:3175
↓ 8 callers
Function
check_display_graph
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, set: ConstraintSet<'db, 'c>
crates/ty_python_semantic/src/types/constraints.rs:8078
↓ 8 callers
Method
class_member_with_policy
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, name: &str, po
crates/ty_python_semantic/src/types.rs:3195
↓ 8 callers
Method
clear_salsa_events
Clears the salsa events.
crates/ty_module_resolver/src/db.rs:84
↓ 8 callers
Method
clear_salsa_events
Clears the salsa events. ## Panics If there are any pending salsa snapshots.
crates/ty_python_semantic/src/db.rs:125
↓ 8 callers
Function
command_with_uv
(case: &CliTest, virtual_env: Option<&Path>)
crates/ty/tests/cli/uv_workspace.rs:52
↓ 8 callers
Method
current_statement_id
Return the [`NodeId`] of the current [`Stmt`], if any.
crates/ruff_python_semantic/src/model.rs:1519
↓ 8 callers
Method
default_string_flags
Return the default string flags a generated `StringLiteral` node should use, given where we are in the AST.
crates/ruff_linter/src/checkers/ast/mod.rs:373
↓ 8 callers
Method
definition
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/type_alias.rs:55
↓ 8 callers
Function
deserialize_fixture
(content: &str)
crates/ruff_server/src/session/options.rs:522
↓ 8 callers
Method
document_diagnostic_request
Send a `textDocument/diagnostic` request for the document at the given path.
crates/ruff_server/tests/e2e/main.rs:785
↓ 8 callers
Function
document_symbols
Get all document symbols for a file with the given options.
crates/ty_ide/src/document_symbols.rs:6
↓ 8 callers
Function
documentation_trim
Normalizes tabs and trims a docstring as specified in PEP-0257 See: <https://peps.python.org/pep-0257/#handling-docstring-indentation>
crates/ty_ide/src/docstring.rs:89
↓ 8 callers
Method
downstream_constructor_mut
(&mut self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:282
↓ 8 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_parser/src/lexer/cursor.rs:104
↓ 8 callers
Function
empty_line
()
crates/ruff_formatter/src/builders.rs:133
↓ 8 callers
Method
enabled
(&self, rule: Rule)
crates/ruff_linter/src/settings/rule_table.rs:27
↓ 8 callers
Method
error
()
crates/ruff_linter/resources/test/fixtures/flake8_raise/RSE102.py:58
↓ 8 callers
Function
exactly_one_argument_with_matching_function
( name: &str, func: &Expr, args: &'a [Expr], keywords: &[Keyword], )
crates/ruff_linter/src/rules/flake8_comprehensions/helpers.rs:3
↓ 8 callers
Method
execution_context
Return the [`ExecutionContext`] of the current scope.
crates/ruff_python_semantic/src/model.rs:2080
↓ 8 callers
Method
expression_scope_id
(&self, expression: &E)
crates/ty_python_core/src/lib.rs:403
↓ 8 callers
Method
extend
(&mut self, other: Self)
crates/ty_site_packages/src/lib.rs:105
↓ 8 callers
Method
extend_back
(&mut self, elements: &'a [FormatElement])
crates/ruff_formatter/src/printer/queue.rs:105
↓ 8 callers
Function
f
(*args, **kwargs)
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/call.py:4
↓ 8 callers
Function
f
()
crates/ruff_python_parser/resources/valid/other/decorator.py:12
↓ 8 callers
Method
fallback
Returns the descriptor's declared return type and kind despite the invalid call.
crates/ty_python_semantic/src/types.rs:595
↓ 8 callers
Method
file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:329
↓ 8 callers
Method
file_expression_type
Get the type of an expression from any scope in the same file. If the expression is in the current scope, and we are inferring the entire scope, just
crates/ty_python_semantic/src/types/infer/builder.rs:989
↓ 8 callers
Method
file_stem
(&self)
crates/ruff_db/src/system/path.rs:290
↓ 8 callers
Method
find_legacy_typevars
Locates any legacy `TypeVar`s in this type, and adds them to a set. This is used to build up a generic context from any legacy `TypeVar`s that appear
crates/ty_python_semantic/src/types.rs:7964
↓ 8 callers
Method
finish
Finish the code example by generating any final actions if applicable. This typically adds an action when the end of a code example coincides with th
crates/ruff_python_formatter/src/string/docstring.rs:743
↓ 8 callers
Method
finite_alternative_union
Return the exact finite alternative union represented by this intersection, if available.
crates/ty_python_semantic/src/types/set_theoretic.rs:815
↓ 8 callers
Method
flags
(self)
crates/ty_python_semantic/src/types/literal.rs:105
↓ 8 callers
Method
flush_pending_line
Flushes content buffered for the current line.
crates/ty_ide/src/docstring/markdown/general.rs:307
↓ 8 callers
Method
fmt
(&self, item: &Identifier, f: &mut PyFormatter)
crates/ruff_python_formatter/src/other/identifier.rs:11
↓ 8 callers
Function
format
( document: &TextDocument, source_type: SourceType, formatter_settings: &FormatterSettings, pa
crates/ruff_server/src/format.rs:47
↓ 8 callers
Method
format
(&self)
crates/ruff_python_formatter/src/statement/mod.rs:74
↓ 8 callers
Method
formatted
Converts every item to an object that knows how to format it.
crates/ruff_python_formatter/src/shared_traits.rs:70
↓ 8 callers
Method
full_line_range
Computes the range of this `offset`s line. The range starts at the beginning of the line and goes up to, and including, the new line character at the
crates/ruff_source_file/src/line_ranges.rs:98
↓ 8 callers
Method
full_lines_range
Computes the range of all lines that this `range` covers. The range starts at the beginning of the line at `range.start()` and goes up to, and includ
crates/ruff_source_file/src/line_ranges.rs:193
↓ 8 callers
Function
full_range
(input: &str)
crates/ty_server/tests/e2e/code_actions.rs:35
↓ 8 callers
Method
get_or_infer_expression
Return an already-inferred type for `expr`, or infer it with `tcx` if needed. This is used in places where an expression may already have been inferr
crates/ty_python_semantic/src/types/infer/builder.rs:941
↓ 8 callers
Method
global_scope
Returns a reference to the global [`Scope`].
crates/ruff_python_semantic/src/model.rs:1529
↓ 8 callers
Method
has_dataclass_param
Checks if the given dataclass parameter flag is set for this class. This checks both the `dataclass_params` and `transformer_params`.
crates/ty_python_semantic/src/types/class/static_literal.rs:1102
← previous
next →
1,501–1,600 of 28,707, ranked by callers