Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,349 in github.com/astral-sh/ruff
⨍
Functions
27,349
◇
Types & classes
6,530
↳
Endpoints
82
↓ 9 callers
Method
secondary_code_or_id
Returns the secondary code for the diagnostic if it exists, or the lint name otherwise. This is a common pattern for Ruff diagnostics, which want to
crates/ruff_db/src/diagnostic/mod.rs:427
↓ 9 callers
Function
sequence_pattern_type_builder
(db: &dyn Db)
crates/ty_python_semantic/src/types/match_pattern.rs:89
↓ 9 callers
Method
show_error_message
Sends a request to display an error to the client with a formatted message. The error is sent in a `window/showMessage` notification. Logs an error i
crates/ty_server/src/session/client.rs:195
↓ 9 callers
Method
show_fix_status
(&self)
crates/ruff_db/src/diagnostic/mod.rs:1564
↓ 9 callers
Method
site_packages_paths
( &self, system: &dyn System, )
crates/ty_site_packages/src/lib.rs:378
↓ 9 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
↓ 9 callers
Function
skip_chars
(src: str, pos: Pos, chars: Iterable[str])
crates/ruff_benchmark/resources/tomllib/_parser.py:232
↓ 9 callers
Function
soft_line_break_or_space
()
crates/ruff_formatter/src/builders.rs:190
↓ 9 callers
Method
source_location
( &self, offset: TextSize, position_encoding: PositionEncoding, )
crates/ruff_source_file/src/lib.rs:44
↓ 9 callers
Method
split_around_star
Return the patterns before and after the starred element.
crates/ty_python_core/src/predicate.rs:166
↓ 9 callers
Method
system
(&self)
crates/ty_project/src/db.rs:575
↓ 9 callers
Function
test_helper
(source: &str, expected: usize)
crates/ruff_linter/src/rules/pylint/rules/too_many_return_statements.rs:105
↓ 9 callers
Function
text
Creates a text from a dynamic string. This is done by allocating a new string internally.
crates/ruff_formatter/src/builders.rs:343
↓ 9 callers
Method
text_len
Returns the length of the indentation in bytes. # Panics If the indentation is longer than 4GB.
crates/ruff_python_formatter/src/string/docstring.rs:1734
↓ 9 callers
Method
text_len
(&self)
crates/ruff_python_trivia/src/cursor.rs:64
↓ 9 callers
Method
text_len
(self)
crates/ruff_python_ast/src/str_prefix.rs:39
↓ 9 callers
Method
to_module_path
(&self)
crates/ty_module_resolver/src/path.rs:580
↓ 9 callers
Method
truncated_display
Return a truncated snippet for user-facing display.
crates/ruff_linter/src/fix/snippet.rs:27
↓ 9 callers
Method
try_map
A fallible version of [`UnionType::map`]. For each element in `self`, `transform_fn` is called on that element. If `transform_fn` returns `Some()` fo
crates/ty_python_semantic/src/types/set_theoretic.rs:189
↓ 9 callers
Method
try_set_optional_fix
( &mut self, func: impl FnOnce() -> anyhow::Result<Option<Fix>>, )
crates/ruff_linter/src/checkers/ast/mod.rs:3730
↓ 9 callers
Method
tuple_instance_spec
If this type 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
crates/ty_python_semantic/src/types.rs:1483
↓ 9 callers
Method
typing_importer
Create a [`TypingImporter`] that will import `member` from either `typing` or `typing_extensions`. On Python <`version_added_to_typing`, `member` is
crates/ruff_linter/src/checkers/ast/mod.rs:640
↓ 9 callers
Method
union
Return a new tuple-spec builder that reflects the union of this tuple and another tuple. For example, if `self` is a tuple-spec builder for `tuple[Li
crates/ty_python_semantic/src/types/tuple.rs:2535
↓ 9 callers
Function
update_file
Updates the content of a file and ensures that the last modified file time is updated.
crates/ty/tests/file_watching.rs:506
↓ 9 callers
Function
vendored_path_to_file
( db: &dyn Db, path: impl AsRef<VendoredPath>, )
crates/ruff_db/src/files.rs:53
↓ 9 callers
Method
when_assignable_to
( self, db: &'db dyn Db, target: Type<'db>, constraints: &'c ConstraintSetBuil
crates/ty_python_semantic/src/types/relation.rs:410
↓ 9 callers
Method
when_false
(self)
crates/ty_python_semantic/src/types/constraints.rs:1702
↓ 9 callers
Method
with_file
Write a file to the test directory
crates/ruff_server/tests/e2e/main.rs:1112
↓ 9 callers
Method
write
Write the notebook back to the given [`Write`] implementer.
crates/ruff_notebook/src/notebook.rs:466
↓ 8 callers
Method
__init__
(self, foo)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:332
↓ 8 callers
Method
absolute
Makes a path absolute and normalizes it without accessing the file system. Adapted from [cargo](https://github.com/rust-lang/cargo/blob/fede83ccf9734
crates/ruff_db/src/system/path.rs:447
↓ 8 callers
Method
add
Attempts to adds the given completion to this collection. When added, `true` is returned. This might not add the completion for a variety of reasons
crates/ty_ide/src/completion.rs:218
↓ 8 callers
Method
add
(x, y)
crates/ruff_linter/resources/test/fixtures/refurb/FURB118.py:47
↓ 8 callers
Function
add_argument
Generic function to add arguments or keyword arguments to function calls. The new argument will be inserted before the first existing keyword argumen
crates/ruff_linter/src/fix/edits.rs:274
↓ 8 callers
Method
add_symbol
Add a symbol to the place table and the use-def map. Return the [`ScopedPlaceId`] that uniquely identifies the symbol in both.
crates/ty_python_core/src/builder.rs:1345
↓ 8 callers
Method
after
Returns a slice of tokens after the given [`TextSize`] offset. If the given offset is between two tokens, the returned slice will start from the foll
crates/ruff_python_ast/src/token/tokens.rs:174
↓ 8 callers
Method
applies
Return [`true`] if this [`Fix`] should be applied with at a given [`Applicability`].
crates/ruff_diagnostics/src/fix.rs:174
↓ 8 callers
Method
apply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:428
↓ 8 callers
Method
as_path
(&self)
crates/ty_module_resolver/src/path.rs:693
↓ 8 callers
Method
as_slice
(&self)
crates/ty_python_semantic/src/types/signatures.rs:3346
↓ 8 callers
Method
as_string
(self)
crates/ty_python_semantic/src/types/literal.rs:202
↓ 8 callers
Method
bindings
Returns a tuple of the name and ID of all bindings defined in this scope.
crates/ruff_python_semantic/src/scope.rs:103
↓ 8 callers
Method
block_comments
Given a [`CommentRanges`], determine which comments are grouped together in "comment blocks". A "comment block" is a sequence of consecutive own-line
crates/ruff_python_trivia/src/comment_ranges.rs:157
↓ 8 callers
Method
bool
Resolves the boolean value of the type and falls back to [`Truthiness::Ambiguous`] if the type doesn't implement `__bool__` correctly. This method sh
crates/ty_python_semantic/src/types/bool.rs:21
↓ 8 callers
Method
build
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:3088
↓ 8 callers
Method
capabilities
Derives the instance/class read/write capabilities exposed by this member. These are views of the canonical method, property, or attribute representa
crates/ty_python_semantic/src/types/protocol_class.rs:692
↓ 8 callers
Function
check_display_graph
( db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, set: ConstraintSet<'db, 'c>
crates/ty_python_semantic/src/types/constraints.rs:7244
↓ 8 callers
Function
check_file
(db: &dyn Db, file: File)
crates/ty_python_semantic/src/lib.rs:176
↓ 8 callers
Method
clear
(&mut self)
crates/ruff_linter/src/registry/rule_set.rs:27
↓ 8 callers
Method
clear_salsa_events
Clears the salsa events.
crates/ty_module_resolver/src/db.rs:81
↓ 8 callers
Method
current_directory
(&self)
crates/ty_test/src/db.rs:433
↓ 8 callers
Method
current_statement_id
Return the [`NodeId`] of the current [`Stmt`], if any.
crates/ruff_python_semantic/src/model.rs:1519
↓ 8 callers
Method
default_string_flags
Return the default string flags a generated `StringLiteral` node should use, given where we are in the AST.
crates/ruff_linter/src/checkers/ast/mod.rs:373
↓ 8 callers
Function
deserialize_fixture
(content: &str)
crates/ruff_server/src/session/options.rs:516
↓ 8 callers
Method
eat_char
(&mut self, c: char)
crates/ruff_python_parser/src/lexer/cursor.rs:104
↓ 8 callers
Function
empty_line
()
crates/ruff_formatter/src/builders.rs:133
↓ 8 callers
Method
enabled
(&self, rule: Rule)
crates/ruff_linter/src/settings/rule_table.rs:27
↓ 8 callers
Method
error
()
crates/ruff_linter/resources/test/fixtures/flake8_raise/RSE102.py:58
↓ 8 callers
Method
error
Return the underlying [`ParseError`].
crates/ruff_linter/src/logging.rs:228
↓ 8 callers
Function
exactly_one_argument_with_matching_function
( name: &str, func: &Expr, args: &'a [Expr], keywords: &[Keyword], )
crates/ruff_linter/src/rules/flake8_comprehensions/helpers.rs:3
↓ 8 callers
Method
execution_context
Return the [`ExecutionContext`] of the current scope.
crates/ruff_python_semantic/src/model.rs:2080
↓ 8 callers
Method
expression_scope_id
(&self, expression: &E)
crates/ty_python_core/src/lib.rs:400
↓ 8 callers
Method
extend
(&mut self, other: Self)
crates/ty_site_packages/src/lib.rs:105
↓ 8 callers
Method
extend_back
(&mut self, elements: &'a [FormatElement])
crates/ruff_formatter/src/printer/queue.rs:105
↓ 8 callers
Function
f
(*args, **kwargs)
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/call.py:4
↓ 8 callers
Function
f
()
crates/ruff_python_parser/resources/valid/other/decorator.py:12
↓ 8 callers
Method
fallback_element_type
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/iteration.rs:491
↓ 8 callers
Method
file_expression_type
Get the type of an expression from any scope in the same file. If the expression is in the current scope, and we are inferring the entire scope, just
crates/ty_python_semantic/src/types/infer/builder.rs:833
↓ 8 callers
Method
finish
Finish the code example by generating any final actions if applicable. This typically adds an action when the end of a code example coincides with th
crates/ruff_python_formatter/src/string/docstring.rs:743
↓ 8 callers
Method
finite_alternative_union
Return the exact finite alternative union represented by this intersection, if available.
crates/ty_python_semantic/src/types/set_theoretic.rs:729
↓ 8 callers
Method
flags
(self)
crates/ty_python_semantic/src/types/literal.rs:104
↓ 8 callers
Method
flush_pending_line
Flushes content buffered for the current line.
crates/ty_ide/src/docstring/markdown/general.rs:306
↓ 8 callers
Method
fmt
(&self, item: &Identifier, f: &mut PyFormatter)
crates/ruff_python_formatter/src/other/identifier.rs:11
↓ 8 callers
Function
format
( document: &TextDocument, source_type: SourceType, formatter_settings: &FormatterSettings, pa
crates/ruff_server/src/format.rs:48
↓ 8 callers
Method
format
(&self)
crates/ruff_python_formatter/src/statement/mod.rs:74
↓ 8 callers
Method
formatted
Converts every item to an object that knows how to format it.
crates/ruff_python_formatter/src/shared_traits.rs:70
↓ 8 callers
Method
freshness
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:887
↓ 8 callers
Method
full_lines_range
Computes the range of all lines that this `range` covers. The range starts at the beginning of the line at `range.start()` and goes up to, and includ
crates/ruff_source_file/src/line_ranges.rs:193
↓ 8 callers
Function
full_range
(input: &str)
crates/ty_server/tests/e2e/code_actions.rs:35
↓ 8 callers
Method
get
Return parameter at given index, or `None` if index is out-of-range.
crates/ty_python_semantic/src/types/signatures.rs:3804
↓ 8 callers
Method
global_scope
Returns a reference to the global [`Scope`].
crates/ruff_python_semantic/src/model.rs:1529
↓ 8 callers
Method
has_typevar_or_typevar_instance
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:69
↓ 8 callers
Method
has_valid_syntax
Returns `true` if the parsed source code is valid i.e., it has no [`ParseError`]s. Note that this does not include version-related [`UnsupportedSynta
crates/ruff_python_parser/src/lib.rs:430
↓ 8 callers
Method
header_range
Returns the range of the `TypedDict` call expression.
crates/ty_python_semantic/src/types/class/typed_dict.rs:872
↓ 8 callers
Method
in_string_type_definition
Return `true` if the model is visiting a "string type definition" that was previously deferred when initially traversing the AST
crates/ruff_python_semantic/src/model.rs:2118
↓ 8 callers
Method
index
(&self)
crates/ruff_source_file/src/lib.rs:200
↓ 8 callers
Function
infer_deferred_types
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer.rs:265
↓ 8 callers
Method
inferable_typevars
Returns the typevars that are inferable in this generic context. This set might include more typevars than the ones directly bound by the generic cont
crates/ty_python_semantic/src/types/generics.rs:462
↓ 8 callers
Method
into_protocol_class
Returns the protocol class if this is a protocol.
crates/ty_python_semantic/src/types/class.rs:861
↓ 8 callers
Method
into_settings
(self, client: Client)
crates/ruff_server/src/session/options.rs:70
↓ 8 callers
Method
into_type_var
(self)
crates/ty_python_semantic/src/types/subclass_of.rs:134
↓ 8 callers
Method
is_
(self, key: Key, flag: int)
crates/ruff_benchmark/resources/tomllib/_parser.py:175
↓ 8 callers
Method
is_bound
(self)
crates/ty_python_core/src/place.rs:133
↓ 8 callers
Function
is_cased_uppercase
Return `true` if a string is _cased_ as uppercase. A string is cased as uppercase if it contains at least one uppercase character and no lowercase ch
crates/ruff_python_stdlib/src/str.rs:129
↓ 8 callers
Method
is_classmethod
Returns true if this overload is decorated with `@classmethod`, or if it is implicitly a classmethod.
crates/ty_python_semantic/src/types/function.rs:342
↓ 8 callers
Method
is_empty
(self)
crates/ruff_formatter/src/printer/mod.rs:958
↓ 8 callers
Method
is_empty
(&self)
crates/ruff_server/src/edit.rs:172
↓ 8 callers
Method
is_empty
(&self)
crates/ty_python_semantic/src/types/constraints.rs:1318
↓ 8 callers
Method
is_empty
(&self)
crates/ruff_linter/src/settings/types.rs:830
↓ 8 callers
Function
is_list
Test whether the given binding can be considered a list. For this, we check what value might be associated with it through it's initialization and wh
crates/ruff_python_semantic/src/analyze/typing.rs:1026
← previous
next →
1,401–1,500 of 27,349, ranked by callers