Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,349 in github.com/astral-sh/ruff
⨍
Functions
27,349
◇
Types & classes
6,530
↳
Endpoints
82
↓ 1,493 callers
Method
to_string
(&self)
crates/ruff_python_literal/src/escape.rs:90
↓ 1,198 callers
Function
default
(other: str = Depends(something_else))
crates/ruff_linter/resources/test/fixtures/fastapi/FAST003.py:161
↓ 741 callers
Method
report_diagnostic
Report a diagnostic if the associated rule is enabled.
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:722
↓ 654 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
↓ 639 callers
Method
map
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/infer.rs:607
↓ 637 callers
Function
print
(s: str)
crates/ruff_linter/resources/test/fixtures/ruff/RUF030.py:98
↓ 624 callers
Method
semantic
The [`SemanticModel`], built up over the course of the AST traversal.
crates/ruff_linter/src/checkers/ast/mod.rs:524
↓ 543 callers
Method
start
(self)
crates/ruff_text_size/src/range.rs:121
↓ 525 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:581
↓ 480 callers
Method
join
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:343
↓ 441 callers
Method
end
(self)
crates/ruff_text_size/src/range.rs:127
↓ 439 callers
Method
and_then
Combine two [`Terminal`] operators, with one appearing after the other.
crates/ruff_python_semantic/src/analyze/terminal.rs:182
↓ 387 callers
Method
as_ref
(&self)
crates/ruff_db/src/vendored.rs:349
↓ 381 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:422
↓ 351 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/lib.rs:586
↓ 328 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:10693
↓ 325 callers
Function
test_path
( path: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:127
↓ 320 callers
Method
set_fix
(&mut self, fix: Fix)
crates/ruff_linter/src/checkers/ast/mod.rs:3705
↓ 308 callers
Method
clone
(&self)
crates/ty_project/src/parallel.rs:73
↓ 296 callers
Method
any
(&self, rules: &[Rule])
crates/ruff_linter/src/registry/rule_set.rs:260
↓ 289 callers
Method
build
(&self)
crates/ty_ide/src/lib.rs:514
↓ 285 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
↓ 272 callers
Method
filter
(self, db: &'db dyn Db, f: impl FnMut(&Type<'db>) -> bool)
crates/ty_python_semantic/src/types/set_theoretic.rs:253
↓ 271 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:640
↓ 256 callers
Method
clone
(&self)
crates/ruff_db/src/system/test.rs:32
↓ 253 callers
Method
iter
(&'a self)
crates/ruff_linter/src/rules/isort/block.rs:115
↓ 251 callers
Method
collect
(mut self, module: &Mod)
crates/ruff_graph/src/collector.rs:36
↓ 245 callers
Function
default
(path: &Path)
crates/ruff_linter/src/rules/isort/mod.rs:380
↓ 234 callers
Method
as_ref
(&self)
crates/ty_python_core/src/member.rs:205
↓ 227 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/generics.rs:307
↓ 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:499
↓ 221 callers
Method
ok
(self)
crates/ruff_linter/resources/test/fixtures/pylint/self_or_cls_assignment.py:28
↓ 221 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:818
↓ 214 callers
Function
flakes
(contents: &str, expected: &[Rule])
crates/ruff_linter/src/rules/pyflakes/mod.rs:1012
↓ 209 callers
Method
any
()
crates/ty_python_semantic/src/types.rs:1044
↓ 200 callers
Method
as_path
(&self)
crates/ruff_db/src/system/path.rs:583
↓ 196 callers
Function
range
(x: ops::Range<u32>)
crates/ruff_text_size/tests/main.rs:10
↓ 193 callers
Method
slice
(&self, ranged: T)
crates/ruff_linter/src/locator.rs:123
↓ 191 callers
Method
map
(self, f: &F)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:164
↓ 191 callers
Method
push
(self, item: T)
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI059.py:12
↓ 186 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:846
↓ 185 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:504
↓ 184 callers
Method
report_lint
Optionally return a builder for a lint diagnostic guard. If the current context believes a diagnostic should be reported for the given lint, then a b
crates/ty_python_semantic/src/types/context.rs:150
↓ 182 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
chars
Returns an iterator over the [`char`]s of each string literal part.
crates/ruff_python_ast/src/nodes.rs:1440
↓ 174 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_type_checking/imports.rs:23
↓ 170 callers
Method
contains
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarIdentity<'db>, )
crates/ty_python_semantic/src/types/generics.rs:518
↓ 169 callers
Function
parsed_module
(db: &dyn Db, file: File)
crates/ruff_db/src/parsed.rs:35
↓ 168 callers
Method
text_len
(&self)
crates/ruff_linter/src/locator.rs:137
↓ 166 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, visitor: &StringLiteralCandidatesVisitor
crates/ty_python_semantic/src/semantic_model.rs:539
↓ 166 callers
Method
iter
Returns an iterator over the banned aliases.
crates/ruff_linter/src/rules/flake8_import_conventions/settings.rs:56
↓ 162 callers
Method
range
Return the range of the overlong portion of the line.
crates/ruff_linter/src/rules/pycodestyle/overlong.rs:98
↓ 158 callers
Method
collect
( db: &'db dyn Db, ty: Type<'db>, domains: &mut Vec<EnumValueSet<'db>>,
crates/ty_python_semantic/src/types/equality/enums.rs:463
↓ 154 callers
Method
build
Use this builder to construct a `Completion`. `ctx` is any information about the position of the cursor in the source code that could impact the rele
crates/ty_ide/src/completion.rs:443
↓ 154 callers
Function
len
(db: &dyn salsa::Database, input: Input)
crates/ruff_db/src/testing.rs:234
↓ 153 callers
Method
len
(&self)
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:377
↓ 151 callers
Method
push
(&mut self, element: Type<'db>)
crates/ty_python_semantic/src/types/tuple.rs:2452
↓ 150 callers
Method
is_none
(&self)
crates/ruff_annotate_snippets/src/renderer/display_list.rs:1022
↓ 148 callers
Method
contains
(&self, expected: &str)
crates/ty_ide/src/completion.rs:10930
↓ 147 callers
Function
default
(path: &Path, filename: &Path)
crates/ruff_linter/src/rules/flake8_no_pep420/mod.rs:26
↓ 144 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
↓ 140 callers
Method
iter
(&self)
crates/ruff_python_ast/src/nodes.rs:202
↓ 139 callers
Method
insert
(&mut self, value: T)
crates/ty_python_semantic/src/types/visitor.rs:332
↓ 137 callers
Function
hover_test
(source: &str)
crates/ty_ide/src/hover.rs:410
↓ 136 callers
Method
all
Returns all code actions kinds that the server currently supports.
crates/ruff_server/src/server.rs:274
↓ 132 callers
Method
build
Build the test server
crates/ty_server/tests/e2e/main.rs:1445
↓ 132 callers
Method
is_none
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:1218
↓ 130 callers
Function
dedent
(content: &Content)
crates/ruff_formatter/src/builders.rs:780
↓ 130 callers
Method
wait_until_workspaces_are_initialized
(mut self)
crates/ty_server/tests/e2e/main.rs:319
↓ 130 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:732
↓ 126 callers
Method
iter
(&self)
crates/ty_ide/src/goto.rs:414
↓ 125 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
↓ 125 callers
Method
last
(&self)
crates/ruff_index/src/slice.rs:49
↓ 124 callers
Method
push
(&mut self, component: &str)
crates/ty_module_resolver/src/path.rs:61
↓ 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
map_err
( &self, result: Result<T, Self::Error<E1>>, _map_err: impl FnOnce(E1) -> E2, )
crates/ty_module_resolver/src/strategy.rs:135
↓ 118 callers
Method
push_str
(&mut self, s: &str)
crates/ruff_python_ast/src/name.rs:47
↓ 114 callers
Function
isinstance
(a, b)
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM101.py:46
↓ 114 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:1250
↓ 113 callers
Method
as_slice
(&self)
crates/ruff_index/src/vec.rs:52
↓ 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:141
↓ 109 callers
Function
inlay_hint_test
(source: &str)
crates/ty_ide/src/inlay_hints.rs:808
↓ 109 callers
Method
join
(mut self)
crates/ty_server/src/server/schedule/thread.rs:88
↓ 109 callers
Method
segments
(&self)
crates/ruff_python_ast/src/name.rs:292
↓ 109 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:208
↓ 105 callers
Method
clone
(&self)
crates/ruff_python_ast/src/node_index.rs:233
↓ 105 callers
Method
len
Returns the length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:664
↓ 104 callers
Method
try_set_fix
(&mut self, func: impl FnOnce() -> anyhow::Result<Fix>)
crates/ruff_linter/src/checkers/ast/mod.rs:3720
↓ 104 callers
Method
with_file
Write a file to the test directory
crates/ty_server/tests/e2e/main.rs:1416
↓ 103 callers
Method
context
(&self)
crates/ruff_python_semantic/src/model.rs:3019
↓ 103 callers
Function
empty
()
crates/ruff_python_formatter/resources/test/fixtures/black/cases/docstring.py:118
↓ 103 callers
Method
split
(self, sep=None, maxsplit=-1)
crates/ruff_linter/resources/test/fixtures/pylint/missing_maxsplit_arg.py:6
↓ 102 callers
Method
iter
Returns an iterator over the [`Code`]s in the `noqa` directive.
crates/ruff_linter/src/noqa.rs:115
↓ 101 callers
Method
db
(&self)
crates/ty_python_semantic/src/types/context.rs:100
↓ 101 callers
Method
replace
(&mut self, other: Self, set_to: bool)
crates/ty_python_semantic/src/types/infer.rs:1881
↓ 99 callers
Method
write_str
(&mut self, s: &str)
crates/ruff_python_ast/src/name.rs:59
↓ 98 callers
Method
as_ref
(&self)
crates/ruff_python_ast/src/name.rs:67
↓ 98 callers
Method
comments
(&self)
crates/ruff_python_formatter/src/context.rs:77
next →
1–100 of 27,349, ranked by callers