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
Function
run_executable
Run a command with a five-second timeout and classify its outcome. Return `Success` with the elapsed time for exit codes in `successful_exit_
python/py-fuzzer/fuzz.py:104
↓ 2 callers
Function
run_test
( db: &mut db::Db, fixture_paths: FixturePaths<'_>, test: &parser::MarkdownTest<'_, '_, MarkdownTe
crates/ty_test/src/lib.rs:90
↓ 2 callers
Method
same_branch
Returns `true` if `left` and `right` are in the same branches of an `if`, `match`, or `try` statement. This implementation assumes that the statement
crates/ruff_python_semantic/src/model.rs:1891
↓ 2 callers
Function
same_enum_comparison_profile
( db: &'db dyn Db, enum_class: EnumClassLiteral<'db>, operator: ComparisonOperator, )
crates/ty_python_semantic/src/types/equality/enums.rs:1183
↓ 2 callers
Function
same_generic_operand
Returns whether ty treats two generic aliases as the same operand of a runtime union. We approximate runtime equality with type equivalence, so `list
crates/ty_python_semantic/src/types/union_type_instance.rs:89
↓ 2 callers
Method
satisfies
Returns `true` if every element of the union contains an intersection element with a matching overload that satisfies the provided closure, or `false`
crates/ty_python_semantic/src/types/call/bind.rs:1144
↓ 2 callers
Method
satisfies_anywhere
Returns true if this symbol satisfies the given import request. This attempts to take the definition site of the symbol into account.
crates/ty_python_semantic/src/importer.rs:620
↓ 2 callers
Method
saturating_sub
(self, rhs: usize)
crates/ruff_source_file/src/line_index.rs:621
↓ 2 callers
Method
scope_at
(&self, node: ast::NodeIndex)
crates/ty_python_core/src/ast_ids.rs:217
↓ 2 callers
Function
scoped_definitions_for_name
Resolves definitions in visible scopes, without falling back to implicit builtins.
crates/ty_python_semantic/src/types/definition_resolution.rs:183
↓ 2 callers
Method
script_environments_enabled
(self)
crates/ty_project/src/uv.rs:62
↓ 2 callers
Function
script_with_indirect_dependency
()
crates/ty/tests/cli/scripts.rs:1744
↓ 2 callers
Method
scripts
(&self)
crates/ty_project/src/files.rs:219
↓ 2 callers
Method
second
Peeks the second character from the input stream without consuming it. Returns [`EOF_CHAR`] if the position is past the end of the file.
crates/ruff_python_parser/src/lexer/cursor.rs:48
↓ 2 callers
Method
seen_import_boundary
Return `true` if the model has traversed past the "top-of-file" import boundary.
crates/ruff_python_semantic/src/model.rs:2290
↓ 2 callers
Method
select_for_paramspec
Select the arguments forwarded to a `ParamSpec` sub-call. The resulting argument list preserves the order of `indices`. Unlike [`Self::start_from`],
crates/ty_python_semantic/src/types/call/arguments.rs:774
↓ 2 callers
Method
selected_overloads
Returns the overloads selected for deprecation reporting without changing the matches retained for argument inference. Equivalent return types select
crates/ty_python_semantic/src/types/call/bind.rs:4636
↓ 2 callers
Function
selection_range
Returns a list of nested selection ranges, where each range contains the next one. The first range in the list is the largest range containing the cur
crates/ty_ide/src/selection_range.rs:10
↓ 2 callers
Method
self_type
(&self)
crates/ty_python_semantic/src/types.rs:11587
↓ 2 callers
Function
self_typevar_origin_class_literal
Returns the class recorded in a `Self` typevar's origin.
crates/ty_python_semantic/src/types.rs:11551
↓ 2 callers
Method
semantic_syntax_errors
(&self)
crates/ty_python_core/src/lib.rs:854
↓ 2 callers
Function
sequence_from_literal_elements
Builds a literal's sequence shape from already-inferred elements and iterable shapes. In `source = (*[1, "two"],)`, expanding the list syntax preserve
crates/ty_python_semantic/src/types/unpacker.rs:680
↓ 2 callers
Method
sequence_pattern_arm
Check one subject union member against the complete sequence pattern. Return the narrowed sequence and its elements when the length and every element
crates/ty_python_semantic/src/types/narrow.rs:3252
↓ 2 callers
Function
sequence_pattern_getitem_method
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, indexed_element_types: impl IntoIterator<Item =
crates/ty_python_semantic/src/types/match_pattern.rs:189
↓ 2 callers
Function
serializeFiles
( files: FilesState, session: PlaygroundSession | null, )
playground/ty/src/Playground.tsx:579
↓ 2 callers
Function
server_capabilities
Creates the server capabilities based on the resolved client capabilities and resolved global settings from the initialization options.
crates/ty_server/src/capabilities.rs:441
↓ 2 callers
Function
server_diagnostic_options
Creates the default [`DiagnosticOptions`] for the server.
crates/ty_server/src/capabilities.rs:572
↓ 2 callers
Method
set
(&mut self, rule: Rule, enabled: bool)
crates/ruff_linter/src/registry/rule_set.rs:209
↓ 2 callers
Function
set_assignment_primary_annotation
Set an assignment's primary message and return whether a message was added.
crates/ty_python_semantic/src/types/diagnostic.rs:2231
↓ 2 callers
Method
set_config_file_override
(&mut self, path: impl AsRef<SystemPath>)
crates/ty/tests/file_watching.rs:423
↓ 2 callers
Method
set_constructed_instance_type
(&mut self, instance_type: Type<'db>)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:89
↓ 2 callers
Method
set_constructor_context
( &mut self, db: &'db dyn Db, constructor_context: ConstructorContext<'db>, )
crates/ty_python_semantic/src/types/call/bind/constructor.rs:871
↓ 2 callers
Method
set_context
Overwrite the error context tree with a new root context and child nodes.
crates/ty_python_semantic/src/types/relation.rs:1819
↓ 2 callers
Method
set_enabled
(&self, enabled: bool)
crates/ty_python_semantic/src/types/relation_error.rs:964
↓ 2 callers
Method
set_fallback_options
Sets the lowest-precedence options for this project, replacing any previous fallbacks.
crates/ty_project/src/metadata.rs:463
↓ 2 callers
Method
set_fallback_options
(&mut self, options: Options)
crates/ty/tests/file_watching.rs:431
↓ 2 callers
Method
set_finish_message
(&self, message: String)
crates/ty_server/src/server/lazy_work_done_progress.rs:152
↓ 2 callers
Method
set_globals
Set the [`Globals`] for the current [`Scope`].
crates/ruff_python_semantic/src/model.rs:1723
↓ 2 callers
Method
set_if_none
(&mut self, first: First<'a>)
crates/ruff_python_formatter/src/pattern/mod.rs:392
↓ 2 callers
Method
set_if_none
(&mut self, first: First<'a>)
crates/ruff_python_formatter/src/expression/mod.rs:820
↓ 2 callers
Method
set_implicitly_invoked
Record that these bindings were reached through an implicit method lookup.
crates/ty_python_semantic/src/types/call/bind.rs:935
↓ 2 callers
Method
set_indent_align
(mut self, count: NonZeroU8)
crates/ruff_formatter/src/printer/call_stack.rs:69
↓ 2 callers
Method
set_interpolated_string_state
( &mut self, interpolated_string_state: InterpolatedStringState, )
crates/ruff_python_formatter/src/context.rs:118
↓ 2 callers
Function
set_max_parallelism
Sets the maximum number of tasks to process in parallel. Returns the supplied limit if [`max_parallelism`] has already been read or set.
crates/ruff_db/src/lib.rs:88
↓ 2 callers
Method
set_preview
(&mut self, preview: bool)
crates/ruff_server/src/session/options.rs:61
↓ 2 callers
Method
set_primary_annotation_message
Set the message on the primary annotation for this diagnostic. If a message already exists on the primary annotation, then this overwrites the existi
crates/ruff_linter/src/checkers/ast/mod.rs:3831
↓ 2 callers
Method
set_secondary_code
Set the secondary code for this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:465
↓ 2 callers
Method
set_singleton_constraints
Apply a merged result to a matching singleton, preserving this place's definition IDs.
crates/ty_python_core/src/use_def/place_state.rs:756
↓ 2 callers
Method
set_source_overload_index
(&mut self, index: Option<NonZeroU32>)
crates/ty_python_semantic/src/types/signatures.rs:2519
↓ 2 callers
Method
set_span
Sets the span on this annotation.
crates/ruff_db/src/diagnostic/mod.rs:887
↓ 2 callers
Method
set_status
(self, status: Status)
crates/ruff_linter/resources/test/fixtures/pyflakes/F821_0.py:78
↓ 2 callers
Method
set_stop
(&mut self)
crates/ty_project/src/watch/watcher.rs:140
↓ 2 callers
Method
set_style_range
Set `style` for `line`, `col_start..col_end` range if: 1. That line and column range exist in `StyledBuffer` 2. `overwrite` is `true` or existing styl
crates/ruff_annotate_snippets/src/renderer/styled_buffer.rs:142
↓ 2 callers
Function
set_up_logging
(level: LogLevel)
crates/ruff_linter/src/logging.rs:124
↓ 2 callers
Function
set_uv_envs
(command: &mut Command, case: &CliTest, virtual_env: Option<&Path>)
crates/ty/tests/cli/uv_workspace.rs:90
↓ 2 callers
Method
set_verbose
(self, db: &mut dyn Db, verbose: bool)
crates/ty_project/src/lib.rs:618
↓ 2 callers
Method
set_version
(&mut self, version: DocumentVersion)
crates/ty_server/src/session.rs:2146
↓ 2 callers
Function
setattr_behavior
Return the model's assignment behavior for `attribute`, or `None` if it cannot be determined.
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:592
↓ 2 callers
Method
settings_for_uri
(&self, uri: &Uri)
crates/ruff_server/src/session/index.rs:364
↓ 2 callers
Method
settings_impl
(&self)
crates/ruff_server/src/session/settings.rs:37
↓ 2 callers
Method
setup
Setup a real-world project for benchmarking
crates/ruff_benchmark/src/real_world_projects.rs:63
↓ 2 callers
Function
setupMonaco
( monaco: Monaco, settingsSchema: { fileMatch: [string]; uri: string; schema: object; }, )
playground/shared/src/setupMonaco.tsx:39
↓ 2 callers
Function
setup_logging_with_filter
Sets up logging for the current thread and uses the passed filter to filter the shown events. Useful for capturing the tracing output in a failing tes
crates/ruff_db/src/testing.rs:174
↓ 2 callers
Function
setup_micro_case_inner
(code: &str, venv_path: Option<&Path>)
crates/ruff_benchmark/benches/ty_shared/mod.rs:39
↓ 2 callers
Function
setup_tracing
( level: VerbosityLevel, color: TerminalColor, )
crates/ty/src/logging.rs:109
↓ 2 callers
Method
shared_place_table
Shares the existing place table with another per-scope query result.
crates/ty_python_core/src/lib.rs:392
↓ 2 callers
Method
short_message
Abbreviate the message
crates/ruff_annotate_snippets/src/renderer/mod.rs:162
↓ 2 callers
Method
should_check_downstream
For constructors which may have downstreams (that is, metaclass `__call__` or `__new__`), analyze their overloads to determine whether to check downst
crates/ty_python_semantic/src/types/call/bind/constructor.rs:262
↓ 2 callers
Method
should_check_file
(&self, file: File)
crates/ty_project/src/db.rs:663
↓ 2 callers
Method
should_drop
(&mut self, element: &FormatElement)
crates/ruff_formatter/src/buffer.rs:532
↓ 2 callers
Method
should_edit_imported_name_for_import_from
Chooses an imported name edit for an import-from statement, including re-exports. For example, renaming `pkg.old` can change the imported name `old`
crates/ty_ide/src/will_rename.rs:518
↓ 2 callers
Method
should_edit_imported_name_for_plain_import
Chooses an imported name edit for a plain import statement (e.g., `pkg.old` to `pkg.new` in the statement `import pkg.old`).
crates/ty_ide/src/will_rename.rs:495
↓ 2 callers
Method
should_edit_module_member
Decides whether to edit `bound_name` when it is imported from `resolved_module` (e.g., `old` in `from facade import old`) or accessed as an attribute
crates/ty_ide/src/will_rename.rs:616
↓ 2 callers
Method
should_expand_intersection
( &self, db: &'db dyn Db, intersection: IntersectionType<'db>, )
crates/ty_python_semantic/src/types/relation.rs:1432
↓ 2 callers
Method
should_freshen
( &self, db: &'db dyn Db, generic_context: GenericContext<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:944
↓ 2 callers
Method
should_index_file
Returns `true` if an included file should be indexed.
crates/ty_project/src/glob.rs:148
↓ 2 callers
Function
should_insert_blank_line_after_class_in_stub_file
Checks if an empty line should be inserted after a class definition. This is only valid if the [`blank_line_after_nested_stub_class`](https://github.
crates/ruff_python_formatter/src/statement/suite.rs:615
↓ 2 callers
Method
should_retain_constraint
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, bound: Option<Type<'db
crates/ty_python_semantic/src/types/constraints/variables.rs:26
↓ 2 callers
Method
should_retry_after_provisional_arity
( &self, expansions: &CallArgumentExpansions<'_, '_, 'db>, )
crates/ty_python_semantic/src/types/call/bind.rs:4284
↓ 2 callers
Method
should_visit_lazy_type_attributes
(&self)
crates/ty_python_semantic/src/types/visitor.rs:531
↓ 2 callers
Function
show_fix_status
Return `true` if the [`Printer`] should indicate that a rule is fixable.
crates/ruff/src/printer.rs:460
↓ 2 callers
Function
side_effect
Return whether `expr` has no side effects, maybe has side effects, or definitely has side effects. Unlike [`contains_effect`], which returns a simple
crates/ruff_python_ast/src/helpers.rs:234
↓ 2 callers
Method
simplified
Returns the provenance of a bound produced by simplifying two existing bounds. Simplifying bounds can make one input redundant, and a redundant input
crates/ty_python_semantic/src/types/constraints/variables.rs:85
↓ 2 callers
Method
simulate_runtime_load
Simulates a runtime load of a given [`ast::ExprName`]. This should not be run until after all the bindings have been visited. The main purpose of th
crates/ruff_python_semantic/src/model.rs:953
↓ 2 callers
Method
single_definition
(self)
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:480
↓ 2 callers
Method
single_item
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:1493
↓ 2 callers
Method
single_key
(&self)
crates/ty_python_semantic/src/types/equality/enums.rs:1036
↓ 2 callers
Method
single_required_positional_parameter_type
(&self)
crates/ty_python_semantic/src/types/signatures.rs:1362
↓ 2 callers
Function
site_packages_editables
( db: &'db dyn Db, environment: ResolverEnvironment<'db>, )
crates/ty_module_resolver/src/resolve.rs:989
↓ 2 callers
Function
site_packages_filter
(python_version: &str)
crates/ty/tests/self_environment.rs:398
↓ 2 callers
Method
size_hint
(&self)
crates/ruff_python_ast/src/nodes.rs:316
↓ 2 callers
Function
skip_comment
(src: str, pos: Pos)
crates/ruff_benchmark/resources/tomllib/_parser.py:263
↓ 2 callers
Method
skip_content
Skips all content until it finds the corresponding end tag with the given kind.
crates/ruff_formatter/src/printer/queue.rs:40
↓ 2 callers
Function
skip_range
( first: &Stmt, statements: &[Stmt], context: &PyFormatContext, )
crates/ruff_python_formatter/src/statement/suite.rs:931
↓ 2 callers
Method
skip_source_order
(self)
crates/ruff_python_ast/generate.py:226
↓ 2 callers
Method
slice
Returns the slice into the source code.
crates/ruff_python_formatter/src/comments/visitor.rs:323
↓ 2 callers
Method
slot_definition
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/slots.rs:290
↓ 2 callers
Function
slots_members
(body: &[Stmt])
crates/ruff_linter/src/rules/pylint/rules/redefined_slots_in_subclass.rs:124
↓ 2 callers
Function
snapshot_diagnostics
( test: &MarkdownTest<'_, '_, C>, db: &dyn Db, tool_name: &'static str, relative_fixture_path:
crates/mdtest/src/lib.rs:704
↓ 2 callers
Method
snapshot_document
Captures client settings and a target for a document request.
crates/ty_server/src/session.rs:1225
← previous
next →
6,901–7,000 of 31,562, ranked by callers