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
↓ 12 callers
Function
test_helper
(source: &str, members_to_remove: &[&str])
crates/ruff_linter/src/rules/pyupgrade/fixes.rs:75
↓ 12 callers
Method
to_file_path
Returns the corresponding [`AnySystemPath`] for this document key. Note, calling this method on a `DocumentKey::Opaque` representing a cell document
crates/ty_server/src/document.rs:94
↓ 12 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:1208
↓ 12 callers
Method
token_range
(&self)
crates/ruff_python_parser/src/lexer.rs:1421
↓ 12 callers
Method
tokens
(&self)
crates/ruff_python_formatter/src/context.rs:85
↓ 12 callers
Method
try_bool
Resolves the boolean value of a type. This is used to determine the value that would be returned when `bool(x)` is called on an object `x`. Returns
crates/ty_python_semantic/src/types/bool.rs:32
↓ 12 callers
Method
ty
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:494
↓ 12 callers
Method
union
(self, other: TokenSet)
crates/ruff_python_parser/src/token_set.rs:20
↓ 12 callers
Method
verify_builder
(self, builder: &'c ConstraintSetBuilder<'db>)
crates/ty_python_semantic/src/types/constraints.rs:411
↓ 12 callers
Method
when_all
( self, db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, mut f: impl F
crates/ty_python_semantic/src/types/constraints.rs:212
↓ 12 callers
Method
with_default_type
(mut self, default: Type<'db>)
crates/ty_python_semantic/src/types/signatures.rs:4084
↓ 12 callers
Method
with_extension
(&self, extension: &str)
crates/ruff_db/src/system/path.rs:365
↓ 12 callers
Method
with_site_packages
Convert to a builder that supports site-packages (third-party dependencies).
crates/ty_ide/src/lib.rs:611
↓ 12 callers
Method
write
(&self, f: &mut std::fmt::Formatter, start_range: bool)
crates/ruff/src/args.rs:1329
↓ 12 callers
Method
write_element
(&mut self, element: FormatElement)
crates/ruff_formatter/src/buffer.rs:139
↓ 12 callers
Method
write_file
(&self, path: impl AsRef<Path>, content: &str)
crates/ty/tests/cli/main.rs:962
↓ 12 callers
Method
write_project_file
( &self, relative_path: impl AsRef<SystemPath>, content: &str, )
crates/ty/tests/file_watching.rs:307
↓ 11 callers
Method
add_token
( &mut self, ranged: impl Ranged, token_type: SemanticTokenType, modifiers: Se
crates/ty_ide/src/semantic_tokens.rs:224
↓ 11 callers
Method
as_char
(self)
crates/ruff_python_ast/src/str.rs:20
↓ 11 callers
Method
as_char
Get the character used to represent this quote.
crates/ruff_linter/src/rules/flake8_quotes/settings.rs:75
↓ 11 callers
Method
as_notebook
(&self)
crates/ty_server/src/session/index.rs:262
↓ 11 callers
Method
as_ref
(&self)
crates/ruff_db/src/files/path.rs:106
↓ 11 callers
Method
as_typed_dict
(self)
crates/ty_python_semantic/src/types.rs:1644
↓ 11 callers
Function
assert_no_match
(set: &ModuleGlobSet, name: &str)
crates/ty_module_resolver/src/module_glob.rs:380
↓ 11 callers
Method
bindings
(&self)
crates/ty_python_core/src/use_def/place_state.rs:588
↓ 11 callers
Method
build
(self)
crates/ruff_db/src/testing.rs:196
↓ 11 callers
Method
cache_key
(&self, state: &mut CacheKeyHasher)
crates/ruff_cache/src/globset.rs:6
↓ 11 callers
Method
cell
Returns the (raw) cell number (1-based) for the given row (1-based).
crates/ruff_notebook/src/index.rs:29
↓ 11 callers
Method
change_text_document
Send a `textDocument/didChange` notification with the given content changes
crates/ty_server/tests/e2e/main.rs:826
↓ 11 callers
Method
clear
Clear the parsed module, dropping the AST once all references to it are dropped.
crates/ruff_db/src/parsed.rs:153
↓ 11 callers
Method
closer_len
The total length of the string's closer. This is always equal to `self.quote_len()`, except when the string is unclosed, in which case the length is z
crates/ruff_python_ast/src/nodes.rs:847
↓ 11 callers
Method
context
Return the [`LintContext`] for the current analysis. Note that you should always prefer calling methods like `settings`, `report_diagnostic`, or `is_
crates/ruff_linter/src/checkers/ast/mod.rs:665
↓ 11 callers
Method
create_directory_all
Creates a directory at `path`. All enclosing directories are created if they don't exist.
crates/ruff_db/src/system/memory_fs.rs:324
↓ 11 callers
Method
db
(&self)
crates/ty/tests/file_watching.rs:46
↓ 11 callers
Function
enum_metadata
( db: &'db dyn Db, class: ClassLiteral<'db>, )
crates/ty_python_semantic/src/types/enums.rs:920
↓ 11 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:947
↓ 11 callers
Method
file
Returns the `UnifiedFile` attached to this `Span`.
crates/ruff_db/src/diagnostic/mod.rs:1244
↓ 11 callers
Method
file
(self, db: &'db dyn Db)
crates/ty_python_core/src/expression.rs:70
↓ 11 callers
Method
file_path
(&self, path: impl AsRef<SystemPath>)
crates/ty_server/tests/e2e/main.rs:788
↓ 11 callers
Function
file_system
()
crates/ty_vendored/src/lib.rs:18
↓ 11 callers
Method
files
(&self)
crates/ruff_db/src/lib.rs:182
↓ 11 callers
Method
filter_union
If the type is a union (or a type alias that resolves to a union), filters union elements based on the provided predicate. Otherwise, returns the typ
crates/ty_python_semantic/src/types.rs:2024
↓ 11 callers
Method
finish
(self)
crates/ty_python_semantic/src/types/call/bind.rs:4684
↓ 11 callers
Function
global_symbol
( db: &'db dyn Db, file: File, name: &str, )
crates/ty_python_semantic/src/place.rs:498
↓ 11 callers
Method
hide_severity
Whether to hide a diagnostic's severity or not.
crates/ruff_db/src/diagnostic/mod.rs:1528
↓ 11 callers
Method
includes
Returns `true` if the string list of `codes` includes `code` (or an alias thereof).
crates/ruff_linter/src/noqa.rs:121
↓ 11 callers
Method
infer_definition
(&mut self, node: impl Into<DefinitionNodeKey> + std::fmt::Debug + Copy)
crates/ty_python_semantic/src/types/infer/builder.rs:1881
↓ 11 callers
Method
is_assignment
(&self, expr: &Expr)
crates/ruff_linter/src/rules/pylint/helpers.rs:91
↓ 11 callers
Function
is_const_true
Return `true` if an [`Expr`] is a literal `True`.
crates/ruff_python_ast/src/helpers.rs:849
↓ 11 callers
Method
is_empty
(&self)
crates/mdtest/src/matcher.rs:48
↓ 11 callers
Method
is_function_like
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/callable.rs:479
↓ 11 callers
Method
is_implicitly_open
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:115
↓ 11 callers
Method
is_keyword
(self)
crates/ruff_python_ast/src/token.rs:344
↓ 11 callers
Method
is_required
(&self)
crates/ty_python_semantic/src/types/class.rs:2471
↓ 11 callers
Method
is_variadic
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1962
↓ 11 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:358
↓ 11 callers
Method
iter_flat
Returns an iterator over all `CallableBinding`s, flattening the two-level structure. Note: This loses the union/intersection distinction. The returne
crates/ty_python_semantic/src/types/call/bind.rs:730
↓ 11 callers
Method
iter_positive
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/set_theoretic.rs:1043
↓ 11 callers
Method
join_comma_separated
( &'fmt mut self, sequence_end: TextSize, )
crates/ruff_python_formatter/src/builders.rs:73
↓ 11 callers
Method
join_with
Joins the objects by placing the specified separator between every two items. ## Examples Joining different tokens by separating them with a comma a
crates/ruff_formatter/src/formatter.rs:101
↓ 11 callers
Function
known_module_symbol
Lookup the type of `symbol` in a given known module. Returns `Place::Undefined` if the given known module cannot be resolved for some reason.
crates/ty_python_semantic/src/place.rs:618
↓ 11 callers
Method
leading_dangling_trailing
Returns an iterator over the [leading](self#leading-comments), [dangling](self#dangling-comments), and [trailing](self#trailing) comments of `node`.
crates/ruff_python_formatter/src/comments/mod.rs:349
↓ 11 callers
Function
leading_indentation
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:49
↓ 11 callers
Method
len
(&self)
crates/ty_server/src/server/schedule/thread/pool.rs:133
↓ 11 callers
Method
len
(&self)
crates/ruff_server/src/server/schedule/thread/pool.rs:130
↓ 11 callers
Method
mark_formatted
Marks the comment as formatted
crates/ruff_python_formatter/src/comments/mod.rs:146
↓ 11 callers
Method
matches
(self, db: &'db dyn Db, class: ClassLiteral<'db>)
crates/ty_python_semantic/src/types/class.rs:226
↓ 11 callers
Method
next
(&mut self)
crates/ty_project/src/lib.rs:801
↓ 11 callers
Method
next
(&mut self)
crates/ruff_python_semantic/src/analyze/class.rs:99
↓ 11 callers
Method
parent_statement_id
Given a [`NodeId`], return the [`NodeId`] of the parent statement, if any.
crates/ruff_python_semantic/src/model.rs:1647
↓ 11 callers
Function
parenthesized
Formats `content` enclosed by the `left` and `right` parentheses. The implementation also ensures that expanding the parenthesized expression (or any
crates/ruff_python_formatter/src/expression/parentheses.rs:109
↓ 11 callers
Method
permissions
(&self)
crates/ruff_db/src/system.rs:288
↓ 11 callers
Method
pop
(&mut self)
crates/ty_module_resolver/src/path.rs:82
↓ 11 callers
Method
quote
(&self)
crates/ruff_python_codegen/src/stylist.rs:25
↓ 11 callers
Method
range
Returns the range of the configuration setting.
crates/ty_site_packages/src/version.rs:66
↓ 11 callers
Method
report_context
If error context collection is enabled, returns the current error context tree. You will typically use [`push`][ErrorContextTree::push] to add additio
crates/ty_python_semantic/src/types/relation.rs:890
↓ 11 callers
Method
restore
Restore the semantic model to the given [`Snapshot`].
crates/ruff_python_semantic/src/model.rs:2064
↓ 11 callers
Method
revision
(&self)
crates/ruff_db/src/system.rs:284
↓ 11 callers
Method
run
(self, username)
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S602.py:34
↓ 11 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/ruff_server/src/session/client.rs:215
↓ 11 callers
Method
slice
Returns the location of the comment in the original source code. Allows retrieving the text of the comment.
crates/ruff_python_formatter/src/comments/mod.rs:137
↓ 11 callers
Method
subtypes
(&self)
crates/ty_ide/src/type_hierarchy.rs:722
↓ 11 callers
Method
take_snapshot
Creates a document snapshot with the URI referencing the document to snapshot.
crates/ruff_server/src/session.rs:97
↓ 11 callers
Function
test_resource_path
(path: impl AsRef<Path>)
crates/ruff_linter/src/test.rs:121
↓ 11 callers
Method
text_len
(&self)
crates/ruff_python_parser/src/lexer/cursor.rs:66
↓ 11 callers
Method
to_intersection
Reconstruct the equivalent set-theoretic intersection.
crates/ty_python_semantic/src/types/enums.rs:842
↓ 11 callers
Method
to_location
Converts this range into an LSP location. Returns `None` if the URI for this file couldn't be resolved.
crates/ty_server/src/document/range.rs:40
↓ 11 callers
Method
to_text_size
( self, text: &str, index: &LineIndex, position_encoding: PositionEncoding,
crates/ty_wasm/src/lib.rs:1159
↓ 11 callers
Method
token_len
(&self)
crates/ruff_python_trivia/src/cursor.rs:68
↓ 11 callers
Method
with_definition
Create a new signature with the given definition.
crates/ty_python_semantic/src/types/signatures.rs:1384
↓ 11 callers
Method
with_preview_mode
(mut self)
crates/ruff_linter/src/settings/mod.rs:880
↓ 11 callers
Method
with_quote_style
(mut self, quote_style: Quote)
crates/ruff_python_ast/src/nodes.rs:953
↓ 11 callers
Method
write
(&mut self, buf: &[u8])
crates/ruff_db/src/diagnostic/render/junit.rs:174
↓ 10 callers
Method
absolute
Resolves the absolute path for `self` based on its origin.
crates/ty_project/src/metadata/value.rs:76
↓ 10 callers
Method
add
(&mut self, line_range: TextRange)
crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs:563
↓ 10 callers
Method
add_and_constraint
( &mut self, a: ScopedNarrowingConstraint, b: ScopedNarrowingConstraint, )
crates/ty_python_core/src/narrowing_constraints.rs:332
↓ 10 callers
Method
as_str
Returns the string representation of the quote style.
crates/ruff_python_formatter/src/options.rs:278
↓ 10 callers
Function
assert_notebook_path
( path: impl AsRef<Path>, expected: impl AsRef<Path>, settings: &LinterSettings, )
crates/ruff_linter/src/test.rs:169
↓ 10 callers
Method
attach_to
Render the error context tree as info sub-diagnostics on `diag`.
crates/ty_python_semantic/src/types/relation_error.rs:536
↓ 10 callers
Function
before_main
()
crates/ruff_wasm/src/lib.rs:206
← previous
next →
1,101–1,200 of 27,349, ranked by callers