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
↓ 17 callers
Function
site_packages_directories_from_sys_prefix
Attempt to retrieve the `site-packages` directories associated with a given Python installation. The location of the `site-packages` directories can
crates/ty_site_packages/src/lib.rs:1669
↓ 17 callers
Method
snapshot
(&self)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:38
↓ 17 callers
Method
span
Create a span with the range of the given expression in the file being currently type checked. If you're creating a diagnostic with snippets in files
crates/ty_python_semantic/src/types/context.rs:234
↓ 17 callers
Method
term_width
Set the width to render within Affects the rendering of [`Snippet`][crate::Snippet]s
crates/ruff_annotate_snippets/src/renderer/mod.rs:170
↓ 17 callers
Method
to_instance
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types.rs:1574
↓ 17 callers
Method
trim_whitespace
(&self)
crates/ruff_python_trivia/src/whitespace.rs:113
↓ 17 callers
Method
types
(&self)
crates/ty_python_semantic/src/types/constraints/variables.rs:172
↓ 17 callers
Function
unbound
()
crates/ty_python_core/src/use_def/place_state.rs:834
↓ 17 callers
Method
values
Returns an iterator over the fixes in the map.
crates/ruff/src/diagnostics.rs:146
↓ 17 callers
Method
with_failure_code
(self, code: server::ErrorCode)
crates/ruff_server/src/server/api.rs:388
↓ 17 callers
Method
with_file
Write a file to the test directory
crates/ruff_server/tests/e2e/main.rs:1123
↓ 16 callers
Method
as_code
Access the resulting code, borrowing the result
crates/ruff_formatter/src/lib.rs:414
↓ 16 callers
Method
as_function_def
Return the [`ast::StmtFunctionDef`] of the definition, if it's a function definition.
crates/ruff_python_semantic/src/definition.rs:174
↓ 16 callers
Method
as_source_code
Returns this input as a `SourceCode` for convenient querying.
crates/ruff_db/src/diagnostic/mod.rs:1197
↓ 16 callers
Method
as_subscript_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2606
↓ 16 callers
Method
assert_progressing
(&mut self, p: &Parser)
crates/ruff_python_parser/src/parser/progress.rs:35
↓ 16 callers
Method
before
Returns a slice of tokens before the given [`TextSize`] offset. If the given offset is between two tokens, the returned slice will end just before th
crates/ruff_python_ast/src/token/tokens.rs:144
↓ 16 callers
Method
bottom_materialization
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types.rs:2949
↓ 16 callers
Function
catch_unwind
Invokes a closure, capturing and returning the cause of an unwinding panic if one occurs. ### Thread safety This is implemented by installing a cust
crates/ruff_db/src/panic.rs:145
↓ 16 callers
Function
classify
Classify a function based on its scope, name, and decorators.
crates/ruff_python_semantic/src/analyze/function_type.rs:20
↓ 16 callers
Method
content
Returns the source between the role's backtick delimiters. For `` :class:`Model <pkg.Model>` ``, this returns `Model <pkg.Model>`.
crates/ty_ide/src/docstring/document/syntax.rs:203
↓ 16 callers
Method
contents
(&self)
crates/ruff_server/src/edit/text_document.rs:68
↓ 16 callers
Method
current_expressions
Returns an [`Iterator`] over the current expression hierarchy, from the current [`Expr`] through to any parents.
crates/ruff_python_semantic/src/model.rs:1503
↓ 16 callers
Method
element_type
(self, _db: &'db dyn Db)
crates/ty_python_semantic/src/types/tuple.rs:952
↓ 16 callers
Method
entry
( &mut self, node: &T, content: &dyn Format<PyFormatContext<'ast>>, )
crates/ruff_python_formatter/src/builders.rs:156
↓ 16 callers
Method
env
Sets an environment variable for the command.
crates/ruff_db/src/system/command.rs:55
↓ 16 callers
Method
err
(self)
crates/ty_site_packages/src/lib.rs:2565
↓ 16 callers
Method
exit
Current exit block, which may change during construction
crates/ruff_python_semantic/src/cfg/graph.rs:282
↓ 16 callers
Method
expression
(&self, expression_key: impl Into<ExpressionNodeKey>)
crates/ty_python_core/src/lib.rs:746
↓ 16 callers
Method
finish
(self)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:916
↓ 16 callers
Method
first_non_type_parent_scope
Returns the first parent of the given [`Scope`] that is not of [`ScopeKind::Type`] or [`ScopeKind::DunderClassCell`], if any.
crates/ruff_python_semantic/src/model.rs:1600
↓ 16 callers
Method
get_positional
Return positional parameter at given index, or `None` if `index` is out of range. Does not return variadic parameter.
crates/ty_python_semantic/src/types/signatures.rs:5679
↓ 16 callers
Method
has_known_decorator
(self, db: &dyn Db, decorator: FunctionDecorators)
crates/ty_python_semantic/src/types/function.rs:353
↓ 16 callers
Method
header
(&mut self, original: &'a str, modified: &'a str)
crates/ruff_linter/src/source_kind.rs:306
↓ 16 callers
Method
ignore_conflicting_declarations
(&self)
crates/ty_python_semantic/src/place.rs:1047
↓ 16 callers
Method
in_string_annotation
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:1065
↓ 16 callers
Method
initialization_result
Get the initialization result
crates/ty_server/tests/e2e/main.rs:848
↓ 16 callers
Function
intersection
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, tys: impl IntoIterator<Item = Type<'db>>, )
crates/ty_python_semantic/src/types/property_tests/type_generation.rs:784
↓ 16 callers
Method
into_iter
(self)
crates/ruff_linter/src/registry/rule_set.rs:332
↓ 16 callers
Method
is_definitely_bound
(&self)
crates/ty_python_semantic/src/place.rs:396
↓ 16 callers
Method
is_global
Returns `true` if this is the id of the global scope
crates/ruff_python_semantic/src/scope.rs:252
↓ 16 callers
Method
iter_element_types
( &self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/tuple.rs:2625
↓ 16 callers
Method
iter_suffix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1240
↓ 16 callers
Method
map_type
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/member.rs:51
↓ 16 callers
Method
negate_if
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, yes: bool)
crates/ty_python_semantic/src/types.rs:3516
↓ 16 callers
Method
open
Open or create a new cache. `package_root` is the path to root of the package that is contained within this cache and must be canonicalized (to avoid
crates/ruff/src/cache.rs:94
↓ 16 callers
Method
ordered_source_order
Repeating a source-order tree cannot change the first occurrence of any constraint, so combining identical trees must reuse their existing sidecar.
crates/ty_python_semantic/src/types/constraints.rs:1465
↓ 16 callers
Method
program_file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:612
↓ 16 callers
Method
range
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:586
↓ 16 callers
Method
render_diagnostics
(&self, diagnostics: I)
crates/ty_ide/src/lib.rs:456
↓ 16 callers
Method
scope_id
Returns the tracked scope for an ID assigned by this index.
crates/ty_python_core/src/lib.rs:493
↓ 16 callers
Method
search
Returns a sequence of symbols that matches the given query.
crates/ty_ide/src/symbols.rs:153
↓ 16 callers
Method
search_paths
(&self)
crates/ty_module_resolver/src/db.rs:69
↓ 16 callers
Method
set_env_var
Sets an environment variable override. This takes precedence over the inner system.
crates/ruff_db/src/system/test.rs:54
↓ 16 callers
Function
setup_uv
Writes the fixture files and creates a watched project with the selected uv mode. Installs project dependencies for `UseUv::On` and synchronizes disco
crates/ty/tests/file_watching.rs:4433
↓ 16 callers
Method
signatures
Iterates over every signature of every callable alternative without merging the alternatives into an overloaded callable.
crates/ty_python_semantic/src/types/callable.rs:1148
↓ 16 callers
Method
to_text_size
( &self, db: &dyn Db, file: File, uri: &lsp_types::Uri, encoding: Posi
crates/ty_server/src/document/range.rs:143
↓ 16 callers
Method
to_type_identity
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/cyclic.rs:57
↓ 16 callers
Method
values
(&self)
crates/ruff_python_index/src/interpolated_string_ranges.rs:70
↓ 16 callers
Method
with_extra_file
(&mut self, file_name: &str, content: &str)
crates/ty_ide/src/inlay_hints.rs:1327
↓ 16 callers
Method
write
Write the notebook back to the given [`Write`] implementer.
crates/ruff_notebook/src/notebook.rs:480
↓ 16 callers
Method
write
Write the transformed source file to the given writer. For Jupyter notebooks, this will write out the notebook as JSON.
crates/ruff_linter/src/source_kind.rs:161
↓ 16 callers
Method
write_char
( ch: char, quote: Quote, force_escape: bool, formatter: &mut impl std::fmt::W
crates/ruff_python_literal/src/escape.rs:404
↓ 16 callers
Method
write_file
Stores a new file in the file system. The operation overrides the content for an existing file with the same normalized `path`.
crates/ruff_db/src/system/memory_fs.rs:192
↓ 15 callers
Method
as_i64
(self)
crates/ty_python_semantic/src/types/literal.rs:330
↓ 15 callers
Method
as_literal_value_kind
(self)
crates/ty_python_semantic/src/types.rs:3221
↓ 15 callers
Method
as_str
(&self)
crates/ruff_db/src/diagnostic/render/sarif.rs:186
↓ 15 callers
Function
assert_ok
(result: &Result<Vec<Diagnostic>, FailuresByLine>)
crates/mdtest/src/matcher.rs:627
↓ 15 callers
Method
atomic_constraint_data
(&self, constraint: AtomicConstraintId)
crates/ty_python_semantic/src/types/constraints.rs:1414
↓ 15 callers
Method
bool
Determine whether instances of this class are always truthy, always falsy, or have an ambiguous truthiness. Returns `None` for `KnownClass::Tuple`, s
crates/ty_python_semantic/src/types/class/known.rs:324
↓ 15 callers
Method
build
(self)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1434
↓ 15 callers
Method
checked_add
(self, rhs: TextSize)
crates/ruff_text_size/src/size.rs:100
↓ 15 callers
Method
clear_salsa_events
Clears the salsa events. ## Panics If there are any pending salsa snapshots.
crates/ty_python_semantic/src/db.rs:129
↓ 15 callers
Method
cmp
(&self, rhs: &CompletionRanker<'_>)
crates/ty_ide/src/completion.rs:3407
↓ 15 callers
Method
entry
( &'a mut self, members: &IndexVec<ScopedMemberId, Member>, member: &Member, )
crates/ty_python_core/src/member.rs:512
↓ 15 callers
Method
expect_place
(&self, place_expr: &PlaceExpr)
crates/ty_python_semantic/src/types/narrow.rs:3553
↓ 15 callers
Method
explicit_bases
Returns all of the explicit base class types for this class. Note that when this is a namedtuple this always returns a sequence of length one corresp
crates/ty_python_semantic/src/types/class.rs:1142
↓ 15 callers
Method
extend
(&mut self, diagnostics: impl IntoIterator<Item = Diagnostic>)
crates/ty_project/src/script.rs:415
↓ 15 callers
Function
f
()
crates/ruff_linter/resources/test/fixtures/ruff/noqa.py:1
↓ 15 callers
Function
find_goto_target
( model: &'a SemanticModel, parsed: &'a ParsedModuleRef, offset: TextSize, )
crates/ty_ide/src/goto.rs:1433
↓ 15 callers
Method
fmt
(&self, item: &Stmt, f: &mut PyFormatter)
crates/ruff_python_formatter/src/statement/mod.rs:40
↓ 15 callers
Method
focus_range
Returns the range of the class's name
crates/ty_python_semantic/src/types/class/static_literal.rs:3511
↓ 15 callers
Function
func
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF026.py:6
↓ 15 callers
Method
get
(&self)
crates/ty_project/src/files.rs:45
↓ 15 callers
Method
getFileHandleForModel
(model: editor.ITextModel)
playground/ty/src/Editor/Editor.tsx:535
↓ 15 callers
Method
get_all
Like [`Scope::get`], but returns all bindings with the given name, including those that were shadowed by later bindings.
crates/ruff_python_semantic/src/scope.rs:109
↓ 15 callers
Method
get_or_import_builtin_symbol
For a given builtin symbol, determine whether an [`Edit`] is necessary to make the symbol available in the current scope. For example, if `zip` has be
crates/ruff_linter/src/importer/mod.rs:310
↓ 15 callers
Method
homogeneous_element_type
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/tuple.rs:2587
↓ 15 callers
Function
import_from
PT013
crates/ruff_linter/src/rules/flake8_pytest_style/rules/imports.rs:53
↓ 15 callers
Method
imports
When set, include the import associated with the completion. Not enabled by default.
crates/ty_ide/src/completion.rs:11754
↓ 15 callers
Method
infer_maybe_standalone_expression
( &mut self, expression: &ast::Expr, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:6813
↓ 15 callers
Method
into_protocol_class
Returns the protocol class if this is a protocol.
crates/ty_python_semantic/src/types/class.rs:1054
↓ 15 callers
Method
into_type
(self)
crates/ty_python_semantic/src/types/recursive.rs:707
↓ 15 callers
Method
is_async
(self)
crates/ty_python_core/src/lib.rs:1127
↓ 15 callers
Method
iter
(&self)
crates/mdtest/src/matcher.rs:34
↓ 15 callers
Method
iter_mut
(&mut self)
crates/ruff_index/src/slice.rs:89
↓ 15 callers
Method
kind
Return the display kind of the function-like node.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:190
↓ 15 callers
Function
known_instance
(db: &TestDb, class: KnownClass)
crates/ty_python_semantic/src/types/constraints/projection/tests.rs:35
↓ 15 callers
Method
len
(&self)
crates/ruff_linter/src/noqa.rs:140
↓ 15 callers
Method
name
Returns the public name that pytest uses to request this exposure.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1024
← previous
next →
1,001–1,100 of 31,766, ranked by callers