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
↓ 1,508 callers
Method
to_string
(&self)
crates/ruff_python_literal/src/escape.rs:90
↓ 1,313 callers
Function
default
(other: str = Depends(something_else))
crates/ruff_linter/resources/test/fixtures/fastapi/FAST003.py:161
↓ 745 callers
Method
report_diagnostic
Report a diagnostic if the associated rule is enabled.
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:723
↓ 721 callers
Method
map
( self, db: &'db dyn Db, transform_fn: impl FnMut(&Type<'db>) -> Type<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:2001
↓ 677 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
↓ 649 callers
Function
print
(s: str)
crates/ruff_linter/resources/test/fixtures/ruff/RUF030.py:98
↓ 626 callers
Method
semantic
The [`SemanticModel`], built up over the course of the AST traversal.
crates/ruff_linter/src/checkers/ast/mod.rs:524
↓ 551 callers
Method
start
(self)
crates/ruff_text_size/src/range.rs:121
↓ 543 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:645
↓ 518 callers
Method
and_then
Combine two [`Terminal`] operators, with one appearing after the other.
crates/ruff_python_semantic/src/analyze/terminal.rs:182
↓ 457 callers
Method
end
(self)
crates/ruff_text_size/src/range.rs:127
↓ 451 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:428
↓ 434 callers
Method
join
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:343
↓ 406 callers
Method
as_ref
(&self)
crates/ruff_db/src/vendored.rs:349
↓ 395 callers
Method
clone
(&self)
crates/ty_project/src/parallel.rs:73
↓ 375 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/lib.rs:601
↓ 332 callers
Method
is_none
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:2030
↓ 331 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:11132
↓ 325 callers
Method
set_fix
(&mut self, fix: Fix)
crates/ruff_linter/src/checkers/ast/mod.rs:3733
↓ 325 callers
Function
test_path
( path: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:127
↓ 323 callers
Method
filter
(self, db: &'db dyn Db, f: impl FnMut(&Type<'db>) -> bool)
crates/ty_python_semantic/src/types/set_theoretic.rs:308
↓ 307 callers
Method
build
(&self)
crates/ty_ide/src/lib.rs:524
↓ 305 callers
Method
any
(&self, rules: &[Rule])
crates/ruff_linter/src/registry/rule_set.rs:256
↓ 302 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:805
↓ 291 callers
Method
any
()
crates/ty_python_semantic/src/types.rs:1822
↓ 286 callers
Method
is_empty
(&self)
crates/ruff_linter/src/rules/ruff/rules/unnecessary_regular_expression.rs:373
↓ 282 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:1158
↓ 281 callers
Method
as_ref
(&self)
crates/ty_python_core/src/member.rs:201
↓ 270 callers
Method
clone
(&self)
crates/ruff_db/src/system/test.rs:32
↓ 262 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:1856
↓ 255 callers
Method
iter
(&'a self)
crates/ruff_linter/src/rules/isort/block.rs:115
↓ 254 callers
Method
collect
(mut self, module: &Mod)
crates/ruff_graph/src/collector.rs:36
↓ 247 callers
Function
default
(path: &Path)
crates/ruff_linter/src/rules/isort/mod.rs:380
↓ 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
↓ 238 callers
Method
ok
(self)
crates/ruff_linter/resources/test/fixtures/pylint/self_or_cls_assignment.py:28
↓ 238 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:897
↓ 233 callers
Method
decor_style
Set the character set used for rendering decor
crates/ruff_annotate_snippets/src/renderer/mod.rs:176
↓ 225 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:499
↓ 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
map
(self, f: &F)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:296
↓ 221 callers
Method
annotation
Highlight and describe a span of text within the [`source`][Self::source]
crates/ruff_annotate_snippets/src/snippet.rs:319
↓ 214 callers
Function
flakes
(contents: &str, expected: &[Rule])
crates/ruff_linter/src/rules/pyflakes/mod.rs:982
↓ 213 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:1246
↓ 211 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:797
↓ 204 callers
Function
plain
(a: T, b: T)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/generics_wrapping.py:1
↓ 203 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:674
↓ 202 callers
Method
contains
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarIdentity<'db>, )
crates/ty_python_semantic/src/types/generics.rs:518
↓ 197 callers
Method
as_path
(&self)
crates/ruff_db/src/system/path.rs:583
↓ 197 callers
Function
range
(x: ops::Range<u32>)
crates/ruff_text_size/tests/main.rs:10
↓ 196 callers
Method
slice
(&self, ranged: T)
crates/ruff_linter/src/locator.rs:101
↓ 194 callers
Method
collect
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>,
crates/ty_python_semantic/src/types/equality/enums.rs:705
↓ 190 callers
Method
push
(&mut self, element: Type<'db>)
crates/ty_python_semantic/src/types/tuple.rs:2990
↓ 190 callers
Method
push
(self, item: T)
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI059.py:12
↓ 189 callers
Function
parsed_module
(db: &dyn Db, file: PythonFile<'_>)
crates/ruff_db/src/parsed.rs:35
↓ 187 callers
Method
chars
Returns an iterator over the [`char`]s of each string literal part.
crates/ruff_python_ast/src/nodes.rs:1462
↓ 187 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_type_checking/imports.rs:23
↓ 185 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, visitor: &StringLiteralCandidatesVisitor
crates/ty_python_semantic/src/semantic_model.rs:646
↓ 185 callers
Method
push_str
(&mut self, literal: &str)
crates/ty_python_semantic/src/types/infer/builder.rs:12236
↓ 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
↓ 182 callers
Method
settings
The [`LinterSettings`] for the current analysis, including the enabled rules.
crates/ruff_linter/src/checkers/ast/mod.rs:529
↓ 181 callers
Function
setup_db
()
crates/ty_python_semantic/src/db.rs:318
↓ 172 callers
Method
text_len
(&self)
crates/ruff_linter/src/locator.rs:115
↓ 167 callers
Method
iter
Returns an iterator over the banned aliases.
crates/ruff_linter/src/rules/flake8_import_conventions/settings.rs:56
↓ 166 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:491
↓ 165 callers
Method
range
Return the range of the overlong portion of the line.
crates/ruff_linter/src/rules/pycodestyle/overlong.rs:98
↓ 163 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
↓ 159 callers
Method
iter
(&self)
crates/ty_ide/src/goto.rs:475
↓ 157 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:581
↓ 157 callers
Function
len
(db: &dyn salsa::Database, input: Input)
crates/ruff_db/src/testing.rs:241
↓ 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
↓ 154 callers
Method
len
(&self)
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:377
↓ 151 callers
Method
insert
( &mut self, base: DisjointBase<'db>, node_index: usize, class: ClassLiteral<'
crates/ty_python_semantic/src/types/diagnostic.rs:3282
↓ 150 callers
Method
contains
(&self, expected: &str)
crates/ty_ide/src/completion.rs:11371
↓ 149 callers
Method
build
Build the test server
crates/ty_server/tests/e2e/main.rs:1505
↓ 147 callers
Function
default
(path: &Path, filename: &Path)
crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs:26
↓ 147 callers
Method
wait_until_workspaces_are_initialized
(mut self)
crates/ty_server/tests/e2e/main.rs:319
↓ 142 callers
Function
dedent
(content: &Content)
crates/ruff_formatter/src/builders.rs:782
↓ 140 callers
Function
hover_test
(source: &str)
crates/ty_ide/src/hover.rs:414
↓ 140 callers
Method
program
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/context.rs:75
↓ 139 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
↓ 138 callers
Method
iter
(&self)
crates/ruff_python_ast/src/nodes.rs:202
↓ 137 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:147
↓ 135 callers
Method
all
Returns all code actions kinds that the server currently supports.
crates/ruff_server/src/server.rs:308
↓ 135 callers
Method
push
(&mut self, component: &str)
crates/ty_module_resolver/src/path.rs:63
↓ 134 callers
Method
join
(mut self)
crates/ty_server/src/server/schedule/thread.rs:88
↓ 134 callers
Method
line_start
When manually [`fold`][Self::fold]ing, the [`source`][Self::source]s line offset from the original start
crates/ruff_annotate_snippets/src/snippet.rs:281
↓ 131 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/context.rs:229
↓ 129 callers
Method
last
(&self)
crates/ruff_index/src/slice.rs:49
↓ 127 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:1276
↓ 120 callers
Method
comment_ranges
Returns the [`CommentRanges`] for the parsed source code.
crates/ruff_linter/src/checkers/ast/mod.rs:428
↓ 119 callers
Method
binding
(&self, id: BindingId)
crates/ruff_python_semantic/src/model.rs:230
↓ 119 callers
Method
len
Returns the length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:972
↓ 118 callers
Function
isinstance
(a, b)
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM101.py:46
↓ 117 callers
Method
or_else
(self, other: impl Fn() -> Self)
crates/ty_python_core/src/lib.rs:988
↓ 117 callers
Function
system_path_to_file
(db: &dyn Db, path: impl AsRef<SystemPath>)
crates/ruff_db/src/files.rs:35
↓ 116 callers
Method
with_file
Write a file to the test directory
crates/ty_server/tests/e2e/main.rs:1476
↓ 114 callers
Method
as_slice
(&self)
crates/ruff_index/src/vec.rs:52
↓ 113 callers
Method
split
(self, sep=None, maxsplit=-1)
crates/ruff_linter/resources/test/fixtures/pylint/missing_maxsplit_arg.py:6
↓ 112 callers
Method
iter
Returns an iterator over the [`Code`]s in the `noqa` directive.
crates/ruff_linter/src/noqa.rs:129
next →
1–100 of 29,290, ranked by callers