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
↓ 14 callers
Method
root_path
(&self)
crates/ty/tests/file_watching.rs:51
↓ 14 callers
Method
secondary_code
Returns the secondary code for the diagnostic if it exists. The "primary" code for the diagnostic is its lint name. Diagnostics in ty don't have seco
crates/ruff_db/src/diagnostic/mod.rs:432
↓ 14 callers
Method
snapshot
(&self)
crates/ty_ide/src/completion.rs:11321
↓ 14 callers
Method
source_code
Return the notebook content. This is the concatenation of all Python code cells.
crates/ruff_notebook/src/notebook.rs:372
↓ 14 callers
Method
status
(&self)
crates/ty_python_semantic/src/lint.rs:134
↓ 14 callers
Method
target
(self, db: &'db dyn Db, parsed: &'ast ParsedModuleRef)
crates/ty_python_core/src/unpack.rs:69
↓ 14 callers
Method
to_subclass_of
Look up a [`KnownClass`] in its canonical module and return a [`Type`] representing that class and all possible subclasses of the class. If the class
crates/ty_python_semantic/src/types/class/known.rs:1265
↓ 14 callers
Method
trim_whitespace_start
(&self)
crates/ruff_python_trivia/src/whitespace.rs:117
↓ 14 callers
Method
try_add_root
Adds a new root for `path` and returns the root. The root isn't added nor is the file root's kind updated if a root for `path` already exists.
crates/ruff_db/src/files.rs:258
↓ 14 callers
Function
unbound
()
crates/ty_python_core/src/use_def/place_state.rs:645
↓ 14 callers
Method
value
Return the numeric value for this [`LineLength`]
crates/ruff_linter/src/line_width.rs:26
↓ 14 callers
Function
walk_body
(visitor: &mut V, body: &'a [Stmt])
crates/ruff_python_ast/src/visitor.rs:119
↓ 14 callers
Method
with_file
Write a file to the test directory
crates/ruff_server/tests/e2e/main.rs:1117
↓ 14 callers
Method
workspace_diagnostic_request
Send a `workspace/diagnostic` request with optional previous result IDs.
crates/ty_server/tests/e2e/main.rs:942
↓ 14 callers
Method
write_project_file
( &self, relative_path: impl AsRef<SystemPath>, content: &str, )
crates/ty/tests/file_watching.rs:315
↓ 13 callers
Method
access
Materialize only the access that an operation actually observes. In particular, an instance-method relation must not materialize the class-side calla
crates/ty_python_semantic/src/types/protocol_class.rs:2115
↓ 13 callers
Method
add_declaration_with_binding
( &mut self, node: AnyNodeRef, definition: Definition<'db>, declared_and_infer
crates/ty_python_semantic/src/types/infer/builder.rs:1675
↓ 13 callers
Method
add_negative_in_place
(&mut self, ty: Type<'db>)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1352
↓ 13 callers
Method
all_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:862
↓ 13 callers
Method
ancestor_scopes
Returns the scopes enclosing `node`, starting with the scope containing the node itself. Like [`Self::scope`], this handles nodes inside string annot
crates/ty_python_semantic/src/semantic_model.rs:411
↓ 13 callers
Method
ancestors
(&self)
crates/ruff_db/src/system/path.rs:201
↓ 13 callers
Method
as_any_import
(&self)
crates/ruff_python_semantic/src/binding.rs:297
↓ 13 callers
Method
as_bytes
(self)
crates/ty_python_semantic/src/types/literal.rs:187
↓ 13 callers
Method
as_ref
(&self)
crates/ruff_db/src/files/path.rs:106
↓ 13 callers
Method
as_slice
Returns a slice of all the [`FStringPart`]s contained in this value.
crates/ruff_python_ast/src/nodes.rs:518
↓ 13 callers
Method
as_typed_dict
(self)
crates/ty_python_semantic/src/types.rs:2163
↓ 13 callers
Function
assert_function_query_was_not_run
( db: &Db, query: Q, input: I, events: &[salsa::Event], )
crates/ruff_db/src/testing.rs:6
↓ 13 callers
Method
assert_reverse_tokenization
(&self)
crates/ruff_python_trivia_integration_tests/tests/simple_tokenizer.rs:15
↓ 13 callers
Method
at_expr
Returns `true` if the current token is the start of an expression.
crates/ruff_python_parser/src/parser/expression.rs:137
↓ 13 callers
Method
at_ts
Returns `true` if the current token is found in the given token set.
crates/ruff_python_parser/src/parser/mod.rs:710
↓ 13 callers
Method
attach_to
Render the error context tree as info sub-diagnostics on `diag`.
crates/ty_python_semantic/src/types/relation_error.rs:704
↓ 13 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
↓ 13 callers
Method
binding_ids
Returns the IDs of all bindings defined in this scope.
crates/ruff_python_semantic/src/scope.rs:98
↓ 13 callers
Function
classify
Classify a function based on its scope, name, and decorators.
crates/ruff_python_semantic/src/analyze/function_type.rs:20
↓ 13 callers
Method
cmp
(&self, rhs: &CompletionRanker<'_>)
crates/ty_ide/src/completion.rs:3364
↓ 13 callers
Method
collect_vec
Walks the project paths and collects the paths of all files that are included in the project.
crates/ty_project/src/walk.rs:147
↓ 13 callers
Function
create_diagnostics
Create Ruff-style diagnostics for testing the various output formats.
crates/ruff_db/src/diagnostic/render.rs:2910
↓ 13 callers
Method
current_statement_parent
Return the parent [`Stmt`] of the current [`Stmt`], if any.
crates/ruff_python_semantic/src/model.rs:1481
↓ 13 callers
Method
db
(&self)
crates/ty/tests/file_watching.rs:55
↓ 13 callers
Method
debug
Parse all suppressions and errors in a module for testing
crates/ruff_linter/src/suppression.rs:2949
↓ 13 callers
Method
encoding
(&self)
crates/ruff_server/src/session.rs:192
↓ 13 callers
Method
entries
Adds the contents of an iterator of entries to the join output.
crates/ruff_formatter/src/builders.rs:2484
↓ 13 callers
Method
enum_class
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/enums.rs:750
↓ 13 callers
Function
error
()
crates/ruff_linter/resources/test/fixtures/flake8_pytest_style/PT022.py:15
↓ 13 callers
Method
exists
Returns a new BDD that is the _existential abstraction_ of `self` for a set of typevars. The result will return true whenever `self` returns true for
crates/ty_python_semantic/src/types/constraints.rs:3165
↓ 13 callers
Method
expression
The source text of the expression (e.g., `0x0` in `f"{0x0=}"`).
crates/ruff_python_ast/src/nodes.rs:459
↓ 13 callers
Method
expression
(&self, expression_key: impl Into<ExpressionNodeKey>)
crates/ty_python_core/src/lib.rs:650
↓ 13 callers
Method
first_declaration
(&self)
crates/ty_python_semantic/src/types/typed_dict.rs:3110
↓ 13 callers
Function
foo
(a, b)
crates/ruff_linter/resources/test/fixtures/ruff/RUF069.py:18
↓ 13 callers
Method
get
(&self, key: DefinitionNodeKey)
crates/ty_python_core/src/lib.rs:274
↓ 13 callers
Method
get
(&self, key: &K)
crates/ty_python_core/src/frozen.rs:66
↓ 13 callers
Method
get
Return parameter at given index, or `None` if index is out-of-range.
crates/ty_python_semantic/src/types/signatures.rs:4878
↓ 13 callers
Method
get_default
Returns the most appropriate type of this argument when there is no specific declared type.
crates/ty_python_semantic/src/types/call/arguments.rs:68
↓ 13 callers
Method
has_known_decorator
(self, db: &dyn Db, decorator: FunctionDecorators)
crates/ty_python_semantic/src/types/function.rs:343
↓ 13 callers
Method
id
Returns the identifier for this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:210
↓ 13 callers
Method
id
(&self)
crates/ruff_python_ast/src/nodes.rs:2532
↓ 13 callers
Method
id
(&self)
crates/ty_wasm/src/lib.rs:950
↓ 13 callers
Function
infer_expression_types
Infer all types for an [`Expression`] (including sub-expressions). Use rarely; only for cases where we'd otherwise risk double-inferring an expression
crates/ty_python_semantic/src/types/infer.rs:402
↓ 13 callers
Method
inferred_type
(&self, model: &SemanticModel<'db>)
crates/ty_ide/src/goto.rs:489
↓ 13 callers
Method
into_uri
Converts the key back into its original URI.
crates/ruff_server/src/edit.rs:55
↓ 13 callers
Function
into_vec
(assertions: InlineFileAssertions<'_>)
crates/mdtest/src/assertion.rs:567
↓ 13 callers
Method
is_async
(self)
crates/ty_python_core/src/lib.rs:1025
↓ 13 callers
Method
is_empty
(&self)
crates/ruff_linter/src/noqa.rs:340
↓ 13 callers
Method
is_instance_of
Return `true` if `self` is a nominal instance of the given known class.
crates/ty_python_semantic/src/types/instance.rs:161
↓ 13 callers
Function
is_override
Returns `true` if a function definition is an `@override` (PEP 698).
crates/ruff_python_semantic/src/analyze/visibility.rs:37
↓ 13 callers
Method
is_standard_library
(&self)
crates/ty_module_resolver/src/path.rs:34
↓ 13 callers
Method
is_variadic
(&self, index: usize)
crates/ty_python_semantic/src/types/call/arguments.rs:199
↓ 13 callers
Method
item
Returns the field exposed by a literal key. Undeclared keys synthesize a field only for explicit extra items. Hidden items on an implicitly open `Typ
crates/ty_python_semantic/src/types/typed_dict.rs:382
↓ 13 callers
Method
iter_mut
(&mut self)
crates/ruff_index/src/slice.rs:89
↓ 13 callers
Method
iter_prefix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1138
↓ 13 callers
Method
join
(mut self)
crates/ruff_server/src/server/schedule/thread.rs:88
↓ 13 callers
Method
kind
(mut self, kind: impl Into<Option<CompletionKind>>)
crates/ty_ide/src/completion.rs:593
↓ 13 callers
Method
len
(&self)
crates/ruff_linter/src/noqa.rs:139
↓ 13 callers
Method
line_starts
Returns the [byte offsets](TextSize) for every line
crates/ruff_source_file/src/line_index.rs:533
↓ 13 callers
Method
lookup_symbol
Lookup a symbol in the current scope without materializing lazy builtins.
crates/ruff_python_semantic/src/model.rs:795
↓ 13 callers
Method
match_parameters
Match parameters for this constructor method and downstream constructors.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:156
↓ 13 callers
Method
materialized_divergent_fallback
If `self` is a materialized `Divergent` type, returns the concrete type it should behave as: `object` for top-materialized, `Never` for bottom-materia
crates/ty_python_semantic/src/types.rs:1559
↓ 13 callers
Method
name
(&self)
crates/ruff_benchmark/src/lib.rs:79
↓ 13 callers
Method
negate_if
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, yes: bool)
crates/ty_python_semantic/src/types.rs:2427
↓ 13 callers
Method
normalize_path
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/memory_fs.rs:371
↓ 13 callers
Method
open_text_document
Send a `textDocument/didOpen` notification
crates/ruff_server/tests/e2e/main.rs:684
↓ 13 callers
Function
original_class_type
Return the original class literal for a class definition. For decorated classes, this is the class object before applying decorators. The public bind
crates/ty_python_semantic/src/types/infer.rs:793
↓ 13 callers
Function
parameter_documentation
Returns the parameter documentation recognized in a reST docstring. `normalized_source` must have already undergone PEP-257 trimming and universal ne
crates/ty_ide/src/docstring/document/rst.rs:38
↓ 13 callers
Method
parse_conditional_expression_or_higher
Parses every Python expression except unparenthesized tuple and named expressions. Matches the `expression` rule in the [Python grammar]. This uses
crates/ruff_python_parser/src/parser/expression.rs:205
↓ 13 callers
Method
pop
(&mut self)
crates/ruff_formatter/src/printer/stack.rs:14
↓ 13 callers
Method
primary_annotation
Returns a shared borrow of the "primary" annotation of this diagnostic if one exists. When there are multiple primary annotations, then the first one
crates/ruff_db/src/diagnostic/mod.rs:281
↓ 13 callers
Method
range
(&self)
crates/ty_ide/src/semantic_tokens.rs:158
↓ 13 callers
Method
recursive_type_normalized
Normalize recursive types for cycle recovery when there's no previous value. See [`Type::recursive_type_normalized`] for more details.
crates/ty_python_semantic/src/types/typevar.rs:2054
↓ 13 callers
Method
remove
Removes `rule` from the set. ## Examples ```rust # use ruff_linter::registry::{Rule, RuleSet}; let mut set = RuleSet::from_rules(&[Rule::AmbiguousFun
crates/ruff_linter/src/registry/rule_set.rs:229
↓ 13 callers
Method
resolve_member
(self, db: &'db dyn Db, name: &Name)
crates/ty_python_semantic/src/types/enums.rs:391
↓ 13 callers
Method
resolved_client_capabilities
Returns the resolved client capabilities that were captured during initialization.
crates/ty_server/src/session.rs:1382
↓ 13 callers
Method
root
Returns the path to the test directory root.
crates/ruff/tests/cli/main.rs:179
↓ 13 callers
Method
run
(self)
crates/ty_site_packages/src/lib.rs:2428
↓ 13 callers
Method
scope
Returns the scope containing the prefix loads.
crates/ty_python_semantic/src/place_load.rs:834
↓ 13 callers
Method
search_paths
(&self)
crates/ty_module_resolver/src/db.rs:69
↓ 13 callers
Method
skip_bytes
Skips the next `count` bytes. ## Panics - If `count` is larger than the remaining bytes in the input stream. - If `count` indexes into a multi-byte c
crates/ruff_python_trivia/src/cursor.rs:169
↓ 13 callers
Method
snapshot
Generate a [`Snapshot`] of the current semantic model.
crates/ruff_python_semantic/src/model.rs:2053
↓ 13 callers
Function
space
()
crates/ruff_formatter/src/builders.rs:660
↓ 13 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:216
↓ 13 callers
Function
suffixed_err
Return a `TOMLDecodeError` where error message is suffixed with coordinates in source.
crates/ruff_benchmark/resources/tomllib/_parser.py:652
← previous
next →
1,001–1,100 of 28,707, ranked by callers