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
↓ 18 callers
Method
return_type
Compute the overall effective return type of this `ConstructorBinding`.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:311
↓ 18 callers
Method
scope
(&self)
crates/ty_python_semantic/src/types/context.rs:206
↓ 18 callers
Method
scope_id
The scope in which the reference is defined.
crates/ruff_python_semantic/src/reference.rs:36
↓ 18 callers
Method
shrink_to_fit
(&mut self)
crates/ty_python_semantic/src/types/diagnostic.rs:1365
↓ 18 callers
Method
specialization
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:5755
↓ 18 callers
Method
system
(&self)
crates/ruff_db/src/system/test.rs:90
↓ 18 callers
Method
ty
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:1207
↓ 18 callers
Method
type_argument
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:10251
↓ 18 callers
Method
visit_body
(&mut self, body: &'db [ast::Stmt])
crates/ty_ide/src/symbols.rs:844
↓ 17 callers
Method
as_str
(&self)
crates/ruff_linter/src/rules/ruff/rules/unused_noqa.rs:21
↓ 17 callers
Method
as_symbol
Returns `Some` if the reference is a `Symbol`, otherwise `None`.
crates/ty_python_core/src/place.rs:112
↓ 17 callers
Method
char_column
Set the default column to display <div class="warning"> `char_column` is only be respected if [`Origin::line`] is also set. </div>
crates/ruff_annotate_snippets/src/snippet.rs:570
↓ 17 callers
Function
check_os_pathlib_single_arg_calls
We check functions that take only 1 argument, this does not apply to functions with `dir_fd` argument, because `dir_fd` is not supported by pathlib,
crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs:53
↓ 17 callers
Method
child_scopes
Returns an iterator over the direct child scopes of `scope`.
crates/ty_python_core/src/lib.rs:562
↓ 17 callers
Method
class
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/instance.rs:269
↓ 17 callers
Method
default_specialization
Returns the default specialization for this class. For static classes, this applies default type arguments. For dynamic classes, this returns a non-g
crates/ty_python_semantic/src/types/class.rs:718
↓ 17 callers
Function
delete_stmt
Return the [`Edit`] to use when deleting a [`Stmt`]. In some cases, this is as simple as deleting the [`TextRange`] of the [`Stmt`] itself. However,
crates/ruff_linter/src/fix/edits.rs:39
↓ 17 callers
Method
finish
(self)
crates/ty_python_core/src/place.rs:418
↓ 17 callers
Method
first_public_binding
(&self, symbol: ScopedSymbolId)
crates/ty_python_core/src/lib.rs:1091
↓ 17 callers
Method
format
(&self)
crates/ruff_python_formatter/src/generated.rs:24
↓ 17 callers
Method
format
Whether to enable concise diagnostic output or not.
crates/ruff_db/src/diagnostic/mod.rs:1469
↓ 17 callers
Method
get
Looks up a lint by its name.
crates/ty_python_semantic/src/lint.rs:415
↓ 17 callers
Method
in_range
Initialize [`NoqaLexer`] in the given range of source text.
crates/ruff_linter/src/noqa.rs:428
↓ 17 callers
Method
intersect
Return a new tuple-spec builder that reflects the intersection of this tuple and another tuple, or `None` if the intersection is impossible (e.g., two
crates/ty_python_semantic/src/types/tuple.rs:3047
↓ 17 callers
Method
into_iter
(self)
crates/ruff_linter/src/registry/rule_set.rs:333
↓ 17 callers
Method
into_owned
(self)
crates/ruff_python_codegen/src/stylist.rs:37
↓ 17 callers
Method
is_ellipsis_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2503
↓ 17 callers
Method
is_eof
(self)
crates/ruff_python_ast/src/token.rs:327
↓ 17 callers
Method
is_same_typevar_as
Returns whether two bound typevars represent the same occurrence, regardless of e.g. differences in their bounds or constraints due to materialization
crates/ty_python_semantic/src/types/typevar.rs:1114
↓ 17 callers
Method
is_typevartuple
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:255
↓ 17 callers
Method
len
Returns the number of rules in this set. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; assert_eq!(RuleSet::empty().len(), 0); as
crates/ruff_linter/src/registry/rule_set.rs:177
↓ 17 callers
Method
node
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1451
↓ 17 callers
Method
node_level
(&self)
crates/ruff_python_formatter/src/context.rs:65
↓ 17 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:1487
↓ 17 callers
Method
paramspec_attr
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:993
↓ 17 callers
Method
path
Returns the relative path as specified by the user.
crates/ty_project/src/metadata/value.rs:52
↓ 17 callers
Function
place_from_bindings
Infer the combined type from an iterator of bindings, and return it together with boundness information in a [`Place`]. The type will be a union if t
crates/ty_python_semantic/src/place.rs:787
↓ 17 callers
Method
place_id
Returns the [`ScopedPlaceId`] of the place expression.
crates/ty_python_core/src/place.rs:246
↓ 17 callers
Method
prefix
Return the prefix for the [`NoqaCode`], e.g., `SIM` for `SIM101`.
crates/ruff_linter/src/codes.rs:19
↓ 17 callers
Method
remove_file
(self, db: &mut dyn Db, file: File)
crates/ty_project/src/lib.rs:515
↓ 17 callers
Function
rename
Perform a rename operation on the symbol at the given position. Returns all locations that need to be updated with the new name.
crates/ty_ide/src/rename.rs:57
↓ 17 callers
Method
search
Returns a sequence of symbols that matches the given query.
crates/ty_ide/src/symbols.rs:153
↓ 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:1612
↓ 17 callers
Method
snapshot
(&self)
crates/ruff_python_parser/src/parser/scratch_buffer.rs:38
↓ 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_meta_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/instance.rs:471
↓ 17 callers
Method
to_str
(&self, db: &'a dyn Db)
crates/ty_module_resolver/src/resolve.rs:1280
↓ 17 callers
Method
trim_whitespace
(&self)
crates/ruff_python_trivia/src/whitespace.rs:113
↓ 17 callers
Method
truncate
(&mut self, a: usize)
crates/ruff_index/src/vec.rs:47
↓ 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
↓ 16 callers
Method
add_binding
Add a binding for the given definition. Returns the result of the `infer_value_ty` closure, which is called with the declared type as type context.
crates/ty_python_semantic/src/types/infer/builder.rs:1397
↓ 16 callers
Method
add_python_cell
(&mut self, content: &str)
crates/ty_server/tests/e2e/notebook.rs:596
↓ 16 callers
Method
all
Returns all supported semantic token types as enum variants.
crates/ty_ide/src/semantic_tokens.rs:77
↓ 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_function_def_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:399
↓ 16 callers
Method
as_subscript_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2606
↓ 16 callers
Method
as_system
(&self)
crates/ty_test/src/db.rs:413
↓ 16 callers
Method
assert_progressing
(&mut self, p: &Parser)
crates/ruff_python_parser/src/parser/progress.rs:35
↓ 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
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:1487
↓ 16 callers
Method
db
Returns the underlying test DB.
crates/ty_ide/src/completion.rs:11193
↓ 16 callers
Method
exactly_one
(self)
crates/ty_python_semantic/src/types/callable.rs:726
↓ 16 callers
Method
extend
Extend `self` with the components of `other` # Examples ``` use ty_module_resolver::ModuleName; let mut module_name = ModuleName::new_static("foo")
crates/ty_module_resolver/src/module_name.rs:281
↓ 16 callers
Method
extension
(&self)
crates/ty_module_resolver/src/path.rs:840
↓ 16 callers
Method
index
(self)
crates/ty_python_semantic/src/types/constraints.rs:3416
↓ 16 callers
Method
initialization_result
Get the initialization result
crates/ty_server/tests/e2e/main.rs:767
↓ 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
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
or
(self, other: Self)
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:455
↓ 16 callers
Method
program_file
(&self)
crates/ty_python_semantic/src/semantic_model.rs:72
↓ 16 callers
Method
range
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:585
↓ 16 callers
Method
remaining_literal_union
Expand this complement to the union of enum literals that remain possible.
crates/ty_python_semantic/src/types/enums.rs:785
↓ 16 callers
Method
resolve
Resolves a stored property accessor to the value type exposed by that access.
crates/ty_python_semantic/src/types/protocol_class.rs:1228
↓ 16 callers
Method
reverse
(self)
crates/ruff_linter/src/rules/refurb/rules/if_expr_min_max.rs:173
↓ 16 callers
Method
set
Set the value of the `AtomicNodeIndex`.
crates/ruff_python_ast/src/node_index.rs:177
↓ 16 callers
Method
set_fix
Set the fix for this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:369
↓ 16 callers
Method
to_search_paths
( &self, system: &dyn System, vendored: &VendoredFileSystem, strategy: &Strate
crates/ty_module_resolver/src/settings.rs:55
↓ 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:133
↓ 16 callers
Method
try_to_class_literal
Look up a [`KnownClass`] in its canonical module and return a [`Type`] representing that class literal. If the class cannot be found, a debug-level l
crates/ty_python_semantic/src/types/class/known.rs:1230
↓ 16 callers
Method
tuple_spec
If this is an instance type where the class has a tuple spec, returns the tuple spec. I.e., for the type `tuple[int, str]`, this will return the tupl
crates/ty_python_semantic/src/types/instance.rs:313
↓ 16 callers
Method
values
(&self)
crates/ruff_python_index/src/interpolated_string_ranges.rs:70
↓ 16 callers
Method
when_all
( self, _db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, mut f: impl
crates/ty_python_semantic/src/types/constraints.rs:219
↓ 16 callers
Method
with_qualifiers
(self, qualifiers: TypeQualifiers)
crates/ty_python_semantic/src/place.rs:332
↓ 16 callers
Method
write_char
( ch: char, quote: Quote, formatter: &mut impl std::fmt::Write, )
crates/ruff_python_literal/src/escape.rs:178
↓ 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
apply_type_mapping
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, type_mapping: &TypeMap
crates/ty_python_semantic/src/types/generics.rs:1431
↓ 15 callers
Method
as_function_literal
(self)
crates/ty_python_semantic/src/types.rs:2228
↓ 15 callers
Method
as_i64
(self)
crates/ty_python_semantic/src/types/literal.rs:313
↓ 15 callers
Method
as_nominal_instance
(self)
crates/ty_python_semantic/src/types/instance.rs:153
↓ 15 callers
Method
as_str
The code that is ignored by the `noqa` directive.
crates/ruff_linter/src/noqa.rs:102
↓ 15 callers
Method
as_typevar
(self)
crates/ty_python_semantic/src/types/typevar.rs:38
↓ 15 callers
Function
assert_ok
(result: &Result<Vec<Diagnostic>, FailuresByLine>)
crates/mdtest/src/matcher.rs:627
↓ 15 callers
Method
completion_request
Sends a `textDocument/completion` request for the document at the given URI and position.
crates/ty_server/tests/e2e/main.rs:995
↓ 15 callers
Method
concise_message
Introspects this diagnostic and returns its message for concise formatting. When we concisely format diagnostics, we likely want to not only include
crates/ruff_db/src/diagnostic/mod.rs:237
↓ 15 callers
Function
covering_node
Returns the node with a minimal range that fully contains `range`. If `range` is empty and falls within a parser *synthesized* node generated during
crates/ruff_python_ast/src/find_node.rs:14
↓ 15 callers
Function
default_lint_registry
Returns the default registry with all known semantic lints.
crates/ty_python_semantic/src/lib.rs:75
↓ 15 callers
Method
definition
(&self)
crates/ty_python_semantic/src/types/ide_support.rs:2131
← previous
next →
801–900 of 28,707, ranked by callers