Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,766 in github.com/astral-sh/ruff
⨍
Functions
31,766
◇
Types & classes
7,128
↳
Endpoints
82
↓ 2 callers
Method
parsed
(&self)
crates/ruff_python_parser/src/typing.rs:18
↓ 2 callers
Function
parsed_lines
Collects docstring lines without their universal-newline terminators while preserving their source ranges. For example, `first\r\nsecond` yields `fir
crates/ty_ide/src/docstring/document/syntax.rs:12
↓ 2 callers
Function
parsed_module_impl
(db: &dyn Db, file: File, target_version: PythonVersion)
crates/ruff_db/src/parsed.rs:49
↓ 2 callers
Method
partial_keyword_cases
The argument lists for the different values of a stored keyword.
crates/ty_python_semantic/src/types/call/bind.rs:3760
↓ 2 callers
Method
parts
(&self)
crates/ty_ide/src/inlay_hints.rs:285
↓ 2 callers
Function
password_target
(target: &Expr)
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_password_string.rs:54
↓ 2 callers
Method
path_metadata
( &self, path: &SystemPath, )
crates/ty_test/src/db.rs:511
↓ 2 callers
Method
pathlib_method
(self)
crates/ruff_linter/src/rules/refurb/helpers.rs:107
↓ 2 callers
Method
paths
Paths whose changes need watching.
crates/ty_project/src/watch/project_watcher.rs:177
↓ 2 callers
Method
pattern
Compute possibly narrowed places for a pattern predicate.
crates/ty_python_core/src/place.rs:634
↓ 2 callers
Method
pattern_filtering_type
(&self, ty: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:3475
↓ 2 callers
Function
pattern_guard_allows_all_matches
Whether the guard cannot reject a value matched by the pattern.
crates/ty_python_semantic/src/reachability.rs:314
↓ 2 callers
Method
peek2
Returns the next two token kinds without consuming it.
crates/ruff_python_parser/src/parser/mod.rs:385
↓ 2 callers
Method
pep695_generic_context
Returns the generic context declared by the class's PEP 695 type parameter list. Returns `None` if there is no parameter list or it has no type varia
crates/ty_python_semantic/src/types/class/static_literal.rs:415
↓ 2 callers
Function
percent_to_format
Convert a [`CFormatString`] into a `String`.
crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs:203
↓ 2 callers
Function
place_condition_definition_info
Also accepts augmented-assignment targets, which have a recorded load despite their store context.
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:394
↓ 2 callers
Method
place_expr
(&self)
crates/ty_python_semantic/src/place_load.rs:856
↓ 2 callers
Method
pop
(&mut self)
crates/ruff_formatter/src/printer/queue.rs:79
↓ 2 callers
Method
pop_branch
Pop the current [`BranchId`] off the stack.
crates/ruff_python_semantic/src/model.rs:1470
↓ 2 callers
Method
pop_context
Pop an [`ExceptionContext`] off the stack.
crates/ty_python_core/src/builder/except_handlers.rs:257
↓ 2 callers
Method
pop_node
Pop the current AST node [`NodeRef`] off the stack.
crates/ruff_python_semantic/src/model.rs:1432
↓ 2 callers
Method
pop_slice
Removes top slice.
crates/ruff_formatter/src/printer/queue.rs:112
↓ 2 callers
Method
position
(self)
crates/ruff_python_formatter/src/builders.rs:94
↓ 2 callers
Method
positional
Iterate initial positional parameters, not including variadic parameter, if any. For a valid signature, this will be all positional parameters. In an
crates/ty_python_semantic/src/types/signatures.rs:5667
↓ 2 callers
Method
positional_only_by_name
Return a positional-only parameter (with index) with the given name.
crates/ty_python_semantic/src/types/signatures.rs:5685
↓ 2 callers
Function
positive_class_pattern_type
Return the type established by a successful class pattern. This also handles indirect class expressions such as `PatternClass: type[A]`. It is only a
crates/ty_python_semantic/src/types/narrow.rs:1490
↓ 2 callers
Method
positive_constraint
Disjoint operands produce `Some(Type::Never)`. Applying a nonempty constraint intersects it with the original operand. When the shared literals would
crates/ty_python_semantic/src/types/literal.rs:590
↓ 2 callers
Method
positive_subject_constraint
Return the positive constraint produced when `pattern` matches `subject_ty`. Leaf patterns return their direct runtime-test constraint; the caller ap
crates/ty_python_semantic/src/types/narrow.rs:2120
↓ 2 callers
Method
precedence
(&self)
crates/ruff_python_formatter/src/expression/binary_like.rs:994
↓ 2 callers
Method
predicate
(&self)
crates/ty_python_core/src/definition.rs:1270
↓ 2 callers
Method
prefer_rule_codes
Whether to prefer rule codes over human-readable rule names, even in preview mode.
crates/ruff_db/src/diagnostic/mod.rs:1499
↓ 2 callers
Method
preferred_quote_style
Determines the preferred quote style for `string`. The formatter should use the preferred quote style unless it can't because the string contains the
crates/ruff_python_formatter/src/string/normalize.rs:44
↓ 2 callers
Function
prepare_call_hierarchy
Resolve the symbol at `offset` to a list of [`CallHierarchyItem`]s. Returns `None` when the cursor is not on a function, method, or class — only call
crates/ty_ide/src/call_hierarchy.rs:35
↓ 2 callers
Function
prepare_type_hierarchy
Prepare the type hierarchy at a given position. Returns `None` if the position is not on a class definition or class reference.
crates/ty_ide/src/type_hierarchy.rs:32
↓ 2 callers
Method
prepend_info
Adds an "info" sub-diagnostic before any existing sub-diagnostics.
crates/ruff_db/src/diagnostic/mod.rs:179
↓ 2 callers
Method
preserve_original_subject_type
( &self, original_subject_ty: Type<'db>, filtered_ty: Type<'db>, preservation:
crates/ty_python_semantic/src/types/narrow.rs:3421
↓ 2 callers
Method
preserve_positive_aliases
Retain positive aliases when rebuilding mapped intersections. A positive alias can represent a type on its own, while `~A` is represented as an inter
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:1584
↓ 2 callers
Method
preview
(&self)
crates/ruff_python_formatter/src/options.rs:151
↓ 2 callers
Method
previous_overload
Returns the overload immediately before this one in the AST. Returns `None` if there is no previous overload.
crates/ty_python_semantic/src/types/function.rs:480
↓ 2 callers
Method
previous_sibling
(&self)
crates/ruff_python_ast/src/traversal.rs:77
↓ 2 callers
Method
print_char
(&mut self, char: char)
crates/ruff_formatter/src/printer/mod.rs:829
↓ 2 callers
Method
print_description
Print the result of checking this seed.
python/py-fuzzer/fuzz.py:305
↓ 2 callers
Function
print_diagnostics
( file: Path, diagnostics: list[lsp.Diagnostic], cwd: Path, label: str | None = None )
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:427
↓ 2 callers
Method
print_element
( &mut self, stack: &mut PrintCallStack, queue: &mut PrintQueue<'a>, element:
crates/ruff_formatter/src/printer/mod.rs:94
↓ 2 callers
Function
print_jupyter_messages
( diagnostics: &[Diagnostic], path: &Path, notebook: &Notebook, )
crates/ruff_linter/src/test.rs:485
↓ 2 callers
Function
print_messages
(diagnostics: &[Diagnostic])
crates/ruff_linter/src/test.rs:506
↓ 2 callers
Method
print_one
Prints the single line given. This mostly just handles indentation and ensuring line breaks are inserted as appropriate before passing it on to the f
crates/ruff_python_formatter/src/string/docstring.rs:385
↓ 2 callers
Function
process
(kind: Kind, action: Action | None, params: dict[str, Any])
crates/ruff_benchmark/resources/typeis_narrowing.py:210
↓ 2 callers
Function
process_documentation
(documentation: &str, out: &mut String, rule_name: &str)
crates/ruff_dev/src/generate_docs.rs:183
↓ 2 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/instance.rs:667
↓ 2 callers
Method
program_file
(&self, file: File)
crates/ty_test/src/db.rs:154
↓ 2 callers
Method
program_file
(&self, file: File)
crates/ty_python_semantic/tests/corpus.rs:222
↓ 2 callers
Method
program_file
(&self, file: File)
fuzz/fuzz_targets/ty_check_invalid_syntax.rs:122
↓ 2 callers
Function
program_for_dependency
(db: &'db dyn Db, path: &SystemPath)
crates/ty_project/src/db.rs:63
↓ 2 callers
Function
project_file_at_path
Return `true` if the Python file at [`Path`] is _not_ excluded.
crates/ruff_workspace/src/resolver.rs:792
↓ 2 callers
Method
project_for_file
Find a script's declarations or the nearest containing project's declarations.
crates/ty_python_semantic/src/dependency.rs:151
↓ 2 callers
Function
project_relative_path
(db: &dyn Db, file: File)
crates/ty_project/src/baseline.rs:381
↓ 2 callers
Method
project_root
(self, path: &Path)
crates/ruff_workspace/src/resolver.rs:451
↓ 2 callers
Method
project_state_mut
Returns a mutable reference to the project's [`ProjectState`] in which the given `path` belongs. Refer to [`project_db`] for more details on how the
crates/ty_server/src/session.rs:510
↓ 2 callers
Method
promote_collection_element_type
Finalizes the element type of a mutable collection after combining its element evidence. Literal types supplied by explicit annotations remain unpromo
crates/ty_python_semantic/src/types.rs:3741
↓ 2 callers
Function
promote_for_self
Promotes types in `self` positions. This is so that we show e.g. `int.__add__` instead of `Literal[4].__add__`.
crates/ty_python_semantic/src/types/ide_support.rs:1513
↓ 2 callers
Method
promote_singletons_impl
Like [`Type::promote_singletons_recursively`], but does not recurse into nested types.
crates/ty_python_semantic/src/types.rs:3817
↓ 2 callers
Function
property_setter_value_type
Union the value parameter types accepted by a property's setter overloads. Keep the first available signature definition so callers can bind `Self` i
crates/ty_python_semantic/src/types/attribute_write.rs:1509
↓ 2 callers
Function
protocol_apply_self_with_receiver
( db: &'db dyn Db, program: Program<'db>, callable: CallableType<'db>, receiver_type: Type<'db
crates/ty_python_semantic/src/types/protocol_class.rs:3795
↓ 2 callers
Function
protocol_bind_self
( db: &'db dyn Db, program: Program<'db>, callable: CallableType<'db>, self_type: Option<Type<
crates/ty_python_semantic/src/types/protocol_class.rs:3768
↓ 2 callers
Function
protocol_implementation_read_place
Check a class variable's instance and class reads against the operations its descriptor supports. Other protocol members use the normal lookup recover
crates/ty_python_semantic/src/types/protocol_class.rs:2632
↓ 2 callers
Function
protocol_materialization_is_noop
( db: &'db dyn Db, program: crate::Program<'db>, class: ProtocolClass<'db>, )
crates/ty_python_semantic/src/types/instance.rs:572
↓ 2 callers
Method
protocol_member_has_disjoint_type_from_ty
Checks whether `ty` is disjoint from the readable type required by `member`. Method members are compared conservatively through their non-`Never` ret
crates/ty_python_semantic/src/types/protocol_class.rs:3374
↓ 2 callers
Method
provides_candidate_evidence
Whether this constraint provides useful inference evidence.
crates/ty_python_semantic/src/types/constraints/variables.rs:480
↓ 2 callers
Method
public_overload_signature
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:599
↓ 2 callers
Function
pull_types
(db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_semantic/src/pull_types.rs:13
↓ 2 callers
Method
push
(&mut self, node: AnyRootNodeRef<'ast>)
crates/ruff_db/src/parsed.rs:398
↓ 2 callers
Method
push
Push a new offset to the end of the [`CellOffsets`]. # Panics Panics if the offset is less than the last offset pushed.
crates/ruff_notebook/src/cell.rs:273
↓ 2 callers
Method
push
Extends the list of constraints used by subsequent sources.
crates/ty_python_semantic/src/place_load.rs:1422
↓ 2 callers
Method
push_additional_definition
Push a new [`Definition`] onto the list of definitions associated with the `definition_node` AST node. Most AST nodes can only be associated with at
crates/ty_python_core/src/builder.rs:1570
↓ 2 callers
Method
push_branch
Push a new branch onto the stack, returning its [`BranchId`].
crates/ruff_python_semantic/src/model.rs:1464
↓ 2 callers
Method
push_comment
(&mut self, placement: DecoratedComment<'a>)
crates/ruff_python_formatter/src/comments/visitor.rs:527
↓ 2 callers
Method
push_definition
(&mut self, db: &'db dyn Db, definition: Definition<'db>)
crates/ty_python_semantic/src/place/definitions.rs:128
↓ 2 callers
Method
push_end_marker
Push the end marker for an [`Edit`]. The `output_length` is the length of the transformed string after the edit has been applied. ## Panics If `edi
crates/ruff_diagnostics/src/source_map.rs:65
↓ 2 callers
Method
push_line
Returns `false` when `line` belongs outside this section.
crates/ty_ide/src/docstring/document/numpy.rs:253
↓ 2 callers
Method
push_line
(&mut self)
crates/ty_ide/src/docstring/document/google.rs:249
↓ 2 callers
Function
push_link_text_char
(output: &mut String, char: char)
crates/ty_ide/src/docstring/markdown/general/inline.rs:624
↓ 2 callers
Method
push_mapping
(&mut self, range: TextRange)
crates/ruff_linter/src/noqa.rs:1343
↓ 2 callers
Method
push_node
Push an AST node [`NodeRef`] onto the stack.
crates/ruff_python_semantic/src/model.rs:1427
↓ 2 callers
Method
push_scope_with_parent
(&mut self, node: NodeWithScopeRef, parent: Option<FileScopeId>)
crates/ty_python_core/src/builder.rs:514
↓ 2 callers
Method
push_start_marker
Push the start marker for an [`Edit`]. The `output_length` is the length of the transformed string before the edit is applied. ## Panics If the sta
crates/ruff_diagnostics/src/source_map.rs:53
↓ 2 callers
Method
py_slice
( &self, db: &'db dyn Db, start: Option<i32>, stop: Option<i32>, step:
crates/ty_python_semantic/src/types/tuple.rs:1107
↓ 2 callers
Method
py_slice_type
Returns a sound static slice result for a mixed tuple. We preserve fixed-length results exactly, unioning each output position when it can come from
crates/ty_python_semantic/src/types/tuple.rs:1691
↓ 2 callers
Function
py_slice_with_step
Returns a static Python slice for a known non-zero step.
crates/ty_python_semantic/src/subscript.rs:139
↓ 2 callers
Method
pydantic_metadata
(self)
crates/ty_python_semantic/src/types/class.rs:398
↓ 2 callers
Function
pytest_config_file
Returns pytest's installed configuration module.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:515
↓ 2 callers
Function
pytest_cursor_test_builder
()
crates/ty_ide/src/goto_definition.rs:136
↓ 2 callers
Function
pytest_db_with_config_and_src_roots
( files: &[(&'static str, &'static str)], src_roots: Vec<SystemPathBuf>, config: &'sta
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:4533
↓ 2 callers
Function
pytest_db_with_files
(files: &[(&'static str, &'static str)])
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:4501
↓ 2 callers
Function
pytest_db_with_files_and_src_roots
( files: &[(&'static str, &'static str)], src_roots: Vec<SystemPathBuf>, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:4505
↓ 2 callers
Function
pytest_plugin_names
(db: &'db dyn Db, file: ProgramFile<'db>)
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:467
↓ 2 callers
Function
pytest_registered_plugin_files
Returns the plugins registered through `pytest_plugins` by `request_file` and its conftest hierarchy, in registration order. Plugins registered by un
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:332
↓ 2 callers
Method
python_ast
Returns a reference to the Python AST.
crates/ruff_python_semantic/src/definition.rs:284
↓ 2 callers
Method
python_file
(self, db: &'db dyn Db)
crates/ty_python_core/src/definition.rs:88
↓ 2 callers
Method
python_len
The length of the string, as would be returned by Python's `len()`.
crates/ty_python_semantic/src/types/literal.rs:380
← previous
next →
6,701–6,800 of 31,766, ranked by callers