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
parse_first_stmt
Parse the given source using [`Mode::Module`] and return the first statement.
crates/ruff_linter/src/fix/edits.rs:691
↓ 2 callers
Method
parse_for_statement
Parses a `for` statement. The given `start` offset is the start of either the `for` token or the `async` token if it's an async for statement. # Pan
crates/ruff_python_parser/src/parser/statement.rs:1851
↓ 2 callers
Method
parse_generator_expression
Parses a generator expression. The given `start` offset is the start of either the opening parenthesis if the generator is parenthesized or the first
crates/ruff_python_parser/src/parser/expression.rs:2604
↓ 2 callers
Function
parse_index
Python only treats an all-digit field name or element index as an integer, so `"{+0}"` is the keyword `+0`, not index 0. `usize::from_str` accepts a l
crates/ruff_python_literal/src/format.rs:744
↓ 2 callers
Method
parse_interpolated_string_elements
Parses a list of f/t-string elements. # Panics If the parser isn't positioned at a `{`, `FStringMiddle`, or `TStringMiddle` token.
crates/ruff_python_parser/src/parser/expression.rs:1630
↓ 2 callers
Function
parse_key_value_pair
( src: str, pos: Pos, parse_float: ParseFloat )
crates/ruff_benchmark/resources/tomllib/_parser.py:357
↓ 2 callers
Method
parse_lambda_expr
Parses a lambda expression. # Panics If the parser isn't positioned at a `lambda` token. See: <https://docs.python.org/3/reference/expressions.html
crates/ruff_python_parser/src/parser/expression.rs:2885
↓ 2 callers
Function
parse_literal_str
(src: str, pos: Pos)
crates/ruff_benchmark/resources/tomllib/_parser.py:512
↓ 2 callers
Method
parse_match_body
Parses the body of a `match` statement. This method expects that the parser is positioned at a `Newline` token. If not, it adds a syntax error and co
crates/ruff_python_parser/src/parser/statement.rs:2741
↓ 2 callers
Method
parse_match_pattern_target
Parses a binding target in an `as` or mapping pattern.
crates/ruff_python_parser/src/parser/pattern.rs:293
↓ 2 callers
Method
parse_match_subject_expression
Parses the subject expression for a `match` statement.
crates/ruff_python_parser/src/parser/statement.rs:2687
↓ 2 callers
Method
parse_missing_identifier
(&mut self)
crates/ruff_python_parser/src/parser/expression.rs:566
↓ 2 callers
Function
parse_number
(text: &str)
crates/ruff_python_literal/src/format.rs:289
↓ 2 callers
Function
parse_one_line_basic_str
(src: str, pos: Pos)
crates/ruff_benchmark/resources/tomllib/_parser.py:407
↓ 2 callers
Method
parse_parameter
Parses a single parameter for the given function kind. Matches either the `param_no_default_star_annotation` or `param_no_default` rule in the [Pytho
crates/ruff_python_parser/src/parser/statement.rs:3182
↓ 2 callers
Method
parse_parameters
Parses a parameter list for the given function kind. See: <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-param
crates/ruff_python_parser/src/parser/statement.rs:3326
↓ 2 callers
Function
parse_quantity
(iter: &mut ParseIter<I>)
crates/ruff_python_literal/src/cformat.rs:259
↓ 2 callers
Function
parse_quoted_string
Parse a quoted string delimited by single or double quotes. Returns `None` if the string contains escape sequences (e.g. `\'`), since Jinja supports
crates/ruff_linter/src/rules/airflow/rules/xcom_pull_in_template_string.rs:260
↓ 2 callers
Method
parse_sequence_match_pattern
Parses the rest of a sequence pattern, given the first element. If the `parentheses` is `None`, it is an [open sequence pattern]. See: <https://docs
crates/ruff_python_parser/src/parser/pattern.rs:368
↓ 2 callers
Method
parse_simple_statement
Parses a simple statement. See: <https://docs.python.org/3/reference/simple_stmts.html>
crates/ruff_python_parser/src/parser/statement.rs:269
↓ 2 callers
Method
parse_statement
Parses a compound or a single simple statement. See: - <https://docs.python.org/3/reference/compound_stmts.html> - <https://docs.python.org/3/referen
crates/ruff_python_parser/src/parser/statement.rs:112
↓ 2 callers
Function
parse_string_annotation
Parses a Python expression from a string annotation. # Example Parsing a string annotation: ``` use ruff_python_parser::parse_string_annotation; us
crates/ruff_python_parser/src/lib.rs:219
↓ 2 callers
Method
parse_strings
Parses all kinds of strings and implicitly concatenated strings. # Panics If the parser isn't positioned at a `String`, `FStringStart`, or `TStringS
crates/ruff_python_parser/src/parser/expression.rs:1282
↓ 2 callers
Function
parse_suppression_comment
Parse a single suppression comment for testing
crates/ruff_linter/src/suppression.rs:2958
↓ 2 callers
Function
parse_toml
(path: &Path, table_path: &[&str])
crates/ruff_workspace/src/pyproject.rs:36
↓ 2 callers
Function
parse_type_annotation
Parses the given string expression node as a type annotation. The given `source` is the entire source code.
crates/ruff_python_parser/src/typing.rs:55
↓ 2 callers
Function
parse_type_ignore_tag
Parse the optional `[...]` tag in a `# type: ignore[...]` comment. Returns a list of error codes to ignore, or an empty list if the tag is a blanket
crates/ruff_linter/src/rules/pygrep_hooks/rules/blanket_type_ignore.rs:117
↓ 2 callers
Function
parse_type_separator
Parses a NumPy-style `name : type` separator.
crates/ty_ide/src/docstring/document/numpy.rs:751
↓ 2 callers
Method
parse_unary_expression
Parses a unary expression. This includes the unary arithmetic `+` and `-`, bitwise `~`, and the boolean `not` operators. # Panics If the parser isn
crates/ruff_python_parser/src/parser/expression.rs:1104
↓ 2 callers
Function
parse_value
( # noqa: C901 src: str, pos: Pos, parse_float: ParseFloat )
crates/ruff_benchmark/resources/tomllib/_parser.py:584
↓ 2 callers
Method
parse_with_item
Parses a single `with` item. See: <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-with_item>
crates/ruff_python_parser/src/parser/statement.rs:2470
↓ 2 callers
Method
parse_with_statement
Parses a `with` statement The given `start` offset is the start of either the `with` token or the `async` token if it's an async with statement. # P
crates/ruff_python_parser/src/parser/statement.rs:2214
↓ 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
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:3473
↓ 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:416
↓ 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:1455
↓ 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:1417
↓ 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:5764
↓ 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:5782
↓ 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:1488
↓ 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:575
↓ 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:2118
↓ 2 callers
Method
precedence
(&self)
crates/ruff_python_formatter/src/expression/binary_like.rs:994
↓ 2 callers
Method
precise_final_attribute_declaration
Try to find the unique `Final` declaration for `attribute` on `object_ty`. Returns `None` if the attribute is not `Final`, if there are multiple `Fin
crates/ty_python_semantic/src/types/infer/builder/final_attribute.rs:45
↓ 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:1528
↓ 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
preserve_original_subject_type
( &self, original_subject_ty: Type<'db>, filtered_ty: Type<'db>, preservation:
crates/ty_python_semantic/src/types/narrow.rs:3419
↓ 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:1544
↓ 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:482
↓ 2 callers
Function
print_messages
(diagnostics: &[Diagnostic])
crates/ruff_linter/src/test.rs:503
↓ 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:182
↓ 2 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/instance.rs:622
↓ 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
Method
program_settings
(&self)
crates/ty_test/src/db.rs:200
↓ 2 callers
Function
project_file_at_path
Return `true` if the Python file at [`Path`] is _not_ excluded.
crates/ruff_workspace/src/resolver.rs:808
↓ 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_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:511
↓ 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:3742
↓ 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:3818
↓ 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:1369
↓ 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:3705
↓ 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:3678
↓ 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:527
↓ 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:3287
↓ 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
← previous
next →
6,601–6,700 of 31,562, ranked by callers