Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,562 in github.com/astral-sh/ruff
⨍
Functions
31,562
◇
Types & classes
7,116
↳
Endpoints
82
↓ 2 callers
Method
leave_node
(&mut self, node: AnyNodeRef<'ast>)
crates/ruff_python_formatter/src/range.rs:240
↓ 2 callers
Method
legacy_aliases
(&self)
crates/ty_python_semantic/src/types/infer.rs:393
↓ 2 callers
Method
legacy_generic_context
Returns the generic context from the first subscripted `Generic` or `Protocol` base. Returns `None` if no such base exists or the first such base int
crates/ty_python_semantic/src/types/class/static_literal.rs:460
↓ 2 callers
Function
legacy_type_alias_definition
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:64
↓ 2 callers
Function
legacy_type_alias_parameters
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:420
↓ 2 callers
Method
legacy_type_alias_reference
( &mut self, value_ty: Type<'db>, definition: Option<Definition<'db>>, referen
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:61
↓ 2 callers
Method
len
(&self)
crates/ty_python_semantic/src/types/abstract_methods.rs:238
↓ 2 callers
Method
len
(&self)
crates/ruff_linter/src/directives.rs:363
↓ 2 callers
Method
lex_codes
(&mut self)
crates/ruff_linter/src/noqa.rs:579
↓ 2 callers
Method
lex_decimal_number
Lex a normal number, that is, no octal, hex or binary number.
crates/ruff_python_parser/src/lexer.rs:1023
↓ 2 callers
Method
lex_directive
Collect codes in `noqa` comment.
crates/ruff_linter/src/noqa.rs:531
↓ 2 callers
Function
lex_jupyter_source
(source: &str)
crates/ruff_python_parser/src/lexer.rs:1810
↓ 2 callers
Method
lex_string
Lex a string literal.
crates/ruff_python_parser/src/lexer.rs:873
↓ 2 callers
Method
lex_unicode_identifier
Continues from the cursor after the identifier's first non-ASCII character.
crates/ruff_python_parser/src/lexer.rs:684
↓ 2 callers
Function
lexical_name_path_component_for_node
Computes a lexical name path component for an enclosing scope. See [`lexical_name_path_for_definition`][] for details.
crates/ty_python_semantic/src/lexical_name_path.rs:51
↓ 2 callers
Function
lexical_name_path_for_definition
Returns the module-relative lexical name path to `definition`. For example, the path to `method` here is `["Outer", "method"]`: ```python class Outer
crates/ty_python_semantic/src/lexical_name_path.rs:17
↓ 2 callers
Method
limit_tuple_addition_result
Bound tuple alternatives produced by addition while preserving other operator results.
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:108
↓ 2 callers
Method
line_column
Returns the line and column number for an UTF-8 byte offset. The `column` number is the nth-character of the line, except for the first line where it
crates/ruff_source_file/src/line_index.rs:117
↓ 2 callers
Function
line_number
(char_index: TextSize, source: &str)
crates/mdtest/src/parser.rs:1069
↓ 2 callers
Function
line_start
(tokens: &ruff_python_ast::token::Tokens, offset: TextSize)
crates/ty_python_semantic/src/suppression/add_ignore.rs:222
↓ 2 callers
Method
line_start
Returns the [byte offset](TextSize) for the `line` with the given index.
crates/ruff_source_file/src/line_index.rs:261
↓ 2 callers
Method
line_width
(&self)
crates/ruff_formatter/src/lib.rs:268
↓ 2 callers
Method
line_width
(&self)
crates/ruff_formatter/src/format_element/document.rs:242
↓ 2 callers
Method
lineno_offset
Add an offset used for aligning the header sigil (`-->`) with the line number separators. For normal diagnostics this is computed automatically based
crates/ruff_annotate_snippets/src/snippet.rs:104
↓ 2 callers
Function
lint_documentation_url
(lint_name: LintName)
crates/ty_python_semantic/src/lint.rs:147
↓ 2 callers
Function
lint_path
Lint the source code at the given `Path`.
crates/ruff/src/diagnostics.rs:182
↓ 2 callers
Method
lint_registry
(&self)
crates/ty_test/src/db.rs:166
↓ 2 callers
Method
lint_registry
(&self)
crates/ty_python_semantic/src/db.rs:195
↓ 2 callers
Method
lint_unmerged
Lint options from one source, such as `ty.toml`, `pyproject.toml`, CLI arguments, or editor settings. When resolving project settings, lint each sour
crates/ty_project/src/metadata/options.rs:593
↓ 2 callers
Function
list_alias
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, argument: Type<'db>, )
crates/ty_python_semantic/src/types/tests.rs:287
↓ 2 callers
Function
list_root_modules
( db: &'db dyn Db, resolver_environment: ResolverEnvironment<'db>, )
crates/ty_module_resolver/src/resolve/search.rs:67
↓ 2 callers
Function
literal_fallthrough_prelude
(guarded_any: bool)
crates/ruff_benchmark/benches/ty.rs:1846
↓ 2 callers
Function
literal_match_fallthrough_code
(guarded_any: bool)
crates/ruff_benchmark/benches/ty.rs:1889
↓ 2 callers
Function
literal_sequence
Describes literal positions for both inference and diagnostics. A starred literal is expanded recursively; other starred expressions contribute the sh
crates/ty_python_semantic/src/types/unpacker.rs:620
↓ 2 callers
Function
literal_sequence_elements
( expression: &ast::Expr, promote: bool, )
crates/ty_python_semantic/src/types/unpacker.rs:642
↓ 2 callers
Function
load
Parse TOML from a binary file object.
crates/ruff_benchmark/resources/tomllib/_parser.py:57
↓ 2 callers
Function
load_reports_from_directory
Load all JSON memory reports from a directory.
scripts/memory_report.py:144
↓ 2 callers
Method
load_with_provenance
Loads an owned constraint set, replacing the provenance of every constraint.
crates/ty_python_semantic/src/types/constraints.rs:1270
↓ 2 callers
Method
local_functions
Recover source methods for a class member, including retained property accessors. The exposed type and the source functions serve different purposes:
crates/ty_python_semantic/src/types/list_members.rs:817
↓ 2 callers
Method
local_functions_from_type
Recover local functions retained in the exposed type, including aliases and property accessors. Unlike [`Self::local_functions`], this does not recove
crates/ty_python_semantic/src/types/list_members.rs:774
↓ 2 callers
Method
local_position
Returns the position within this document. Only use [`Self::local_position`] when you already have a URI context and this position is guaranteed to b
crates/ty_server/src/document/range.rs:72
↓ 2 callers
Method
local_symbol
(self, name: &str)
crates/ty_python_semantic/src/place_load.rs:1153
↓ 2 callers
Function
locate_cmp_ops
Extract all [`CmpOp`] operators from an expression snippet, with appropriate ranges. This method iterates over the token stream and re-identifies [`C
crates/ruff_linter/src/rules/pyflakes/rules/invalid_literal_comparisons.rs:140
↓ 2 callers
Function
location_link_from_navigation_target
( target: &NavigationTarget, db: &dyn Db, position_encoding: PositionEncoding, source_range: O
crates/ty_wasm/src/lib.rs:1319
↓ 2 callers
Function
logical_line
Return the index of the first logical line in a string.
crates/ruff_linter/src/rules/pydocstyle/helpers.rs:15
↓ 2 callers
Function
logical_line_end
Returns the end of the logical line at `offset`, including its newline. A trailing backslash can extend the line beyond its last AST node's physical l
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1638
↓ 2 callers
Method
lookup_attribute_in_scope
Lookup a qualified attribute in the certain scope.
crates/ruff_python_semantic/src/model.rs:1103
↓ 2 callers
Method
lookup_class_literal
Look up a [`KnownClass`] in its canonical module. Lookup errors are logged when the cached query executes.
crates/ty_python_semantic/src/types/class/known.rs:1385
↓ 2 callers
Method
lookup_dunder_new
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, policy: MemberLookupPo
crates/ty_python_semantic/src/types.rs:4449
↓ 2 callers
Function
lookup_member_on_union_element
Callers pass each union alternative as `element`. If a receiver is provided, this function intersects it with `element` before looking up the member.
crates/ty_python_semantic/src/types.rs:1210
↓ 2 callers
Function
lookup_override_member
Look up `__new__` on the class so generated and decorated callables retain `cls` until they are bound for the override comparison. Hashing ignores ins
crates/ty_python_semantic/src/types/overrides.rs:1404
↓ 2 callers
Method
lower_bound_for
( self, db: &'db dyn Db, bound_typevar: BoundTypeVarInstance<'db>, )
crates/ty_python_semantic/src/types/constraints/variables.rs:601
↓ 2 callers
Function
lsp_position_to_text_size
Helper function to convert an LSP Position to internal `TextSize`. This is used internally by the `PositionExt` trait and other helpers.
crates/ty_server/src/document/range.rs:274
↓ 2 callers
Function
make_context
(path: Option<&Path>)
crates/ruff_unicode_names2_generator/src/lib.rs:376
↓ 2 callers
Method
make_python_source_kind
Generate a Python source kind used by the linter.
crates/ruff_server/src/session/index.rs:565
↓ 2 callers
Method
mapLocation
( location: DiagnosticLocation, )
playground/ty/src/Editor/Editor.tsx:990
↓ 2 callers
Method
mapNavigationTarget
(link: LocationLink)
playground/ty/src/Editor/Editor.tsx:957
↓ 2 callers
Method
map_argument_indices
Rewrites every stored argument index with the provided mapping function. This supports both simple offsets and sparse sub-call remapping. For a forwa
crates/ty_python_semantic/src/types/call/bind.rs:10341
↓ 2 callers
Method
map_definition_to_source
( &self, def: &ResolvedDefinition<'db>, )
crates/ty_ide/src/stub_mapping.rs:41
↓ 2 callers
Method
map_definitions
Map multiple `ResolvedDefinitions`, applying stub-to-source mapping to each. This is a convenience method that applies `map_definition` to each eleme
crates/ty_ide/src/stub_mapping.rs:52
↓ 2 callers
Method
map_flags
(self, func: impl FnOnce(LiteralFlags) -> LiteralFlags)
crates/ty_python_semantic/src/types/literal.rs:118
↓ 2 callers
Method
map_signatures
Transforms the public overloads and any separate implementation signatures.
crates/ty_python_semantic/src/types/function.rs:1360
↓ 2 callers
Function
map_system_to_vendored
Maps an absolute system path to a vendored path. This is useful for normalizing file paths received from the LSP. Namely, the LSP might include a *sy
crates/ty_ide/src/lib.rs:398
↓ 2 callers
Method
map_type
(self, f: impl FnOnce(Type<'db>) -> Type<'db>)
crates/ty_python_semantic/src/types/signatures.rs:6543
↓ 2 callers
Method
map_values
(&mut self, mut map: F)
crates/ty_python_core/src/frozen.rs:214
↓ 2 callers
Method
map_with
(self, f: &F)
crates/ty_python_semantic/src/types/call/bind.rs:1287
↓ 2 callers
Method
map_with_boundness
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, mut transform_fn: impl
crates/ty_python_semantic/src/types/set_theoretic.rs:546
↓ 2 callers
Method
mapping_pattern_arm
( &self, subject_ty: Type<'db>, key_types: &[Type<'db>], )
crates/ty_python_semantic/src/types/narrow.rs:2960
↓ 2 callers
Method
mapping_pattern_key_types
(&self, kind: &MappingPatternPredicateKind<'db>)
crates/ty_python_semantic/src/types/narrow.rs:2952
↓ 2 callers
Method
mark_as_unmatched_overload
Mark this overload binding as an unmatched overload.
crates/ty_python_semantic/src/types/call/bind.rs:9633
↓ 2 callers
Method
mark_constraint_used
( &mut self, storage: &mut ConstraintSetStorage<'_>, constraint: ConstraintId, )
crates/ty_python_semantic/src/types/constraints/owned.rs:60
↓ 2 callers
Method
mark_declared
(&mut self, id: ScopedPlaceId)
crates/ty_python_core/src/place.rs:453
↓ 2 callers
Method
mark_formatted
(&self)
crates/ruff_python_formatter/src/statement/stmt_assign.rs:1199
↓ 2 callers
Method
mark_symbol_used
(&mut self, id: ScopedSymbolId)
crates/ty_python_core/src/builder.rs:1403
↓ 2 callers
Method
mark_unformatted
Marks the comment as not-formatted
crates/ruff_python_formatter/src/comments/mod.rs:151
↓ 2 callers
Function
markdown_details
( summary: str, content: str | list[str], preface: str | None )
python/ruff-ecosystem/ruff_ecosystem/markdown.py:31
↓ 2 callers
Function
markdown_project_section
( title: str, content: str | list[str], options: CommandOptions, project: Project )
python/ruff-ecosystem/ruff_ecosystem/markdown.py:9
↓ 2 callers
Function
match_aliases
( names: &'a mut ImportNames<'b>, )
crates/ruff_linter/src/cst/matchers.rs:59
↓ 2 callers
Function
match_continuation
If the next token is a continuation (`\`), return its offset.
crates/ruff_python_importer/src/insertion.rs:381
↓ 2 callers
Method
match_event
(&mut self, event: &ChangeEvent)
crates/ty/tests/file_watching.rs:337
↓ 2 callers
Function
match_file
( db: &dyn Db, file: File, python_version: PythonVersion, diagnostics: &[Diagnostic], opti
crates/mdtest/src/matcher.rs:95
↓ 2 callers
Method
match_file
Returns `true` if the path to a file is definitely excluded and `false` otherwise.
crates/ty_project/src/glob/exclude.rs:38
↓ 2 callers
Function
match_import_from
( statement: &'a mut Statement<'b>, )
crates/ruff_linter/src/cst/matchers.rs:38
↓ 2 callers
Method
match_included_paths
( &self, path: &SystemPath, mode: GlobFilterCheckMode, )
crates/ty_project/src/walk.rs:43
↓ 2 callers
Method
match_keyword
( &mut self, argument_index: usize, argument: Argument<'a>, argument_type: Opt
crates/ty_python_semantic/src/types/call/bind.rs:5234
↓ 2 callers
Function
match_open_keywords
Match keyword arguments. Return keyword arguments to forward and mode.
crates/ruff_linter/src/rules/refurb/helpers.rs:362
↓ 2 callers
Method
match_parameters_in_place
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, arguments: &CallA
crates/ty_python_semantic/src/types/call/bind.rs:1343
↓ 2 callers
Method
match_pattern_subject_arms
Pair each original subject type with the union members used to test the pattern. An upper-bounded type variable uses its bound for matching, but each
crates/ty_python_semantic/src/types/narrow.rs:3445
↓ 2 callers
Method
match_positional
( &mut self, argument_index: usize, argument: Argument<'a>, argument_type: Opt
crates/ty_python_semantic/src/types/call/bind.rs:5200
↓ 2 callers
Function
match_semicolon
If the next token is a semicolon, return its offset.
crates/ruff_python_importer/src/insertion.rs:369
↓ 2 callers
Function
match_subject_place_expressions
Return the expressions whose existing bindings a match pattern can narrow. In addition to the subject itself, matching an attribute or subscript can
crates/ty_python_core/src/place.rs:26
↓ 2 callers
Function
match_tuple
(expression: &'a Expression<'b>)
crates/ruff_linter/src/cst/matchers.rs:133
↓ 2 callers
Function
match_value
Given a target and value, find the value that's assigned to the given symbol.
crates/ruff_python_semantic/src/analyze/typing.rs:1289
↓ 2 callers
Method
match_value_pattern_subject_type
Return the type of the subject when a value pattern succeeds. A value pattern uses Python equality, so a successful match does not always narrow to t
crates/ty_python_semantic/src/types/narrow.rs:2408
↓ 2 callers
Method
matched
Returns whether the given path (file or directory) matched a pattern in this gitignore matcher. `is_dir` should be true if the path refers to a direc
crates/ty_project/src/glob/exclude.rs:135
↓ 2 callers
Method
matched_argument_for_call_argument
Returns the matched-argument entry for a source call argument. [`CallableBinding`] prepends a synthetic bound receiver before matching bound methods,
crates/ty_python_semantic/src/types/call/bind.rs:8668
↓ 2 callers
Method
matches
(&self, path: &SystemPath, mode: GlobFilterCheckMode, directory: bool)
crates/ty_project/src/glob/exclude.rs:42
↓ 2 callers
Method
matches
Returns true when this answer matches the completion given.
crates/ty_completion_eval/src/main.rs:512
↓ 2 callers
Method
matches
(self, actual: i128, expected: i64)
crates/ty_python_semantic/src/types/narrow.rs:1663
↓ 2 callers
Method
matches
(self, db: &'db dyn Db, class: ClassLiteral<'db>)
crates/ty_python_semantic/src/types/class.rs:296
← previous
next →
6,301–6,400 of 31,562, ranked by callers