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
↓ 1 callers
Function
single_string_slots
PLC0205
crates/ruff_linter/src/rules/pylint/rules/single_string_slots.rs:63
↓ 1 callers
Method
single_symbol_snapshot
Snapshot the state of a single symbol and all of its associated members, at the current point in control flow. This is only used for `*`-import reach
crates/ty_python_core/src/use_def.rs:2616
↓ 1 callers
Function
singledispatch_method
PLE1519
crates/ruff_linter/src/rules/pylint/rules/singledispatch_method.rs:72
↓ 1 callers
Function
singledispatchmethod_function
PLE1520
crates/ruff_linter/src/rules/pylint/rules/singledispatchmethod_function.rs:62
↓ 1 callers
Method
singleton
Return the sole binding and declaration if they share a reachability constraint and the place has no separate narrowing constraint for an unbound name
crates/ty_python_core/src/use_def/place_state.rs:701
↓ 1 callers
Method
singleton_merge_inputs
Return each branch's constraints if both branches retain the same binding and declaration. Different places can reuse the merged constraints when thes
crates/ty_python_core/src/use_def/place_state.rs:725
↓ 1 callers
Method
singleton_type
Reconstruct the only declared member left in this set. The caller must separately establish that the domain is closed before treating this as the ope
crates/ty_python_semantic/src/types/equality/enums.rs:667
↓ 1 callers
Function
size
(x: u32)
crates/ruff_text_size/tests/serde.rs:7
↓ 1 callers
Method
size_hint
(&self)
crates/ruff_unicode_names2/src/lib.rs:177
↓ 1 callers
Function
skip_comments_and_array_ws
(src: str, pos: Pos)
crates/ruff_benchmark/resources/tomllib/_parser.py:275
↓ 1 callers
Method
skip_dunders
When set, dunder completions are skipped. This is useful to reduce noise for snapshot tests when filtering on methods and attributes. Not enabled by
crates/ty_ide/src/completion.rs:11656
↓ 1 callers
Method
skip_non_global_scopes
Returns `true` if `symbol_id` should be looked up in the global scope, skipping intervening local scopes.
crates/ty_python_semantic/src/types/infer/builder.rs:1836
↓ 1 callers
Method
skip_non_newline_whitespace
(&mut self)
crates/mdtest/src/parser.rs:565
↓ 1 callers
Method
skip_to_beginning_of_next_line
(&mut self)
crates/mdtest/src/parser.rs:569
↓ 1 callers
Method
skip_to_end
Skips to the end of the input stream.
crates/ruff_python_parser/src/lexer/cursor.rs:175
↓ 1 callers
Method
skip_until_after_pivot
Skips elements in the MRO up to and including the pivot class. If the pivot class is a dynamic type, its MRO can't be determined, so we fall back to
crates/ty_python_semantic/src/types/bound_super.rs:907
↓ 1 callers
Method
skip_whitespace
(&mut self)
crates/ruff_python_parser/src/lexer.rs:354
↓ 1 callers
Method
skip_whitespace
Consume characters in the assertion comment until we find a non-whitespace character
crates/mdtest/src/assertion.rs:403
↓ 1 callers
Method
skips_non_global_scopes
(self, symbol: ScopedSymbolId)
crates/ty_python_semantic/src/place_load.rs:1309
↓ 1 callers
Method
slice
(self, range: TextRange)
crates/ruff_formatter/src/source_code.rs:17
↓ 1 callers
Method
slice_back
( &'a self, db: &'db dyn Db, env: &'a ProgramEnvironment<'db>, start: usize,
crates/ty_python_semantic/src/types/tuple.rs:1638
↓ 1 callers
Function
slice_copy
FURB145
crates/ruff_linter/src/rules/refurb/rules/slice_copy.rs:62
↓ 1 callers
Function
slice_expr_to_slice_call
Convert the slice expression to the string representation of `slice` call. For example, expression `1:2` will be `slice(1, 2)`, and `:` will be `slice
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:229
↓ 1 callers
Method
slice_fixed_position
( &'a self, db: &'db dyn Db, env: &'a ProgramEnvironment<'db>, slice: FixedPos
crates/ty_python_semantic/src/types/tuple.rs:1589
↓ 1 callers
Method
slice_front_forward
( &'a self, db: &'db dyn Db, env: &'a ProgramEnvironment<'db>, start: usize,
crates/ty_python_semantic/src/types/tuple.rs:1614
↓ 1 callers
Method
slice_literal
If this is a specialized instance of `slice`, returns a [`SliceLiteral`] describing it. Otherwise returns `None`. The specialization must be one in w
crates/ty_python_semantic/src/types/instance.rs:351
↓ 1 callers
Function
slice_minus_1_date
Returns `Some` if this is a subscript with the form `date[:-1] + "-00"`.
crates/ruff_linter/src/rules/refurb/rules/fromisoformat_replace_z.rs:245
↓ 1 callers
Method
slice_range
(self, source_range: TextRange, source: &str)
crates/ruff_formatter/src/lib.rs:456
↓ 1 callers
Function
slice_shift_choseong
(name: &[u8])
crates/ruff_unicode_names2/src/jamo.rs:43
↓ 1 callers
Function
slice_shift_jongseong
(name: &[u8])
crates/ruff_unicode_names2/src/jamo.rs:124
↓ 1 callers
Function
slice_shift_jungseong
(name: &[u8])
crates/ruff_unicode_names2/src/jamo.rs:77
↓ 1 callers
Function
slice_to_remove_affix_expr
FURB188
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:77
↓ 1 callers
Function
slice_to_remove_affix_stmt
FURB188
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:112
↓ 1 callers
Function
slots_attributes
Return an iterator over the attributes enumerated in the given `__slots__` value. If an attribute can't be statically determined, it will be `None`.
crates/ruff_linter/src/rules/pylint/rules/non_slot_assignment.rs:264
↓ 1 callers
Function
slots_attributes
(expr: &Expr)
crates/ruff_linter/src/rules/pylint/rules/redefined_slots_in_subclass.rs:170
↓ 1 callers
Function
smallest_type
Figure out whether we need `u8` (1 byte), `u16` (2 bytes) or `u32` (4 bytes) to store all numbers. Returns the number of bytes
crates/ruff_unicode_names2_generator/src/util.rs:3
↓ 1 callers
Function
smallest_u
(x: I)
crates/ruff_unicode_names2_generator/src/util.rs:13
↓ 1 callers
Function
snake_case
Convert from PascalCase to snake_case.
scripts/add_rule.py:63
↓ 1 callers
Function
snake_case_type_alias
PYI042
crates/ruff_linter/src/rules/flake8_pyi/rules/type_alias_naming.rs:113
↓ 1 callers
Function
snapshot
(content: &str, member: &str)
crates/ruff_python_importer/src/insertion.rs:595
↓ 1 callers
Method
snapshot
Returns a representation of this cursor that can be cached with Salsa.
crates/ty_module_resolver/src/resolve/search.rs:306
↓ 1 callers
Method
snapshot
(&self)
crates/ruff_formatter/src/buffer.rs:159
↓ 1 callers
Method
snapshot
(&self)
crates/ruff_formatter/src/formatter.rs:245
↓ 1 callers
Method
snapshot
Take a snapshot of the current visible-places state.
crates/ty_python_core/src/use_def.rs:3162
↓ 1 callers
Method
snapshot
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:9675
↓ 1 callers
Method
snapshot_filter
( &mut self, pattern: impl Into<String>, replacement: impl Into<String>,
crates/ty_ide/src/lib.rs:604
↓ 1 callers
Method
snapshot_session
Creates a snapshot of the current state of the [`Session`].
crates/ty_server/src/session.rs:1284
↓ 1 callers
Function
snmp_insecure_version
S508
crates/ruff_linter/src/rules/flake8_bandit/rules/snmp_insecure_version.rs:47
↓ 1 callers
Function
snmp_weak_cryptography
S509
crates/ruff_linter/src/rules/flake8_bandit/rules/snmp_weak_cryptography.rs:46
↓ 1 callers
Function
soft_block_indent
(content: &impl Format<Context>)
crates/ruff_formatter/src/builders.rs:1116
↓ 1 callers
Method
solution
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/variance/equations.rs:245
↓ 1 callers
Method
solve
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, builder: &ConstraintS
crates/ty_python_semantic/src/types/constraints.rs:4070
↓ 1 callers
Method
solve_for_argument_context
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, builder: &ConstraintS
crates/ty_python_semantic/src/types/constraints.rs:4081
↓ 1 callers
Method
solve_legacy
Solve the collected constraints, consuming the builder before argument validation. `preferred_type_mappings` contains choices from the expected resul
crates/ty_python_semantic/src/types/call/bind.rs:7206
↓ 1 callers
Function
some_codes_are_invalid_diagnostic
( codes: &Codes, invalid_code: &Code, locator: &Locator, context: &LintContext, )
crates/ruff_linter/src/rules/ruff/rules/invalid_rule_code.rs:162
↓ 1 callers
Function
some_dependency_check
()
crates/ruff_linter/resources/test/fixtures/pyflakes/F401_16.py:6
↓ 1 callers
Function
something_else
()
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B017_0.py:12
↓ 1 callers
Function
sometimes_breaks
Returns `true` if the body may break via a `break` statement.
crates/ruff_python_semantic/src/analyze/terminal.rs:290
↓ 1 callers
Function
sort_and_deduplicate
Sorts entries by key and removes duplicate keys, retaining the last value for each key. Stable sorting preserves the input order of equal-key entries
crates/ty_python_core/src/frozen.rs:153
↓ 1 callers
Function
sort_dunder_all_ann_assign
Sort an `__all__` definition represented by a `StmtAnnAssign` AST node. For example: `__all__: list[str] = ["b", "c", "a"]`.
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:164
↓ 1 callers
Function
sort_dunder_all_assign
Sort an `__all__` definition represented by a `StmtAssign` AST node. For example: `__all__ = ["b", "c", "a"]`.
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:120
↓ 1 callers
Function
sort_dunder_all_aug_assign
Sort an `__all__` mutation represented by a `StmtAugAssign` AST node. For example: `__all__ += ["b", "c", "a"]`.
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:131
↓ 1 callers
Function
sort_dunder_all_extend_call
Sort a tuple or list passed to `__all__.extend()`.
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_all.rs:138
↓ 1 callers
Function
sort_dunder_slots
RUF023 Sort a tuple, list, dict or set that defines `__slots__` in a class scope. This routine checks whether the display is sorted, and emits a viol
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_slots.rs:116
↓ 1 callers
Method
sort_key
Sort by source range, breaking ties by the current rule name.
crates/ty_project/src/baseline.rs:406
↓ 1 callers
Method
sort_key
Returns the candidate's precedence tier in the typing specification's module-resolution order. The resolver's stable sort preserves search-path order
crates/ty_module_resolver/src/resolve.rs:1271
↓ 1 callers
Function
sort_single_line_elements_dict
Create a string representing a fixed-up single-line definition of a `__slots__` dictionary that can be inserted into the source code as a `range_repla
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_slots.rs:383
↓ 1 callers
Function
sorted_list
(db: &TestDb)
crates/ty_module_resolver/src/list.rs:52
↓ 1 callers
Function
sorted_min_max
FURB192
crates/ruff_linter/src/rules/refurb/rules/sorted_min_max.rs:89
↓ 1 callers
Method
source
(&self)
crates/ruff_python_parser/src/error.rs:26
↓ 1 callers
Method
source
(&self)
crates/ruff_linter/src/rule_selector.rs:65
↓ 1 callers
Method
source_binding
Returns the binding from which this exposure was imported, if any.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:776
↓ 1 callers
Method
source_code
(&self)
crates/ruff_formatter/src/format_element/document.rs:225
↓ 1 callers
Method
source_code
(&self)
crates/ruff_python_formatter/src/context.rs:138
↓ 1 callers
Method
source_len
(&self)
crates/ruff_python_literal/src/escape.rs:441
↓ 1 callers
Method
source_location
Given a UTF-8 byte offset, returns the line and character offset according to the given encoding. ### BOM handling Unlike [`Self::line_column`], thi
crates/ruff_source_file/src/line_index.rs:173
↓ 1 callers
Function
source_method_contract
Returns a source-defined method bound to the class whose MRO is being checked.
crates/ty_python_semantic/src/types/overrides.rs:625
↓ 1 callers
Method
source_parameters
Returns `None` if two formal parameters share an identity, since their flows could not be distinguished.
crates/ty_python_semantic/src/types/cyclic.rs:337
↓ 1 callers
Function
source_scopes_for_lexical_path
( db: &'db dyn Db, source_file: ProgramFile<'db>, path: Box<[Name]>, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1228
↓ 1 callers
Function
space_after_comma
E241, E242
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs:273
↓ 1 callers
Function
space_around_operator
E221, E222, E223, E224
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs:206
↓ 1 callers
Method
spawn
(&self, priority: ThreadPriority, f: F)
crates/ty_server/src/server/schedule/thread/pool.rs:114
↓ 1 callers
Method
spawn
(&self, priority: ThreadPriority, f: F)
crates/ruff_server/src/server/schedule/thread/pool.rs:111
↓ 1 callers
Function
spawn_main_loop
The event loop thread is actually a secondary thread that we spawn from the _actual_ main thread. This secondary thread has a larger stack size than s
crates/ty_server/src/server/schedule.rs:21
↓ 1 callers
Function
spawn_main_loop
The event loop thread is actually a secondary thread that we spawn from the _actual_ main thread. This secondary thread has a larger stack size than s
crates/ruff_server/src/server/schedule.rs:19
↓ 1 callers
Method
special_first_method_parameter_type
Special case for unannotated `cls` and `self` arguments to class methods and instance methods.
crates/ty_python_semantic/src/types/infer/builder/function.rs:1286
↓ 1 callers
Function
specialize_alias_body
( db: &'db dyn Db, specialization: Specialization<'db>, value: Type<'db>, )
crates/ty_python_semantic/src/types/type_alias.rs:490
↓ 1 callers
Method
specialize_for_partial_application
Specializes a partial's full signature before matching its bound arguments again.
crates/ty_python_semantic/src/types/signatures.rs:2189
↓ 1 callers
Method
specialize_from_types_recursive
Builds a specialization and recursively resolves references between the chosen types.
crates/ty_python_semantic/src/types/generics.rs:1052
↓ 1 callers
Function
specialize_generic_class_for_subject
Infer a generic subclass specialization from a specialized base class. For example, if `target_class` is `list` and `subject_class` is `Sequence[int]
crates/ty_python_semantic/src/types/narrow.rs:1017
↓ 1 callers
Method
specialize_generic_class_from_callable_context
( &self, class: ClassLiteral<'db>, target: Type<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:7009
↓ 1 callers
Method
specialize_generic_class_from_context
Specialize a bare generic class value based on type context. This allows `list` to be specialized to `list[str]` given the type context `type[list[st
crates/ty_python_semantic/src/types/infer/builder.rs:7150
↓ 1 callers
Function
specialize_narrowing_target
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, subject: Type<'db>, target: Type<'db>, )
crates/ty_python_semantic/src/types/narrow.rs:938
↓ 1 callers
Function
specialize_narrowing_target_from_intersection
Combine the constraints contributed by multiple specialized bases in an intersection. For example, if `Both[L, R]` inherits from `Left[L]` and `Right
crates/ty_python_semantic/src/types/narrow.rs:886
↓ 1 callers
Method
splice_lines
( &'a self, mut patches: Vec<Patch<'b>>, fold: bool, )
crates/ruff_annotate_snippets/src/renderer/source_map.rs:406
↓ 1 callers
Function
split
(hash: u64)
crates/ruff_unicode_names2_generator/src/phf.rs:23
↓ 1 callers
Function
split
(hash: u64)
crates/ruff_unicode_names2/src/lib.rs:276
↓ 1 callers
Function
split_by_forced_separate
Split the import block into multiple blocks, where the first block is the imports that are not matched by any of the patterns in `forced_separate`, an
crates/ruff_linter/src/rules/isort/split.rs:20
↓ 1 callers
Function
split_default
(str_value: &StringLiteralValue, max_split: i32, method: Method)
crates/ruff_linter/src/rules/flake8_simplify/rules/split_static_string.rs:196
↓ 1 callers
Function
split_imports
Generate a [`Fix`] to split the imports across multiple statements.
crates/ruff_linter/src/rules/pycodestyle/rules/multiple_imports_on_one_line.rs:66
← previous
next →
13,201–13,300 of 31,562, ranked by callers