Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
28,602 in github.com/astral-sh/ruff
⨍
Functions
28,602
◇
Types & classes
6,683
↳
Endpoints
82
↓ 67 callers
Method
current_scope
Returns the current top-most [`Scope`].
crates/ruff_python_semantic/src/model.rs:1539
↓ 67 callers
Method
has_builtin_binding
Return `true` if `member` is bound as a builtin *in the scope we are currently visiting*. Note that a "builtin binding" does *not* include explicit l
crates/ruff_python_semantic/src/model.rs:357
↓ 67 callers
Method
insert
( &mut self, expression: ExpressionNodeKey, tcx: TypeContext<'db>, value: Expr
crates/ty_python_semantic/src/types/infer/builder.rs:11691
↓ 67 callers
Method
python_file
(&self)
crates/ty_python_semantic/src/types/context.rs:188
↓ 66 callers
Method
as_call_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2236
↓ 66 callers
Function
set
(*args, **kwargs)
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C401.py:49
↓ 65 callers
Method
range
(&self)
crates/ty_python_semantic/src/suppression/parser.rs:214
↓ 65 callers
Method
to_usize
Returns current raw `offset` as usize. # Examples ```rust # use ruff_text_size::*; assert_eq!(TextSize::from(4).to_usize(), 4); ```
crates/ruff_text_size/src/size.rs:90
↓ 64 callers
Method
and
( mut self, db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, other: im
crates/ty_python_semantic/src/types/constraints.rs:603
↓ 64 callers
Method
borrow_mut
(&mut self)
crates/ruff_index/src/vec.rs:117
↓ 64 callers
Method
count
(&self)
crates/ruff_formatter/src/format_element/tag.rs:354
↓ 64 callers
Method
extend
(&mut self, other: &TypeCheckDiagnostics)
crates/ty_python_semantic/src/types/context.rs:233
↓ 64 callers
Method
is_empty
(&self)
crates/ruff_python_formatter/src/statement/stmt_assign.rs:1191
↓ 64 callers
Method
is_empty
(&self)
crates/ty_ide/src/docstring/markdown/structured.rs:178
↓ 64 callers
Method
match_typing_expr
Return `true` if the `Expr` is a reference to `typing.${target}`.
crates/ruff_python_semantic/src/model.rs:241
↓ 64 callers
Function
parenthesized_range
Returns the [`TextRange`] of a given expression including parentheses, if the expression is parenthesized; or `None`, if the expression is not parenth
crates/ruff_python_ast/src/parenthesize.rs:64
↓ 64 callers
Method
push
(&mut self, data: T)
crates/ruff_index/src/vec.rs:62
↓ 64 callers
Method
stylist
The [`Stylist`] for the current file, which detects the current line ending, quote, and indentation style.
crates/ruff_linter/src/checkers/ast/mod.rs:509
↓ 63 callers
Method
append
For given `line` inserts `string` with `style` after old content of that line, adding lines if needed
crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs:109
↓ 63 callers
Method
as_slice
(&self)
crates/ty_python_semantic/src/types/callable.rs:733
↓ 63 callers
Method
first
(&self)
crates/ruff_index/src/slice.rs:44
↓ 63 callers
Method
identity
Get the identity of this bound typevar occurrence. This includes the source-level typevar, binding context, `ParamSpec` attribute, and freshness nonc
crates/ty_python_semantic/src/types/typevar.rs:1009
↓ 63 callers
Method
insert
Inserts `rule` into the set. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; let mut set = RuleSet::empty(); assert!(!set.contains
crates/ruff_linter/src/registry/rule_set.rs:203
↓ 63 callers
Method
node_start
Returns the start position for a node that starts at the current token.
crates/ruff_python_parser/src/parser/mod.rs:317
↓ 63 callers
Method
not_contains
(&self, unexpected: &str)
crates/ty_ide/src/completion.rs:11337
↓ 63 callers
Method
patch
Suggest to the user an edit to the [`source`][Self::source]
crates/ruff_annotate_snippets/src/snippet.rs:333
↓ 63 callers
Function
place_table
(db: &'db dyn Db, scope: ScopeId<'db>)
crates/ty_python_core/src/lib.rs:88
↓ 63 callers
Method
program_file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class.rs:787
↓ 63 callers
Method
push
(&mut self, value: T)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:24
↓ 62 callers
Method
as_bytes
Returns the remaining input as byte slice.
crates/ruff_python_trivia/src/cursor.rs:35
↓ 61 callers
Method
importer
The [`Importer`] for the current file, which enables importing of other modules.
crates/ruff_linter/src/checkers/ast/mod.rs:519
↓ 61 callers
Method
name
(self, python_version: PythonVersion)
crates/ty_python_semantic/src/types/class/known.rs:893
↓ 61 callers
Method
parameters
Return the parameters in this signature.
crates/ty_python_semantic/src/types/signatures.rs:1067
↓ 60 callers
Method
clone
(this: &Self)
crates/ruff_server/src/session/request_queue.rs:154
↓ 60 callers
Method
into_iter
(self)
crates/ty_ide/src/lib.rs:116
↓ 60 callers
Method
next
(&mut self)
crates/ruff_linter/src/rules/pydocstyle/settings.rs:147
↓ 60 callers
Method
push
(&mut self, definition: Definition<'db>)
crates/ty_python_core/src/definition.rs:286
↓ 60 callers
Method
take
Return the full tree, replacing it with an empty tree.
crates/ty_python_semantic/src/types/relation_error.rs:643
↓ 59 callers
Method
iter
Returns an iterator over the matched parameters.
crates/ty_python_semantic/src/types/call/bind.rs:6539
↓ 59 callers
Method
lock
(mut self)
crates/ty/src/printer.rs:138
↓ 59 callers
Function
parse
Parse the given Python source code using the specified [`ParseOptions`]. This function is the most general function to parse Python code. Based on th
crates/ruff_python_parser/src/lib.rs:281
↓ 59 callers
Method
source
(&self)
crates/ruff_python_formatter/src/context.rs:57
↓ 59 callers
Method
with_range
Returns a new `Span` with the given `range` attached to it.
crates/ruff_db/src/diagnostic/mod.rs:1257
↓ 58 callers
Method
get
Returns the [id](BindingId) of the binding bound to the given name.
crates/ruff_python_semantic/src/scope.rs:73
↓ 58 callers
Method
static_class_literal
Returns the statement-defined class literal and specialization for this class. For a non-generic class, this is the class itself. For a generic alias,
crates/ty_python_semantic/src/types/class.rs:1171
↓ 58 callers
Method
take
(&mut self, snapshot: ScratchSnapshot)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:46
↓ 57 callers
Method
current_token_range
(&self)
crates/ruff_python_parser/src/parser/mod.rs:431
↓ 57 callers
Method
filter
Apply arbitrary filtering to completions.
crates/ty_ide/src/completion.rs:11244
↓ 57 callers
Method
is_empty
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:12121
↓ 57 callers
Method
join
(slices: &[T], separator: &str)
crates/ruff_python_ast/src/name.rs:91
↓ 57 callers
Method
last
(mut self)
crates/ruff_python_ast/src/nodes.rs:248
↓ 57 callers
Method
or
Returns the union of this constraint set and another. The other constraint set is provided as a thunk, to implement short-circuiting: the thunk is not
crates/ty_python_semantic/src/types/constraints.rs:623
↓ 57 callers
Method
replace
(&mut self, line: usize, start: usize, end: usize, string: &str)
crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs:118
↓ 57 callers
Method
syntax
Returns the syntax node represented by this parsed output.
crates/ruff_python_parser/src/lib.rs:396
↓ 57 callers
Method
to_owned
(&self)
crates/ty_ide/src/symbols.rs:278
↓ 57 callers
Method
with_target_version
(mut self, target_version: PythonVersion)
crates/ruff_linter/src/settings/mod.rs:862
↓ 56 callers
Method
iter
(&self)
crates/ruff_python_semantic/src/globals.rs:55
↓ 56 callers
Method
report_diagnostic_if_enabled
Return a [`DiagnosticGuard`] for reporting a diagnostic if the corresponding rule is enabled. The guard derefs to a [`Diagnostic`], so it can be used
crates/ruff_linter/src/checkers/ast/mod.rs:449
↓ 56 callers
Method
scope
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:794
↓ 56 callers
Method
signatures
Return the signatures of this bound method type. If the bound method type is overloaded, it may have multiple signatures.
crates/ty_python_semantic/src/types/method.rs:366
↓ 56 callers
Function
string_literal
(expr: &Expr)
crates/ruff_linter/src/rules/flake8_bandit/helpers.rs:11
↓ 56 callers
Method
variables
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/generics.rs:580
↓ 55 callers
Method
context
(&self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:50
↓ 55 callers
Method
join
(self, other: Self)
crates/ty_python_semantic/src/types/variance.rs:15
↓ 55 callers
Function
use_def_map
(db: &'db dyn Db, scope: ScopeId<'db>)
crates/ty_python_core/src/lib.rs:101
↓ 54 callers
Method
bound_or_constraints
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:290
↓ 54 callers
Method
expression_type
Get the already-inferred type of an expression node, or Unknown.
crates/ty_python_semantic/src/types/infer/builder.rs:920
↓ 54 callers
Method
len
Returns the number of module imports.
crates/ruff_graph/src/lib.rs:82
↓ 54 callers
Method
len
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:12116
↓ 54 callers
Method
pop
(&mut self)
crates/ruff_python_ast/src/name.rs:467
↓ 53 callers
Method
into_iter
(self)
crates/ruff_index/src/vec.rs:141
↓ 53 callers
Method
or_else
Chains the placement with the given function. Returns `self` when the placement is non-[`CommentPlacement::Default`]. Otherwise, calls the function w
crates/ruff_python_formatter/src/comments/visitor.rs:507
↓ 53 callers
Method
project
(&self)
crates/ty_project/src/db.rs:609
↓ 53 callers
Method
python_file
(self, db: &'db dyn Db)
crates/ty_python_core/src/scope.rs:30
↓ 52 callers
Method
as_str
Returns the remaining source.
crates/ty_ide/src/docstring/document/syntax.rs:357
↓ 52 callers
Method
first
Peeks the next character from the input stream without consuming it. Returns [`EOF_CHAR`] if the file is at the end of the file.
crates/ruff_python_trivia/src/cursor.rs:46
↓ 52 callers
Method
len
Returns the total number of symbols in this collection.
crates/ty_ide/src/symbols.rs:141
↓ 52 callers
Method
set
Overwrite the error context tree with a new root context and child nodes.
crates/ty_python_semantic/src/types/relation_error.rs:624
↓ 51 callers
Method
entry
(&mut self, item: &dyn FmtDetailed<'db>)
crates/ty_python_semantic/src/types/display.rs:415
↓ 51 callers
Method
get
(&self)
crates/ruff_linter/src/checkers/ast/mod.rs:3599
↓ 51 callers
Method
kind
(self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:685
↓ 51 callers
Method
literal
(self)
crates/ruff_python_ast/src/generated.rs:2983
↓ 51 callers
Function
parse_module
Parse a full Python module usually consisting of multiple lines. This is a convenience function that can be used to parse a full Python program witho
crates/ruff_python_parser/src/lib.rs:112
↓ 51 callers
Method
peek
Returns the next [`Token`] in the iterator without consuming it.
crates/ruff_python_ast/src/token/tokens.rs:379
↓ 51 callers
Method
remove
(&mut self, file: File)
crates/ty_project/src/files.rs:230
↓ 51 callers
Method
statement
(&self, node_id: NodeId)
crates/ruff_python_semantic/src/model.rs:1622
↓ 51 callers
Method
to_specialized_instance
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, specialization: T,
crates/ty_python_semantic/src/types/class/known.rs:1158
↓ 51 callers
Method
write_file
( &mut self, path: impl AsRef<SystemPath>, content: &str, )
crates/ty_ide/src/lib.rs:447
↓ 50 callers
Method
node
Return the original [`ast::StmtClassDef`] node associated with this class ## Note Only call this function from queries in the same file or your query
crates/ty_python_semantic/src/types/class/static_literal.rs:535
↓ 50 callers
Function
setup
(setup_files: F)
crates/ty/tests/file_watching.rs:394
↓ 49 callers
Method
max
(self, other: Self)
crates/ty_python_semantic/src/place.rs:45
↓ 49 callers
Method
message
A text [`Element`][crate::Element] in a [`Group`][crate::Group] <div class="warning"> Text passed to this function is allowed to be styled, as such
crates/ruff_annotate_snippets/src/level.rs:124
↓ 49 callers
Method
parent
(&self)
crates/ruff_db/src/system/path.rs:168
↓ 49 callers
Function
walk_expr
(visitor: &mut V, expr: &'a Expr)
crates/ruff_python_ast/src/visitor.rs:362
↓ 48 callers
Function
any
(exp)
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM111.py:121
↓ 48 callers
Method
build
(self)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1169
↓ 48 callers
Method
contains
(&self, key: &K)
crates/ty_python_core/src/frozen.rs:259
↓ 48 callers
Method
get
Get the symbol info for the symbol identified by the given ID. Returns `None` when the given ID does not reference a symbol in this collection.
crates/ty_ide/src/symbols.rs:131
↓ 48 callers
Method
is_empty
Returns `true` if the module imports are empty.
crates/ruff_graph/src/lib.rs:77
↓ 48 callers
Method
is_never
(&self)
crates/ty_python_semantic/src/types/constraints.rs:1964
← previous
next →
201–300 of 28,602, ranked by callers