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
normal
(self)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:35
↓ 2 callers
Function
normalize_field_specifiers
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, field_specifiers: &[Type<'db>], div: Type<'d
crates/ty_python_semantic/src/types.rs:2054
↓ 2 callers
Function
normalize_none_operand
Returns the runtime union operand for `value`, replacing `None` with the `NoneType` class.
crates/ty_python_semantic/src/types/union_type_instance.rs:73
↓ 2 callers
Function
normalize_path
Convert any path to an absolute path (based on the current working directory).
crates/ruff_linter/src/fs.rs:30
↓ 2 callers
Function
normalize_paths
Normalize paths in diagnostics to Unix paths before comparing them against the expected type. Doing otherwise means that it's hard to write cross-plat
crates/mdtest/src/matcher.rs:297
↓ 2 callers
Method
normalize_value
Returns the scalar payload type after applying the built-in mixin's constructor. Literal conversions are preserved precisely, unions are normalized e
crates/ty_python_semantic/src/types/enums.rs:66
↓ 2 callers
Function
not_found
()
crates/ruff_db/src/system/os.rs:471
↓ 2 callers
Function
not_found
()
crates/ty_wasm/src/lib.rs:1720
↓ 2 callers
Function
note_numbers_module_not_supported
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, diag: &mut Diagnostic, target_ty: Type<'db>,
crates/ty_python_semantic/src/types/diagnostic.rs:1861
↓ 2 callers
Method
notebook_or_file
Returns the salsa interned [`File`] for the document selected by this query. It returns [`None`] for the following cases: - For virtual file, if it's
crates/ty_server/src/session.rs:2031
↓ 2 callers
Function
notebook_with_syntax_error
()
crates/ruff/tests/cli/format.rs:1973
↓ 2 callers
Method
notify_skipped_lazy_type_attributes
Notify the visitor that lazily-inferred type attributes were not visited.
crates/ty_python_semantic/src/types/visitor.rs:50
↓ 2 callers
Function
num_digits
(n: usize)
crates/ruff/src/printer.rs:449
↓ 2 callers
Function
num_overlap
( a_start: usize, a_end: usize, b_start: usize, b_end: usize, inclusive: bool, )
crates/ruff_annotate_snippets/src/renderer/render.rs:2420
↓ 2 callers
Function
num_statements
(stmts: &[Stmt])
crates/ruff_linter/src/rules/pylint/helpers.rs:335
↓ 2 callers
Function
o
()
crates/ruff_linter/resources/test/fixtures/flake8_type_checking/TC001_future.py:64
↓ 2 callers
Function
on_conditional_branch
Check if a node is part of a conditional branch.
crates/ruff_python_ast/src/helpers.rs:1280
↓ 2 callers
Method
open_all_files
(self)
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:204
↓ 2 callers
Method
open_document_in_db
( &mut self, client: &Client, document: &OpenDocumentHandle, language_id: Opti
crates/ty_server/src/session.rs:1418
↓ 2 callers
Method
open_parentheses_count
Calculates the number of open parentheses for the current f-string based on the current level of nesting for the lexer.
crates/ruff_python_parser/src/lexer/interpolated_string.rs:81
↓ 2 callers
Method
open_text_document
(&mut self, document: TextDocument)
crates/ty_server/src/session/index.rs:187
↓ 2 callers
Method
open_text_document_with_uri
(&mut self, uri: Uri, content: impl AsRef<str>, version: i32)
crates/ty_server/tests/e2e/main.rs:896
↓ 2 callers
Method
operand
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:251
↓ 2 callers
Method
operators
(&self)
crates/ruff_python_formatter/src/expression/binary_like.rs:549
↓ 2 callers
Method
optional_definition
(&self, model: &SemanticModel<'db>)
crates/ty_python_semantic/src/semantic_model.rs:1164
↓ 2 callers
Function
optional_value
(log: str, pattern: str, label: str)
scripts/collect_ty_ecosystem_run_metadata.py:65
↓ 2 callers
Method
options
(&self)
crates/ruff_db/src/vendored.rs:509
↓ 2 callers
Method
or
Combines two paths without copying one path into both outcomes of the other's predicate.
crates/ty_python_semantic/src/reachability.rs:1376
↓ 2 callers
Method
or
(self, other: RecursivelyDefined)
crates/ty_python_semantic/src/types/set_theoretic.rs:1605
↓ 2 callers
Method
ordinary_types
Returns the inferred types of a positional argument, a named keyword argument, or a synthetic receiver. Returns `None` for `*args` and `**kwargs` beca
crates/ty_python_semantic/src/types/call/arguments.rs:154
↓ 2 callers
Function
organize_imports_edit
( query: &DocumentQuery, encoding: PositionEncoding, )
crates/ruff_server/src/server/api/requests/code_action_resolve.rs:143
↓ 2 callers
Method
other_typevar
( self, db: &'db dyn Db, typevar: BoundTypeVarInstance<'db>, )
crates/ty_python_semantic/src/types/constraints/variables.rs:1259
↓ 2 callers
Function
outgoing_calls
Find the callees associated with the function, method, or class at `offset`. Calls in the item's body are reported as outgoing calls of that item. Ca
crates/ty_ide/src/call_hierarchy/outgoing_calls.rs:33
↓ 2 callers
Method
output_format
(mut self, format: &'a str)
crates/ruff/tests/integration_test.rs:52
↓ 2 callers
Function
outside_handlers
(offset: TextSize, semantic: &SemanticModel)
crates/ruff_linter/src/rules/flake8_logging/helpers.rs:5
↓ 2 callers
Method
override_options
(&self)
crates/ty_project/src/metadata.rs:409
↓ 2 callers
Method
own_class_member
Returns the inferred type of the class member named `name`. Only bound members or those marked as `ClassVars` are considered. Returns [`Place::Undefi
crates/ty_python_semantic/src/types/class/static_literal.rs:1628
↓ 2 callers
Method
own_fields_with_class_variables
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, field_po
crates/ty_python_semantic/src/types/class/static_literal.rs:2806
↓ 2 callers
Method
own_generated_member
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, specialization: Option
crates/ty_python_semantic/src/types/class/static_literal.rs:1868
↓ 2 callers
Function
own_member_definitions
Returns member definitions for `member_name` that are declared directly in `class`. ```py class Animal: def speak(self): ... class Dog(Animal): pass
crates/ty_python_semantic/src/types/ide_support.rs:594
↓ 2 callers
Function
own_model_config
(db: &dyn Db, class: StaticClassLiteral<'_>)
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:840
↓ 2 callers
Method
owner_type
Returns the type representation of this owner.
crates/ty_python_semantic/src/types/bound_super.rs:359
↓ 2 callers
Method
p_if
(&mut self, cond: bool, s: &str)
crates/ruff_python_codegen/src/generator.rs:228
↓ 2 callers
Function
pack
Packs a keyword in little-endian order at the high end of a word.
crates/ruff_python_parser/src/lexer/keywords.rs:51
↓ 2 callers
Method
package_directories
Returns the package's directories using the mode that selected this rename target. Returns `None` for single-file modules.
crates/ty_ide/src/will_rename.rs:1371
↓ 2 callers
Function
panic_message
( err: &'a Box<dyn std::any::Any + Send + 'static>, )
crates/ruff_server/src/server/api.rs:413
↓ 2 callers
Function
parameter_context_specialization
Combines the expected return type and the type arguments inferred so far into the context for the next argument-inference pass.
crates/ty_python_semantic/src/types/call/bind.rs:6127
↓ 2 callers
Function
parameter_documentation
Returns parameter documentation from recognized Google-style parameter sections. `normalized_source` must have already undergone PEP-257 trimming and
crates/ty_ide/src/docstring/document/google.rs:50
↓ 2 callers
Function
parametrize
(checker: &Checker, call: &ExprCall, qualified_name: &QualifiedName)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:895
↓ 2 callers
Method
parent
Returns the node's parent.
crates/ruff_python_ast/src/find_node.rs:80
↓ 2 callers
Method
parent_expression_id
Given a [`NodeId`], return the [`NodeId`] of the parent expression, if any.
crates/ruff_python_semantic/src/model.rs:1643
↓ 2 callers
Method
parent_id
(&self, node_id: NodeId)
crates/ruff_python_semantic/src/nodes.rs:52
↓ 2 callers
Function
parenthesis_token
Helper to return a parenthesis token only when the cursor (at `offset`) is on a parenthesis token.
crates/ty_ide/src/goto.rs:1540
↓ 2 callers
Function
parenthesize_loop_iter_if_necessary
A helper function that extracts the `iter` from a [`ast::StmtFor`] node and adds parentheses if needed. Also returns the original source range, inclu
crates/ruff_linter/src/rules/refurb/helpers.rs:436
↓ 2 callers
Function
parrot_stdin
Read bytes from `stdin` and write them to `stdout`.
crates/ruff/src/stdin.rs:12
↓ 2 callers
Method
parse
(error: ParseError, path: Option<&Path>, source_kind: &SourceKind)
crates/ruff/src/commands/format.rs:842
↓ 2 callers
Method
parse
Given the contents of a Python file, extract the `script` metadata block with leading comment hashes removed and map its offsets to the original Pytho
crates/ruff_python_ast/src/script.rs:65
↓ 2 callers
Method
parse
Parse the attempted assertion into a [`ParsedAssertion`] structured representation.
crates/mdtest/src/assertion.rs:283
↓ 2 callers
Method
parse_alias
Parses an `import` or `from` import name. See: - <https://docs.python.org/3/reference/simple_stmts.html#the-import-statement> - <https://docs.python.
crates/ruff_python_parser/src/parser/statement.rs:780
↓ 2 callers
Method
parse_arguments
Parses an argument list. # Panics If the parser isn't positioned at a `(` token. See: <https://docs.python.org/3/reference/expressions.html#grammar
crates/ruff_python_parser/src/parser/expression.rs:721
↓ 2 callers
Method
parse_attribute_expression
Parses an attribute expression. # Panics If the parser isn't positioned at a `.` token. See: <https://docs.python.org/3/reference/expressions.html#
crates/ruff_python_parser/src/parser/expression.rs:1129
↓ 2 callers
Function
parse_basic_str
(src: str, pos: Pos, *, multiline: bool)
crates/ruff_benchmark/resources/tomllib/_parser.py:552
↓ 2 callers
Function
parse_block
(block: &Block, strings: &mut TokenStream)
crates/ruff_macros/src/derive_message_formats.rs:22
↓ 2 callers
Function
parse_candidate
Parses a possible link at the start of `input`. Plausible wrapped labels without a closing backtick remain pending; malformed or unsupported forms re
crates/ty_ide/src/docstring/markdown/general/inline.rs:308
↓ 2 callers
Method
parse_class_definition
Parses a class definition. The given `start` offset is the start of either the `def` token or the `@` token if the class definition has decorators.
crates/ruff_python_parser/src/parser/statement.rs:2139
↓ 2 callers
Method
parse_clauses
Parses a sequence of clauses. The parser only continues for as long as it sees the token indicating the start of the specific clause. Unlike [`Parser
crates/ruff_python_parser/src/parser/statement.rs:4050
↓ 2 callers
Method
parse_comma_separated_list_into_vec_with_capacity
Parses a comma separated list of elements into a vector with an initial capacity.
crates/ruff_python_parser/src/parser/mod.rs:768
↓ 2 callers
Method
parse_dotted_name
Parses a dotted name. A dotted name is a sequence of identifiers separated by a single dot.
crates/ruff_python_parser/src/parser/statement.rs:833
↓ 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:700
↓ 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:2957
↓ 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:749
↓ 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
← previous
next →
6,601–6,700 of 31,766, ranked by callers