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
↓ 1,545 callers
Method
to_string
(&self)
crates/ruff_python_literal/src/escape.rs:142
↓ 1,481 callers
Function
default
(other: str = Depends(something_else))
crates/ruff_linter/resources/test/fixtures/fastapi/FAST003.py:161
↓ 863 callers
Method
map
( self, db: &'db dyn Db, transform_fn: impl FnMut(&Type<'db>) -> Type<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:2359
↓ 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
↓ 709 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
↓ 661 callers
Function
print
(s: str)
crates/ruff_linter/resources/test/fixtures/ruff/RUF030.py:98
↓ 620 callers
Method
semantic
The [`SemanticModel`], built up over the course of the AST traversal.
crates/ruff_linter/src/checkers/ast/mod.rs:548
↓ 600 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
↓ 557 callers
Method
start
(self)
crates/ruff_text_size/src/range.rs:121
↓ 503 callers
Method
clone
(&self)
crates/ty_project/src/parallel.rs:73
↓ 482 callers
Method
unwrap_or
(self, fallback: T)
crates/ty_python_semantic/src/types/recursive.rs:771
↓ 478 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
↓ 457 callers
Method
join
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:357
↓ 429 callers
Method
is_none
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:2719
↓ 420 callers
Method
filter
(self, db: &'db dyn Db, f: impl FnMut(&Type<'db>) -> bool)
crates/ty_python_semantic/src/types/set_theoretic.rs:553
↓ 409 callers
Method
and_then
(self, other: impl FnOnce() -> Self)
crates/ty_python_core/src/lib.rs:1068
↓ 405 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/lib.rs:595
↓ 401 callers
Method
as_ref
(&self)
crates/ruff_db/src/vendored.rs:354
↓ 380 callers
Method
any
()
crates/ty_python_semantic/src/types.rs:2441
↓ 370 callers
Method
unwrap_or_else
(self, fallback: impl FnOnce() -> T)
crates/ty_python_semantic/src/types/recursive.rs:762
↓ 367 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:945
↓ 361 callers
Method
as_ref
(&self)
crates/ty_python_core/src/member.rs:201
↓ 347 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:11610
↓ 329 callers
Method
build
(&self)
crates/ty_ide/src/lib.rs:521
↓ 328 callers
Method
set_fix
(&mut self, fix: Fix)
crates/ruff_linter/src/checkers/ast/mod.rs:3920
↓ 326 callers
Function
test_path
( path: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:126
↓ 325 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:2195
↓ 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
↓ 281 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
↓ 270 callers
Method
contains
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarIdentity<'db>, )
crates/ty_python_semantic/src/types/generics.rs:566
↓ 269 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
↓ 267 callers
Method
iter
(&'a self)
crates/ruff_linter/src/rules/isort/block.rs:115
↓ 265 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:994
↓ 260 callers
Method
collect
(mut self, module: &Mod)
crates/ruff_graph/src/collector.rs:36
↓ 253 callers
Function
default
(path: &Path)
crates/ruff_linter/src/rules/isort/mod.rs:384
↓ 252 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:1254
↓ 252 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:937
↓ 248 callers
Method
push
(&mut self, element: T)
crates/ty_python_semantic/src/types/tuple.rs:2972
↓ 245 callers
Function
setup_db
()
crates/ty_python_semantic/src/db.rs:338
↓ 242 callers
Method
span
Annotate a byte span within [`Snippet`]
crates/ruff_annotate_snippets/src/snippet.rs:434
↓ 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
↓ 231 callers
Function
parsed_module
(db: &dyn Db, file: PythonFile<'_>)
crates/ruff_db/src/parsed.rs:35
↓ 224 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:523
↓ 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
build
Build the test server
crates/ty_server/tests/e2e/main.rs:1658
↓ 222 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:5095
↓ 221 callers
Method
annotation
Highlight and describe a span of text within the [`source`][Self::source]
crates/ruff_annotate_snippets/src/snippet.rs:319
↓ 220 callers
Method
wait_until_workspaces_are_initialized
(mut self)
crates/ty_server/tests/e2e/main.rs:326
↓ 219 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:767
↓ 214 callers
Function
flakes
(contents: &str, expected: &[Rule])
crates/ruff_linter/src/rules/pyflakes/mod.rs:988
↓ 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:655
↓ 211 callers
Method
program
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/context.rs:76
↓ 205 callers
Function
plain
(a: T, b: T)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/generics_wrapping.py:1
↓ 203 callers
Method
push_str
(&mut self, literal: &str)
crates/ty_python_semantic/src/types/infer/builder.rs:13453
↓ 201 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
↓ 199 callers
Function
range
(x: ops::Range<u32>)
crates/ruff_text_size/tests/main.rs:10
↓ 197 callers
Method
push
(&mut self, definition: Definition<'db>)
crates/ty_python_core/src/definition.rs:286
↓ 196 callers
Method
as_path
(&self)
crates/ruff_db/src/system/path.rs:597
↓ 195 callers
Method
slice
(&self, ranged: T)
crates/ruff_linter/src/locator.rs:101
↓ 194 callers
Method
map
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/infer/type_context.rs:124
↓ 191 callers
Method
chars
Returns an iterator over the [`char`]s of each string literal part.
crates/ruff_python_ast/src/nodes.rs:1649
↓ 189 callers
Method
and_then
Combine two [`Terminal`] operators, with one appearing after the other.
crates/ruff_python_semantic/src/analyze/terminal.rs:182
↓ 189 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_type_checking/imports.rs:23
↓ 189 callers
Method
settings
The [`LinterSettings`] for the current analysis, including the enabled rules.
crates/ruff_linter/src/checkers/ast/mod.rs:553
↓ 188 callers
Method
push
(self, item: T)
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI059.py:12
↓ 184 callers
Function
dedent
(content: &Content)
crates/ruff_formatter/src/builders.rs:786
↓ 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
↓ 179 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:1400
↓ 177 callers
Method
join
(&self, other: &ModuleName)
crates/ty_module_resolver/src/module_name.rs:269
↓ 175 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:1212
↓ 174 callers
Method
insert
( &mut self, base: DisjointBase<'db>, node_index: usize, class: ClassLiteral<'
crates/ty_python_semantic/src/types/diagnostic.rs:3711
↓ 173 callers
Function
len
(db: &dyn salsa::Database, input: Input)
crates/ruff_db/src/testing.rs:241
↓ 172 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
Method
with_file
Write a file to the test directory
crates/ty_server/tests/e2e/main.rs:1630
↓ 164 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
↓ 161 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
↓ 160 callers
Function
system_path_to_file
(db: &dyn Db, path: impl AsRef<SystemPath>)
crates/ruff_db/src/files.rs:37
↓ 156 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
↓ 156 callers
Method
iter
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:13221
↓ 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:11849
↓ 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
↓ 149 callers
Function
default
(path: &Path, filename: &Path)
crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs:26
↓ 149 callers
Method
open_text_document
Send a `textDocument/didOpen` notification
crates/ty_server/tests/e2e/main.rs:875
↓ 145 callers
Method
into_iter
(self)
crates/ty_python_semantic/src/types/callable.rs:1183
↓ 140 callers
Method
last
(&self)
crates/ruff_index/src/slice.rs:49
↓ 140 callers
Function
semantic_index
(db: &'db dyn Db, file: ProgramFile<'db>)
crates/ty_python_core/src/lib.rs:77
↓ 139 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/context.rs:247
↓ 139 callers
Method
or_else
(self, other: impl Fn() -> Self)
crates/ty_python_core/src/lib.rs:1094
↓ 138 callers
Method
all
Returns all code actions kinds that the server currently supports.
crates/ruff_server/src/server.rs:310
↓ 138 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
↓ 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:171
next →
1–100 of 31,766, ranked by callers