Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
29,651 in github.com/astral-sh/ruff
⨍
Functions
29,651
◇
Types & classes
6,852
↳
Endpoints
82
↓ 38 callers
Method
create_directory_all
(&self, path: &SystemPath)
crates/ty_test/src/db.rs:114
↓ 38 callers
Function
format_with
Creates an object implementing `Format` that calls the passed closure to perform the formatting. # Examples ``` use ruff_formatter::prelude::*; use
crates/ruff_formatter/src/builders.rs:2319
↓ 38 callers
Method
into_iter
(self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:92
↓ 38 callers
Method
is_subtype_of
Return true if this type is a subtype of type `target`. See [`TypeRelation::Subtyping`] for more details.
crates/ty_python_semantic/src/types/relation.rs:329
↓ 38 callers
Method
is_undefined
Returns `true` if the inner place is undefined (i.e. there is no such member).
crates/ty_python_semantic/src/types/member.rs:36
↓ 38 callers
Method
iter
(&self)
crates/ty_python_semantic/src/types/signatures.rs:217
↓ 38 callers
Function
lex_inline_noqa
Lexes in-line `noqa` comment, e.g. `# noqa: F401`
crates/ruff_linter/src/noqa.rs:354
↓ 38 callers
Method
map
(self, transform: impl FnOnce(T) -> U)
crates/ty_python_semantic/src/types.rs:1945
↓ 38 callers
Method
open
(self)
crates/ruff_linter/resources/test/fixtures/flake8_async/ASYNC230.py:66
↓ 38 callers
Method
or_default
(&self)
crates/ty_project/src/metadata/options.rs:2464
↓ 38 callers
Method
range
(&self)
crates/ruff_linter/src/rules/refurb/rules/repeated_append.rs:158
↓ 38 callers
Method
saturating_add
(self, rhs: TextSize)
crates/ruff_text_size/src/size.rs:113
↓ 38 callers
Method
source
( &mut self, path: impl Into<SystemPathBuf>, contents: impl AsRef<str>,
crates/ty_ide/src/symbols.rs:3387
↓ 38 callers
Method
visit_source_order
(&'a self, visitor: &mut V)
crates/ruff_python_ast/src/node.rs:9
↓ 37 callers
Method
build
Return the built diagnostic.
crates/ruff_db/src/diagnostic/render.rs:2739
↓ 37 callers
Method
check_type_pair
Return a constraint set indicating the conditions under which `self.relation` holds between `source` and `target`.
crates/ty_python_semantic/src/types/relation.rs:1378
↓ 37 callers
Method
contains
(&self, file: File)
crates/ty_project/src/files.rs:203
↓ 37 callers
Method
enable_pull_diagnostics
Enable or disable pull diagnostics capability
crates/ty_server/tests/e2e/main.rs:1357
↓ 37 callers
Method
exists
Returns `true` if the file exists.
crates/ruff_db/src/files.rs:560
↓ 37 callers
Method
get
Get the cached results for a single file at relative `path`. This uses `key` to determine if the results are still accurate. (i.e. if the file hasn't
crates/ruff/src/cache.rs:260
↓ 37 callers
Function
global_scope
(db: &'db dyn Db, file: ProgramFile<'db>)
crates/ty_python_core/src/lib.rs:228
↓ 37 callers
Function
import
PT013
crates/ruff_linter/src/rules/flake8_pytest_style/rules/imports.rs:42
↓ 37 callers
Method
is_class
(self)
crates/ty_python_core/src/scope.rs:266
↓ 37 callers
Method
module_names
When set, the module name for each symbol is included in the snapshot (if available).
crates/ty_ide/src/completion.rs:11326
↓ 37 callers
Method
push
Extends `self` with `path`. If `path` is absolute, it replaces the current path. On Windows: if `path` has a root but no prefix (e.g., `\windows`),
crates/ruff_db/src/system/path.rs:566
↓ 37 callers
Method
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:1406
↓ 37 callers
Method
to_scope_id
(self, db: &'db dyn Db, file: ProgramFile<'db>)
crates/ty_python_core/src/scope.rs:112
↓ 37 callers
Method
trim_start
Trims the indent of `rhs` by `self`. Returns `None` if `self` is not a prefix of `rhs` or either `self` or `rhs` use mixed indentation.
crates/ruff_python_formatter/src/string/docstring.rs:1749
↓ 36 callers
Method
as_ref
(&self)
crates/ty_site_packages/src/lib.rs:450
↓ 36 callers
Method
items
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typed_dict.rs:506
↓ 36 callers
Method
map
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/constraints.rs:2026
↓ 36 callers
Method
to
(self, unit: str)
crates/ruff_benchmark/resources/pydantic/types.py:740
↓ 36 callers
Function
type
(*args)
crates/ruff_linter/resources/test/fixtures/refurb/FURB168.py:84
↓ 36 callers
Method
write_str
(&mut self, val: &str)
crates/ty_python_semantic/src/types/display.rs:390
↓ 35 callers
Method
borrow
(&self)
crates/ruff_index/src/vec.rs:111
↓ 35 callers
Method
document_diagnostic_request
Send a `textDocument/diagnostic` request for the document at the given path.
crates/ty_server/tests/e2e/main.rs:973
↓ 35 callers
Method
file
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:830
↓ 35 callers
Method
is_none_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2466
↓ 35 callers
Method
known
Create a [`NamedTupleSpec`] with the given fields.
crates/ty_python_semantic/src/types/class/named_tuple.rs:580
↓ 35 callers
Function
lex_file_exemption
Lexes file-level exemption comment, e.g. `# ruff: noqa: F401`
crates/ruff_linter/src/noqa.rs:387
↓ 35 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_simplify/rules/collapsible_if.rs:189
↓ 35 callers
Method
resolver_environment
(&self)
crates/ty_module_resolver/src/db.rs:73
↓ 35 callers
Method
signature
Typed internally-visible signature for this function. This represents the annotations on the function itself, unmodified by decorators and overloads.
crates/ty_python_semantic/src/types/function.rs:523
↓ 35 callers
Method
write_files
( &self, files: impl IntoIterator<Item = (&'a str, &'a str)>, )
crates/ty/tests/cli/main.rs:906
↓ 34 callers
Method
as_static
Returns the static class definition if this is one.
crates/ty_python_semantic/src/types/class.rs:905
↓ 34 callers
Method
as_string_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2347
↓ 34 callers
Method
current_token_kind
(&self)
crates/ruff_python_parser/src/parser/mod.rs:418
↓ 34 callers
Method
definition
Returns the definition where this `TypedDict` is created, if it was assigned to a variable.
crates/ty_python_semantic/src/types/class/typed_dict.rs:922
↓ 34 callers
Method
err
A convenience function for returning a builder for a diagnostic with "error" severity and canned values for its identifier and message.
crates/ruff_db/src/diagnostic/render.rs:2667
↓ 34 callers
Method
insert
Adds a typevar to this support.
crates/ty_python_semantic/src/types/constraints/support.rs:30
↓ 34 callers
Method
is_equivalent_to
Return true if this type is [equivalent to] type `other`. Two equivalent types represent the same sets of values. > Two gradual types `A` and `B` ar
crates/ty_python_semantic/src/types/relation.rs:750
↓ 34 callers
Method
iter
Iterates over the entries in the directory in name order.
crates/ruff_db/src/files/directory.rs:52
↓ 34 callers
Method
place
(&self, place_id: impl Into<ScopedPlaceId>)
crates/ty_python_core/src/place.rs:262
↓ 34 callers
Method
push
(&mut self, segment: &'a str)
crates/ruff_python_ast/src/name.rs:462
↓ 34 callers
Method
set_concise_message
Set a custom message for the concise formatting of this diagnostic. This overrides the default behavior of generating a concise message from the head
crates/ruff_db/src/diagnostic/mod.rs:258
↓ 34 callers
Method
with_diagnostic_mode
(mut self, diagnostic_mode: DiagnosticMode)
crates/ty_server/src/session/options.rs:144
↓ 34 callers
Method
write_file
(&self, path: impl AsRef<Path>, content: &str)
crates/ty/tests/cli/main.rs:949
↓ 33 callers
Method
as_str
(self)
crates/ruff_python_ast/src/str.rs:28
↓ 33 callers
Function
empty
()
crates/ty_ide/src/completion.rs:3468
↓ 33 callers
Function
f
()
crates/ty_python_semantic/resources/corpus/10_if_false.py:22
↓ 33 callers
Method
indexer
The [`Indexer`] for the current file, which contains the offsets of all comments and more.
crates/ruff_linter/src/checkers/ast/mod.rs:514
↓ 33 callers
Method
into_iter
(self)
crates/ty_server/src/session.rs:1810
↓ 33 callers
Method
iter_non_variadic_params
Returns an iterator over all non-variadic parameters included in this [`Parameters`] node. The variadic parameters (`.vararg` and `.kwarg`) can never
crates/ruff_python_ast/src/nodes.rs:3154
↓ 33 callers
Method
keys
(&self)
crates/ty_python_core/src/frozen.rs:25
↓ 33 callers
Method
module
The module for which the types are inferred.
crates/ty_python_semantic/src/types/context.rs:202
↓ 33 callers
Method
never
(&self)
crates/ty_python_semantic/src/types/relation.rs:1180
↓ 33 callers
Function
parse
( short_title: &'s str, source: &'s str, )
crates/ty_test/src/lib.rs:618
↓ 33 callers
Method
system_file
(&self, path: impl AsRef<SystemPath>)
crates/ty/tests/file_watching.rs:243
↓ 32 callers
Method
arg
Adds an argument to the command.
crates/ruff_db/src/system/command.rs:24
↓ 32 callers
Method
as_ref
(&self)
crates/ruff_db/src/system/path.rs:641
↓ 32 callers
Method
into_iter
(self)
crates/ty_python_core/src/frozen.rs:93
↓ 32 callers
Method
is_name_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2651
↓ 32 callers
Method
is_traverse
(self)
crates/ruff_python_ast/src/visitor/source_order.rs:243
↓ 32 callers
Method
iter_mro
Iterate over the [method resolution order] ("MRO") of the class. If the MRO could not be accurately resolved, this method falls back to iterating ove
crates/ty_python_semantic/src/types/class/static_literal.rs:841
↓ 32 callers
Method
line_ending
(&self)
crates/ruff_source_file/src/newlines.rs:241
↓ 32 callers
Function
parse_expression
Parses a single Python expression. This convenience function can be used to parse a single expression without having to specify the Mode or the locat
crates/ruff_python_parser/src/lib.rs:135
↓ 32 callers
Method
program
(self, db: &dyn Db)
crates/ty_project/src/lib.rs:274
↓ 32 callers
Method
resolve_name
Resolves the [`ast::ExprName`] to the [`BindingId`] of the symbol it refers to, if any.
crates/ruff_python_semantic/src/model.rs:1132
↓ 32 callers
Function
sorted
()
crates/ruff_linter/resources/test/fixtures/refurb/FURB192.py:44
↓ 32 callers
Function
test_snippet
Run [`check_path`] on a snippet of Python code.
crates/ruff_linter/src/test.rs:217
↓ 32 callers
Method
to_instance_approximation
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types.rs:7929
↓ 31 callers
Method
as_str
(self)
crates/ty_site_packages/src/lib.rs:435
↓ 31 callers
Method
count
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:579
↓ 31 callers
Function
definition_expression_type
Infer the type of a (possibly deferred) sub-expression of a [`Definition`]. Supports expressions that are evaluated within a type-params sub-scope.
crates/ty_python_semantic/src/types.rs:356
↓ 31 callers
Method
is_empty
(&self)
crates/ty_site_packages/src/lib.rs:93
↓ 31 callers
Method
kind
(&self)
crates/ruff_python_ast/src/token.rs:43
↓ 31 callers
Function
line_index
(db: &dyn Db, file: File)
crates/ruff_db/src/source.rs:206
↓ 31 callers
Method
only_binding
Resolves the [`ast::ExprName`] to the [`BindingId`] of the symbol it refers to, if it's the only binding to that name in its scope.
crates/ruff_python_semantic/src/model.rs:1138
↓ 31 callers
Method
program_file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:519
↓ 31 callers
Method
python_version
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/context.rs:105
↓ 31 callers
Method
resolve_builtin_symbol
If `expr` is a reference to a builtins symbol, return the name of that symbol. Else, return `None`. This method returns `true` both for "builtin bind
crates/ruff_python_semantic/src/model.rs:380
↓ 31 callers
Method
tokens
Returns the token stream for `path` serialized as a string.
crates/ty_wasm/src/lib.rs:308
↓ 31 callers
Method
universal_newlines
(&self)
crates/ruff_source_file/src/newlines.rs:13
↓ 31 callers
Function
unknown_rule_selector_test
()
crates/ruff/tests/cli/lint.rs:762
↓ 30 callers
Function
assert_fail
(result: Result<Vec<Diagnostic>, FailuresByLine>, messages: &[(usize, &[&str])])
crates/mdtest/src/matcher.rs:598
↓ 30 callers
Method
build
Build the test server
crates/ruff_server/tests/e2e/main.rs:1146
↓ 30 callers
Method
checked_sub
(self, rhs: TextSize)
crates/ruff_text_size/src/size.rs:106
↓ 30 callers
Method
clear
Clears state such that this group is indistinguishable from an empty group.
crates/ty_ide/src/all_symbols.rs:375
↓ 30 callers
Function
filter_result_id
Redact result_id values since they are hash-based and non-deterministic
crates/ty_server/tests/e2e/pull_diagnostics.rs:831
↓ 30 callers
Method
insert
(&mut self, file: File, is_script: bool)
crates/ty_project/src/files.rs:247
← previous
next →
401–500 of 29,651, ranked by callers