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
Method
negated_divergent
Negating a divergent marker preserves the marker and flips its materialization, if any.
crates/ty_python_semantic/src/types.rs:2526
↓ 2 callers
Method
negation_is_subtype_of_cached
Return whether the negation of this type is a subtype of `target`, reusing `negated_cache` for type shapes whose negation must still be materialized.
crates/ty_python_semantic/src/types.rs:11099
↓ 2 callers
Function
nested
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF050.py:21
↓ 2 callers
Function
nested
()
crates/ruff_linter/resources/test/fixtures/pylint/await_outside_async.py:5
↓ 2 callers
Method
nested_string_quote_style
(&self)
crates/ruff_python_formatter/src/options.rs:155
↓ 2 callers
Function
nested_union_members
The members in which a bare type variable from the same union occurs inside another type. For example, in `T | list[T] | None` only `list[T]` has this
crates/ty_python_semantic/src/types/call/bind.rs:8289
↓ 2 callers
Method
new_node
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constrai
crates/ty_python_semantic/src/types/constraints/variables.rs:124
↓ 2 callers
Function
newline_diagnostic
Possible diagnostic, with fix, for too many newlines in cell or source file
crates/ruff_linter/src/rules/pycodestyle/rules/too_many_newlines_at_end_of_file.rs:103
↓ 2 callers
Method
next
(&mut self)
crates/ty_module_resolver/src/resolve.rs:1170
↓ 2 callers
Method
next
(&mut self)
crates/ruff_unicode_names2_generator/src/util.rs:33
↓ 2 callers
Method
next
(&mut self)
crates/ruff_unicode_names2_generator/src/trie.rs:77
↓ 2 callers
Method
next
(&mut self)
crates/ruff_python_ast/src/identifier.rs:220
↓ 2 callers
Method
next
(&mut self)
crates/ty_python_core/src/use_def.rs:1561
↓ 2 callers
Method
next
(&mut self)
crates/mdtest/src/parser.rs:183
↓ 2 callers
Method
next
(&mut self)
crates/ty_python_semantic/src/types/mro.rs:706
↓ 2 callers
Method
next
(&mut self)
crates/ruff_linter/src/rules/flake8_tidy_imports/rules/banned_module_level_imports.rs:147
↓ 2 callers
Method
next_non_trivia_token
Returns the next non-trivia token without adding it to the token vector.
crates/ruff_python_parser/src/token_source.rs:186
↓ 2 callers
Method
next_non_variadic
(&mut self)
crates/ruff_python_ast/src/nodes.rs:3574
↓ 2 callers
Method
next_siblings
(&self)
crates/ruff_python_ast/src/traversal.rs:73
↓ 2 callers
Method
next_source
Move to the next parameter in the `source` parameter iterator, [`None`] if the iterator is exhausted.
crates/ty_python_semantic/src/types/signatures.rs:3143
↓ 2 callers
Method
next_token
(&mut self)
crates/ruff_python_ast/src/identifier.rs:175
↓ 2 callers
Method
no_instance_fallback
Only look up the attribute on the meta-type. If false - Look up the attribute on the meta-type, but fall back to attributes on the instance if the me
crates/ty_python_semantic/src/types.rs:1408
↓ 2 callers
Method
node
Returns the underlying node.
crates/ruff_python_formatter/src/comments/node_key.rs:22
↓ 2 callers
Method
node
Returns the covering node found.
crates/ruff_python_ast/src/find_node.rs:72
↓ 2 callers
Method
node_support_id
(&self, node: NodeId)
crates/ty_python_semantic/src/types/constraints.rs:1659
↓ 2 callers
Function
nominal_intersection_bound
Recognize a single nominal positive and nominal exclusions, without alias, type-variable, or enum-literal operands. These classes can still inherit sp
crates/ty_python_semantic/src/types/relation.rs:268
↓ 2 callers
Function
non_alias_assignment
( db: &'db dyn Db, definition: Definition<'db>, ty: Type<'db>, )
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:174
↓ 2 callers
Function
non_default_follows_default
Returns `true` if a type variable without a default follows a type variable with a default. In a PEP 695 type parameter list this is a syntax error:
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:391
↓ 2 callers
Function
non_lowercase_variable_in_function
N806
crates/ruff_linter/src/rules/pep8_naming/rules/non_lowercase_variable_in_function.rs:55
↓ 2 callers
Function
non_object_protocol_member_count
( db: &'db dyn Db, interface: ProtocolInterface<'db>, )
crates/ty_python_semantic/src/types/protocol_class.rs:3506
↓ 2 callers
Function
non_recursive_protocol_interface
( db: &'db dyn Db, interface: ProtocolInterface<'db>, protocol: ProtocolClass<'db>, receiver_t
crates/ty_python_semantic/src/types/instance.rs:1405
↓ 2 callers
Method
nonlocal
Given a `name` that has been declared `nonlocal`, return the [`ScopeId`] and [`BindingId`] to which it refers. Unlike `global` declarations, for whic
crates/ruff_python_semantic/src/model.rs:1788
↓ 2 callers
Function
noop
Return a no-op edit for the given name.
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs:162
↓ 2 callers
Function
noop
Return a no-op edit for the given name.
crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs:177
↓ 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:2055
↓ 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:1821
↓ 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:2003
↓ 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:452
↓ 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:332
↓ 2 callers
Function
o
()
crates/ruff_linter/resources/test/fixtures/flake8_type_checking/TC001_future.py:64
↓ 2 callers
Function
object_member_names
(db: &'db dyn Db, program: Program<'db>)
crates/ty_python_semantic/src/types/protocol_class.rs:3490
↓ 2 callers
Function
on_conditional_branch
Check if a node is part of a conditional branch.
crates/ruff_python_ast/src/helpers.rs:1284
↓ 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:1390
↓ 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:189
↓ 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:240
↓ 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:1166
↓ 2 callers
Function
optional_value
(log: str, pattern: str, label: str)
scripts/collect_ty_ecosystem_run_metadata.py:83
↓ 2 callers
Method
options
(&self)
crates/ruff_db/src/vendored.rs:506
↓ 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:1587
↓ 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
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:1629
↓ 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:2751
↓ 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:783
↓ 2 callers
Method
own_synthesized_member_with_kind
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, specialization: Option
crates/ty_python_semantic/src/types/class/static_literal.rs:1815
↓ 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
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:6017
↓ 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:1614
↓ 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:839
↓ 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
← previous
next →
6,501–6,600 of 31,562, ranked by callers