Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,562 in github.com/astral-sh/ruff
⨍
Functions
31,562
◇
Types & classes
7,116
↳
Endpoints
82
↓ 1,541 callers
Method
to_string
(&self)
crates/ruff_python_literal/src/escape.rs:142
↓ 1,465 callers
Function
default
(other: str = Depends(something_else))
crates/ruff_linter/resources/test/fixtures/fastapi/FAST003.py:161
↓ 868 callers
Method
map
( self, db: &'db dyn Db, transform_fn: impl FnMut(&Type<'db>) -> Type<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:2190
↓ 753 callers
Method
report_diagnostic
Report a diagnostic if the associated rule is enabled.
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:723
↓ 724 callers
Method
map
Return this reformatted line, but with the given function applied to the text of the line.
crates/ruff_python_formatter/src/string/docstring.rs:664
↓ 657 callers
Function
print
(s: str)
crates/ruff_linter/resources/test/fixtures/ruff/RUF030.py:98
↓ 619 callers
Method
semantic
The [`SemanticModel`], built up over the course of the AST traversal.
crates/ruff_linter/src/checkers/ast/mod.rs:543
↓ 601 callers
Method
expect
Eat the current token if its of the expected kind, otherwise adds an appropriate error.
crates/ruff_python_parser/src/parser/mod.rs:618
↓ 558 callers
Method
start
(self)
crates/ruff_text_size/src/range.rs:121
↓ 493 callers
Method
clone
(&self)
crates/ty_project/src/parallel.rs:73
↓ 478 callers
Method
unwrap_or
(self, fallback: T)
crates/ty_python_semantic/src/types/recursive.rs:771
↓ 477 callers
Method
end
(self)
crates/ruff_text_size/src/range.rs:127
↓ 458 callers
Function
cursor_test
A way to create a simple single-file (named `main.py`) cursor test. Use cases that require multiple files with a `<CURSOR>` marker in a file other th
crates/ty_ide/src/lib.rs:429
↓ 452 callers
Method
join
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:357
↓ 419 callers
Method
is_none
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:2720
↓ 411 callers
Method
and_then
(self, other: impl FnOnce() -> Self)
crates/ty_python_core/src/lib.rs:1068
↓ 409 callers
Method
filter
(self, db: &'db dyn Db, f: impl FnMut(&Type<'db>) -> bool)
crates/ty_python_semantic/src/types/set_theoretic.rs:535
↓ 402 callers
Method
as_ref
(&self)
crates/ruff_db/src/vendored.rs:354
↓ 400 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/lib.rs:595
↓ 373 callers
Method
any
()
crates/ty_python_semantic/src/types.rs:2442
↓ 366 callers
Method
unwrap_or_else
(self, fallback: impl FnOnce() -> T)
crates/ty_python_semantic/src/types/recursive.rs:762
↓ 364 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:934
↓ 348 callers
Method
as_ref
(&self)
crates/ty_python_core/src/member.rs:201
↓ 343 callers
Function
completion_test_builder
A way to create a simple single-file (named `main.py`) completion test builder. Use cases that require multiple files with a `<CURSOR>` marker in a f
crates/ty_ide/src/completion.rs:11532
↓ 327 callers
Method
set_fix
(&mut self, fix: Fix)
crates/ruff_linter/src/checkers/ast/mod.rs:3901
↓ 326 callers
Function
test_path
( path: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:126
↓ 324 callers
Method
build
(&self)
crates/ty_ide/src/lib.rs:521
↓ 320 callers
Method
iter
This is not an IntoIterator implementation because I have no desire to try to name the iterator type.
crates/ty_python_semantic/src/types/typevar.rs:2026
↓ 310 callers
Method
any
(&self, rules: &[Rule])
crates/ruff_linter/src/registry/rule_set.rs:256
↓ 292 callers
Method
is_empty
(&self)
crates/ruff_linter/src/rules/ruff/rules/unnecessary_regular_expression.rs:374
↓ 277 callers
Method
ok
(self)
crates/ruff_linter/resources/test/fixtures/pylint/self_or_cls_assignment.py:28
↓ 274 callers
Method
clone
(&self)
crates/ruff_db/src/system/test.rs:32
↓ 274 callers
Method
to_string
Returns the text representation of this goto target. Returns `None` if no meaningful string representation can be provided. This is used by the "refer
crates/ty_ide/src/goto.rs:912
↓ 266 callers
Method
iter
(&'a self)
crates/ruff_linter/src/rules/isort/block.rs:115
↓ 261 callers
Method
contains
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarIdentity<'db>, )
crates/ty_python_semantic/src/types/generics.rs:568
↓ 260 callers
Method
collect
(mut self, module: &Mod)
crates/ruff_graph/src/collector.rs:36
↓ 259 callers
Method
collect
Append deprecations without discarding earlier union alternatives when a non-deprecated intersection member suppresses the current alternative's warni
crates/ty_python_semantic/src/types/call/bind.rs:983
↓ 252 callers
Function
default
(path: &Path)
crates/ruff_linter/src/rules/isort/mod.rs:384
↓ 251 callers
Method
load
Loads an [`OwnedConstraintSet`] into this builder. The BDD structure inside a builder depends on the ordering of constraints and typevars in the buil
crates/ty_python_semantic/src/types/constraints.rs:1258
↓ 250 callers
Method
resolve_qualified_name
Resolves the [`Expr`] to a fully-qualified symbol-name, if `value` resolves to an imported or builtin symbol. E.g., given: ```python from sys impor
crates/ruff_python_semantic/src/model.rs:1197
↓ 249 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:926
↓ 244 callers
Method
push
(&mut self, element: T)
crates/ty_python_semantic/src/types/tuple.rs:2972
↓ 242 callers
Method
span
Annotate a byte span within [`Snippet`]
crates/ruff_annotate_snippets/src/snippet.rs:434
↓ 241 callers
Function
setup_db
()
crates/ty_python_semantic/src/db.rs:338
↓ 238 callers
Method
element
Append an [`Element`] that adds context to the [`Title`]
crates/ruff_annotate_snippets/src/snippet.rs:84
↓ 233 callers
Method
decor_style
Set the character set used for rendering decor
crates/ruff_annotate_snippets/src/renderer/mod.rs:176
↓ 230 callers
Function
parsed_module
(db: &dyn Db, file: PythonFile<'_>)
crates/ruff_db/src/parsed.rs:35
↓ 224 callers
Method
primary_title
For the primary, or root cause, [`Group`][crate::Group] (the first) in a [`Report`][crate::Report] See [`Group::with_title`][crate::Group::with_title
crates/ruff_annotate_snippets/src/level.rs:82
↓ 223 callers
Method
locator
The [`Locator`] for the current file, which enables extraction of source code from byte offsets.
crates/ruff_linter/src/checkers/ast/mod.rs:518
↓ 221 callers
Method
annotation
Highlight and describe a span of text within the [`source`][Self::source]
crates/ruff_annotate_snippets/src/snippet.rs:319
↓ 221 callers
Method
collect
Append deprecated implementations, preserving earlier entries if a non-deprecated intersection alternative suppresses this accessor's deprecations.
crates/ty_python_semantic/src/types.rs:5073
↓ 218 callers
Method
into_diagnostic
Create a new lint diagnostic guard. This initializes a new diagnostic using the given message along with the ID and severity derived from the `LintMe
crates/ty_python_semantic/src/types/context.rs:744
↓ 214 callers
Function
flakes
(contents: &str, expected: &[Rule])
crates/ruff_linter/src/rules/pyflakes/mod.rs:986
↓ 213 callers
Method
build
Build the test server
crates/ty_server/tests/e2e/main.rs:1651
↓ 211 callers
Method
elements
Returns an iterator over all the [`InterpolatedStringElement`] contained in this value. An f-string element is what makes up an [`FString`] i.e., it
crates/ruff_python_ast/src/nodes.rs:642
↓ 210 callers
Method
wait_until_workspaces_are_initialized
(mut self)
crates/ty_server/tests/e2e/main.rs:326
↓ 205 callers
Function
plain
(a: T, b: T)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/generics_wrapping.py:1
↓ 205 callers
Method
program
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/context.rs:76
↓ 203 callers
Method
push_str
(&mut self, literal: &str)
crates/ty_python_semantic/src/types/infer/builder.rs:13293
↓ 199 callers
Function
range
(x: ops::Range<u32>)
crates/ruff_text_size/tests/main.rs:10
↓ 197 callers
Method
as_path
(&self)
crates/ruff_db/src/system/path.rs:597
↓ 197 callers
Method
push
(&mut self, definition: Definition<'db>)
crates/ty_python_core/src/definition.rs:286
↓ 195 callers
Method
map
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/infer/type_context.rs:96
↓ 195 callers
Method
slice
(&self, ranged: T)
crates/ruff_linter/src/locator.rs:101
↓ 191 callers
Method
chars
Returns an iterator over the [`char`]s of each string literal part.
crates/ruff_python_ast/src/nodes.rs:1636
↓ 189 callers
Method
push
(self, item: T)
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI059.py:12
↓ 188 callers
Method
and_then
Combine two [`Terminal`] operators, with one appearing after the other.
crates/ruff_python_semantic/src/analyze/terminal.rs:182
↓ 188 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_type_checking/imports.rs:23
↓ 188 callers
Method
settings
The [`LinterSettings`] for the current analysis, including the enabled rules.
crates/ruff_linter/src/checkers/ast/mod.rs:548
↓ 188 callers
Function
with_files
Creates a file system with the given files. The content of all files will be empty.
crates/ruff_db/src/system/memory_fs.rs:753
↓ 186 callers
Method
join
(mut self)
crates/ty_server/src/server/schedule/thread.rs:88
↓ 182 callers
Method
path
The location of the [`source`][Self::source] (e.g. a path) <div class="warning"> Text passed to this function is considered "untrusted input", as su
crates/ruff_annotate_snippets/src/snippet.rs:295
↓ 177 callers
Method
with_workspace
Add a workspace to the test server with the given root path and options. An existing file can also be used to model clients that send file-valued work
crates/ty_server/tests/e2e/main.rs:1393
↓ 174 callers
Method
insert
( &mut self, base: DisjointBase<'db>, node_index: usize, class: ClassLiteral<'
crates/ty_python_semantic/src/types/diagnostic.rs:3659
↓ 172 callers
Function
len
(db: &dyn salsa::Database, input: Input)
crates/ruff_db/src/testing.rs:241
↓ 171 callers
Method
build
Use this builder to construct a `Completion`. `env` is any information about the position of the cursor in the source code that could impact the rele
crates/ty_ide/src/completion.rs:492
↓ 169 callers
Method
range
Return the range of the overlong portion of the line.
crates/ruff_linter/src/rules/pycodestyle/overlong.rs:93
↓ 167 callers
Method
iter
Returns an iterator over the banned aliases.
crates/ruff_linter/src/rules/flake8_import_conventions/settings.rs:57
↓ 166 callers
Function
dedent
(content: &Content)
crates/ruff_formatter/src/builders.rs:786
↓ 163 callers
Method
annotate
Add an annotation to this diagnostic. Annotations for a diagnostic are optional, but if any are added, callers should strive to make at least one of
crates/ruff_db/src/diagnostic/mod.rs:146
↓ 162 callers
Method
iter
(&self)
crates/ty_ide/src/goto.rs:475
↓ 159 callers
Method
map_err
( &self, result: Result<T, Self::Error<E1>>, _map_err: impl FnOnce(E1) -> E2, )
crates/ty_module_resolver/src/strategy.rs:135
↓ 159 callers
Function
system_path_to_file
(db: &dyn Db, path: impl AsRef<SystemPath>)
crates/ruff_db/src/files.rs:37
↓ 157 callers
Method
with_file
Write a file to the test directory
crates/ty_server/tests/e2e/main.rs:1623
↓ 156 callers
Method
iter
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:13072
↓ 156 callers
Method
label
Describe the reason the span is highlighted This will be styled according to the [`AnnotationKind`] <div class="warning"> Text passed to this funct
crates/ruff_annotate_snippets/src/snippet.rs:378
↓ 155 callers
Method
contains
(&self, expected: &str)
crates/ty_ide/src/completion.rs:11771
↓ 155 callers
Method
len
(&self)
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:377
↓ 154 callers
Function
hover_test
(source: &str)
crates/ty_ide/src/hover.rs:518
↓ 152 callers
Method
all
Creates a new rule selection from all known lints in the registry, including lints that are default by default. Lints that are disabled by default use
crates/ty_python_semantic/src/lint.rs:619
↓ 149 callers
Function
default
(path: &Path, filename: &Path)
crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs:26
↓ 142 callers
Method
open_text_document
Send a `textDocument/didOpen` notification
crates/ty_server/tests/e2e/main.rs:875
↓ 142 callers
Function
semantic_index
(db: &'db dyn Db, file: ProgramFile<'db>)
crates/ty_python_core/src/lib.rs:77
↓ 141 callers
Method
into_iter
(self)
crates/ty_python_semantic/src/types/callable.rs:1202
↓ 140 callers
Method
last
(&self)
crates/ruff_index/src/slice.rs:49
↓ 139 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/context.rs:245
↓ 138 callers
Method
iter
Iterates over each comparison as `(left, operator, right)`. For `a < b <= c`, yields `(a, <, b)` followed by `(b, <=, c)`.
crates/ruff_python_ast/src/nodes.rs:158
↓ 137 callers
Method
all
Returns all code actions kinds that the server currently supports.
crates/ruff_server/src/server.rs:310
↓ 136 callers
Method
or_else
(self, other: impl Fn() -> Self)
crates/ty_python_core/src/lib.rs:1094
↓ 135 callers
Method
as_str
Returns a human-readable name for this variance, matching the keyword argument names used in `TypeVar(covariant=True)` / `TypeVar(contravariant=True)`
crates/ty_python_semantic/src/types/variance.rs:200
next →
1–100 of 31,562, ranked by callers