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
↓ 1,504 callers
Method
to_string
(&self)
crates/ruff_python_literal/src/escape.rs:90
↓ 1,260 callers
Function
default
(other: str = Depends(something_else))
crates/ruff_linter/resources/test/fixtures/fastapi/FAST003.py:161
↓ 744 callers
Method
report_diagnostic
Report a diagnostic if the associated rule is enabled.
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:722
↓ 715 callers
Method
map
( self, db: &'db dyn Db, transform_fn: impl FnMut(&Type<'db>) -> Type<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:1929
↓ 669 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
↓ 650 callers
Function
print
(s: str)
crates/ruff_linter/resources/test/fixtures/ruff/RUF030.py:98
↓ 625 callers
Method
semantic
The [`SemanticModel`], built up over the course of the AST traversal.
crates/ruff_linter/src/checkers/ast/mod.rs:524
↓ 548 callers
Method
start
(self)
crates/ruff_text_size/src/range.rs:121
↓ 541 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:655
↓ 481 callers
Method
and_then
Combine two [`Terminal`] operators, with one appearing after the other.
crates/ruff_python_semantic/src/analyze/terminal.rs:182
↓ 454 callers
Method
end
(self)
crates/ruff_text_size/src/range.rs:127
↓ 446 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
↓ 431 callers
Method
join
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:343
↓ 401 callers
Method
as_ref
(&self)
crates/ruff_db/src/vendored.rs:349
↓ 374 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/lib.rs:601
↓ 356 callers
Method
clone
(&self)
crates/ty_project/src/parallel.rs:73
↓ 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:11131
↓ 325 callers
Method
set_fix
(&mut self, fix: Fix)
crates/ruff_linter/src/checkers/ast/mod.rs:3718
↓ 325 callers
Function
test_path
( path: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:127
↓ 315 callers
Method
is_none
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:1732
↓ 306 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
↓ 303 callers
Method
filter
(self, db: &'db dyn Db, f: impl FnMut(&Type<'db>) -> bool)
crates/ty_python_semantic/src/types/set_theoretic.rs:307
↓ 295 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:795
↓ 286 callers
Method
is_empty
(&self)
crates/ruff_linter/src/rules/ruff/rules/unnecessary_regular_expression.rs:372
↓ 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
↓ 270 callers
Method
clone
(&self)
crates/ruff_db/src/system/test.rs:32
↓ 262 callers
Method
any
()
crates/ty_python_semantic/src/types.rs:1524
↓ 260 callers
Method
as_ref
(&self)
crates/ty_python_core/src/member.rs:201
↓ 255 callers
Method
iter
(&'a self)
crates/ruff_linter/src/rules/isort/block.rs:115
↓ 253 callers
Method
collect
(mut self, module: &Mod)
crates/ruff_graph/src/collector.rs:36
↓ 251 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:1784
↓ 246 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
↓ 233 callers
Method
decor_style
Set the character set used for rendering decor
crates/ruff_annotate_snippets/src/renderer/mod.rs:176
↓ 231 callers
Method
ok
(self)
crates/ruff_linter/resources/test/fixtures/pylint/self_or_cls_assignment.py:28
↓ 229 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:877
↓ 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: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
↓ 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:994
↓ 210 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:787
↓ 204 callers
Function
plain
(a: T, b: T)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/generics_wrapping.py:1
↓ 201 callers
Method
map
(self, f: &F)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:296
↓ 200 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:1225
↓ 199 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:671
↓ 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
↓ 195 callers
Method
slice
(&self, ranged: T)
crates/ruff_linter/src/locator.rs:101
↓ 190 callers
Method
contains
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarIdentity<'db>, )
crates/ty_python_semantic/src/types/generics.rs:585
↓ 189 callers
Method
push
(self, item: T)
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI059.py:12
↓ 187 callers
Method
chars
Returns an iterator over the [`char`]s of each string literal part.
crates/ruff_python_ast/src/nodes.rs:1462
↓ 186 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_type_checking/imports.rs:23
↓ 182 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, visitor: &StringLiteralCandidatesVisitor
crates/ty_python_semantic/src/semantic_model.rs:612
↓ 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
↓ 181 callers
Method
settings
The [`LinterSettings`] for the current analysis, including the enabled rules.
crates/ruff_linter/src/checkers/ast/mod.rs:529
↓ 180 callers
Method
push_str
(&mut self, literal: &str)
crates/ty_python_semantic/src/types/infer/builder.rs:11921
↓ 177 callers
Method
collect
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>,
crates/ty_python_semantic/src/types/equality/enums.rs:705
↓ 176 callers
Function
parsed_module
(db: &dyn Db, file: PythonFile<'_>)
crates/ruff_db/src/parsed.rs:35
↓ 172 callers
Method
text_len
(&self)
crates/ruff_linter/src/locator.rs:115
↓ 168 callers
Method
push
(&mut self, element: Type<'db>)
crates/ty_python_semantic/src/types/tuple.rs:2892
↓ 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
↓ 158 callers
Function
len
(db: &dyn salsa::Database, input: Input)
crates/ruff_db/src/testing.rs:241
↓ 157 callers
Method
iter
(&self)
crates/ty_ide/src/goto.rs:455
↓ 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
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
↓ 150 callers
Method
contains
(&self, expected: &str)
crates/ty_ide/src/completion.rs:11370
↓ 149 callers
Method
insert
( &mut self, base: DisjointBase<'db>, node_index: usize, class: ClassLiteral<'
crates/ty_python_semantic/src/types/diagnostic.rs:2632
↓ 147 callers
Function
default
(path: &Path, filename: &Path)
crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs:26
↓ 140 callers
Function
hover_test
(source: &str)
crates/ty_ide/src/hover.rs:414
↓ 140 callers
Method
iter
(&self)
crates/ruff_python_ast/src/nodes.rs:202
↓ 137 callers
Function
dedent
(content: &Content)
crates/ruff_formatter/src/builders.rs:782
↓ 136 callers
Method
build
Build the test server
crates/ty_server/tests/e2e/main.rs:1464
↓ 135 callers
Method
all
Returns all code actions kinds that the server currently supports.
crates/ruff_server/src/server.rs:309
↓ 135 callers
Method
push
(&mut self, component: &str)
crates/ty_module_resolver/src/path.rs:61
↓ 135 callers
Function
setup_db
()
crates/ty_python_semantic/src/db.rs:281
↓ 135 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
↓ 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
↓ 134 callers
Method
wait_until_workspaces_are_initialized
(mut self)
crates/ty_server/tests/e2e/main.rs:317
↓ 131 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
↓ 131 callers
Method
program
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:1625
↓ 126 callers
Method
last
(&self)
crates/ruff_index/src/slice.rs:49
↓ 125 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
↓ 121 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/context.rs:229
↓ 120 callers
Method
comment_ranges
Returns the [`CommentRanges`] for the parsed source code.
crates/ruff_linter/src/checkers/ast/mod.rs:428
↓ 120 callers
Method
len
Returns the length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:874
↓ 119 callers
Method
binding
(&self, id: BindingId)
crates/ruff_python_semantic/src/model.rs:230
↓ 119 callers
Method
join
(mut self)
crates/ty_server/src/server/schedule/thread.rs:88
↓ 115 callers
Function
isinstance
(a, b)
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM101.py:46
↓ 115 callers
Method
with_workspace
Add a workspace to the test server with the given root path and options. This option will be used to respond to the `workspace/configuration` request
crates/ty_server/tests/e2e/main.rs:1237
↓ 114 callers
Method
as_slice
(&self)
crates/ruff_index/src/vec.rs:52
↓ 112 callers
Method
or_else
(self, other: impl Fn() -> Self)
crates/ty_python_core/src/lib.rs:988
↓ 111 callers
Method
split
(self, sep=None, maxsplit=-1)
crates/ruff_linter/resources/test/fixtures/pylint/missing_maxsplit_arg.py:6
↓ 110 callers
Method
intersects
Returns true if `self` and `other` contain at least one common rule. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; let set_1 = Ru
crates/ruff_linter/src/registry/rule_set.rs:137
↓ 110 callers
Method
iter
Returns an iterator over the [`Code`]s in the `noqa` directive.
crates/ruff_linter/src/noqa.rs:128
↓ 110 callers
Method
tokens
Returns all tokens of the line, including comments and trailing new lines.
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:205
next →
1–100 of 28,707, ranked by callers