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
↓ 1 callers
Function
match_consecutive_assignments
Match consecutive assignment statements. Also see the `repeated_append` rule for a similar use case.
crates/ruff_linter/src/rules/pylint/rules/swap_with_temporary_variable.rs:113
↓ 1 callers
Function
match_dict
(expression: &'a mut Expression<'b>)
crates/ruff_linter/src/cst/matchers.rs:97
↓ 1 callers
Method
match_directory
Returns `true` if the path to a directory is definitely excluded and `false` otherwise.
crates/ty_project/src/glob/exclude.rs:33
↓ 1 callers
Method
match_directory
Check whether a directory or any of its children can be matched by any of the globs. This never returns `false` if any child matches, but it may retu
crates/ty_project/src/glob/include.rs:95
↓ 1 callers
Method
match_directory_impl
(&self, path: &SystemPath)
crates/ty_project/src/glob/include.rs:99
↓ 1 callers
Function
match_docstring_end
Find the end of the docstring (first string statement).
crates/ruff_python_importer/src/insertion.rs:360
↓ 1 callers
Function
match_else_return
If a `Stmt::For` contains an `else` with a single boolean `return`, return the [`Terminal`] representing that `return`. For example, matches the `ret
crates/ruff_linter/src/rules/flake8_simplify/rules/reimplemented_builtin.rs:307
↓ 1 callers
Function
match_encoded_variable
(func: &Expr)
crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_encode_utf8.rs:71
↓ 1 callers
Function
match_encoding_arg
Return the encoding argument to an `encode` call, if it can be determined to be a UTF-8-equivalent encoding.
crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_encode_utf8.rs:106
↓ 1 callers
Function
match_eq_target
(expr: &Expr)
crates/ruff_linter/src/rules/flake8_simplify/rules/ast_bool_op.rs:469
↓ 1 callers
Function
match_exit_stack
Return `true` if the current expression is nested in an `exit_stack.enter_context` call.
crates/ruff_linter/src/rules/flake8_simplify/rules/open_file_with_context_handler.rs:87
↓ 1 callers
Function
match_extraneous_parentheses
See: https://github.com/asottile/pyupgrade/blob/97ed6fb3cf2e650d4f762ba231c3f04c41797710/pyupgrade/_main.py#L148
crates/ruff_linter/src/rules/pyupgrade/rules/extraneous_parentheses.rs:44
↓ 1 callers
Function
match_fields_and_keywords
Match the fields and class keywords from a `TypedDict` call.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs:262
↓ 1 callers
Function
match_file
()
crates/ty_project/src/glob/include.rs:410
↓ 1 callers
Function
match_formatted_string
( expression: &'a mut Expression<'b>, )
crates/ruff_linter/src/cst/matchers.rs:157
↓ 1 callers
Function
match_formatted_string_expression
( formatted_string_content: &'a mut FormattedStringContent<'b>, )
crates/ruff_linter/src/cst/matchers.rs:167
↓ 1 callers
Function
match_full_slice
Match `del expr[:]` where `expr` is a list.
crates/ruff_linter/src/rules/refurb/rules/delete_full_slice.rs:81
↓ 1 callers
Function
match_generator_exp
( expression: &'a Expression<'b>, )
crates/ruff_linter/src/cst/matchers.rs:123
↓ 1 callers
Function
match_if
(statement: &'a mut Statement<'b>)
crates/ruff_linter/src/cst/matchers.rs:215
↓ 1 callers
Function
match_import
( statement: &'a mut Statement<'b>, )
crates/ruff_linter/src/cst/matchers.rs:25
↓ 1 callers
Function
match_index_increment
If the statement is an index increment statement (e.g., `i += 1`), return the name of the index variable.
crates/ruff_linter/src/rules/flake8_simplify/rules/enumerate_for_loop.rs:172
↓ 1 callers
Function
match_iteration_target
Return the [`IterationTarget`] of an expression, if the expression can be sliced into (i.e., is a list comprehension, or call to `list` or `tuple`).
crates/ruff_linter/src/rules/ruff/rules/unnecessary_iterable_allocation_for_first_element.rs:161
↓ 1 callers
Method
match_keyword_variadic
( &mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, argument_index: u
crates/ty_python_semantic/src/types/call/bind.rs:5495
↓ 1 callers
Function
match_lambda
(expression: &'a Expression<'b>)
crates/ruff_linter/src/cst/matchers.rs:149
↓ 1 callers
Method
match_line
Check a slice of [`Diagnostic`]s against a slice of [`UnparsedAssertion`]s. Return vector of [`Unmatched`] for any unmatched diagnostics or assertion
crates/mdtest/src/matcher.rs:335
↓ 1 callers
Function
match_list_comp
(expression: &'a Expression<'b>)
crates/ruff_linter/src/cst/matchers.rs:141
↓ 1 callers
Function
match_list_full_slice
Matches `obj[:]` where `obj` is a list.
crates/ruff_linter/src/rules/refurb/rules/slice_copy.rs:86
↓ 1 callers
Function
match_literal_type
Return the [`ExprType`] of an [`Expr`] if it is a literal (e.g., an `int`, like `1`, or a `bool`, like `True`).
crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_literal_union.rs:154
↓ 1 callers
Function
match_loop
(stmt: &Stmt)
crates/ruff_linter/src/rules/flake8_simplify/rules/reimplemented_builtin.rs:250
↓ 1 callers
Function
match_model_import
(name: &str, expr: &Expr, semantic: &SemanticModel)
crates/ruff_linter/src/rules/pep8_naming/helpers.rs:109
↓ 1 callers
Function
match_module
(module_text: &str)
crates/ruff_linter/src/cst/matchers.rs:11
↓ 1 callers
Function
match_mutation
Check if a statement is (probably) a modification to the list assigned to the given identifier. For example, `foo.append(bar)` would return `true` if
crates/ruff_linter/src/rules/perflint/rules/unnecessary_list_cast.rs:189
↓ 1 callers
Function
match_named_tuple_assign
Return the typename, args, keywords, and base class.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_named_tuple_functional_to_class.rs:141
↓ 1 callers
Function
match_not_implemented
(expr: &Expr)
crates/ruff_linter/src/rules/pyflakes/rules/raise_not_implemented.rs:55
↓ 1 callers
Function
match_open_args
Match positional arguments. Return expression for the file name and open mode.
crates/ruff_linter/src/rules/refurb/helpers.rs:352
↓ 1 callers
Method
match_quality
(&self, name: &str)
crates/ty_ide/src/completion.rs:1639
↓ 1 callers
Function
match_read_call
Match `x.read()` expression and return expression `x` on success.
crates/ruff_linter/src/rules/refurb/rules/read_whole_file.rs:156
↓ 1 callers
Function
match_remove
Match `if` body to be `name.remove(expr)`, returns a tuple of (`expr`, `name`) on success.
crates/ruff_linter/src/rules/refurb/rules/check_and_remove_from_set.rs:143
↓ 1 callers
Function
match_reveal_type_diagnostic
( expected_reveal_type: Option<&str>, expected_reveal_type_message: Option<&str>, unmatched: &mut
crates/mdtest/src/matcher.rs:458
↓ 1 callers
Function
match_sibling_return
If a `Stmt::For` is followed by a boolean `return`, return the [`Terminal`] representing that `return`. For example, matches the `return` in: ```pyth
crates/ruff_linter/src/rules/flake8_simplify/rules/reimplemented_builtin.rs:347
↓ 1 callers
Function
match_simple_comprehension
Returns the [`Expr`] target for a comprehension, if the comprehension is "simple" (e.g., `x` for `[i for i in x]`).
crates/ruff_linter/src/rules/ruff/rules/unnecessary_iterable_allocation_for_first_element.rs:265
↓ 1 callers
Function
match_slice_info
Return the argument name, lower bound, and upper bound for an expression, if it's a slice.
crates/ruff_linter/src/rules/ruff/rules/zip_instead_of_pairwise.rs:68
↓ 1 callers
Function
match_sources
Returns the source path with respect to which the module `name` should be considered first party, or `None` if no path is found. # Examples - The mo
crates/ruff_linter/src/rules/isort/categorize.rs:170
↓ 1 callers
Function
match_target
Given a target and value, find the value that's assigned to the given symbol.
crates/ruff_python_semantic/src/analyze/typing.rs:1311
↓ 1 callers
Function
match_to_datetime
Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. Raises ValueError if the match does not correspond to a valid date o
crates/ruff_benchmark/resources/tomllib/_re.py:52
↓ 1 callers
Function
match_to_localtime
(match: re.Match)
crates/ruff_benchmark/resources/tomllib/_re.py:98
↓ 1 callers
Function
match_to_number
(match: re.Match, parse_float: ParseFloat)
crates/ruff_benchmark/resources/tomllib/_re.py:104
↓ 1 callers
Function
match_token_after
Return the [`TextRange`] of the token after the next match of the predicate, skipping over any bracketed expressions.
crates/ruff_linter/src/rules/pyflakes/rules/unused_variable.rs:97
↓ 1 callers
Function
match_token_before
Return the [`TextRange`] of the token before the next match of the predicate
crates/ruff_linter/src/rules/pyflakes/rules/unused_variable.rs:83
↓ 1 callers
Function
match_token_or_closing_brace
Return the [`TextRange`] of the token matching the predicate or the first mismatched bracket, skipping over any bracketed expressions.
crates/ruff_linter/src/rules/pyflakes/rules/unused_variable.rs:129
↓ 1 callers
Function
match_typed_dict_assign
Return the class name, arguments, keywords and base class for a `TypedDict` assignment.
crates/ruff_linter/src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs:126
↓ 1 callers
Method
match_typed_dict_openness
Match the possible arbitrary keyword arguments represented by a `TypedDict`'s openness. Explicit extra items can constrain named parameters without s
crates/ty_python_semantic/src/types/call/bind.rs:5573
↓ 1 callers
Function
match_unittest_context_methods
Return `true` if the current expression is nested in a call to one of the unittest context manager methods: `cls.enterClassContext()`, `self.enterCont
crates/ruff_linter/src/rules/flake8_simplify/rules/open_file_with_context_handler.rs:117
↓ 1 callers
Method
match_unpacked_variadic
Checks the positional requirements encoded inside an unpacked variadic annotation. Unlike ordinary `*args`, an unpacked tuple can require arguments a
crates/ty_python_semantic/src/types/call/bind.rs:5638
↓ 1 callers
Method
match_variadic
Match a variadic argument to the remaining positional, standard or variadic parameters.
crates/ty_python_semantic/src/types/call/bind.rs:5348
↓ 1 callers
Function
match_with
(statement: &'a mut Statement<'b>)
crates/ruff_linter/src/cst/matchers.rs:203
↓ 1 callers
Function
match_write_call
Match `x.write(foo)` expression and return expression `x` and `foo` on success.
crates/ruff_linter/src/rules/refurb/rules/write_whole_file.rs:170
↓ 1 callers
Method
matched_class_pattern_subject_type
( &mut self, kind: &'pattern ClassPatternPredicateKind<'db>, subject_ty: Type<'db>,
crates/ty_python_semantic/src/types/narrow.rs:2766
↓ 1 callers
Method
matched_class_pattern_subject_type_for_context
( &mut self, kind: &'pattern ClassPatternPredicateKind<'db>, context: &ClassPatternCon
crates/ty_python_semantic/src/types/narrow.rs:2782
↓ 1 callers
Method
matched_mapping_pattern_subject_type
( &mut self, kind: &'pattern MappingPatternPredicateKind<'db>, subject_ty: Type<'db>,
crates/ty_python_semantic/src/types/narrow.rs:2980
↓ 1 callers
Method
matched_or_pattern_subject_type
( &mut self, patterns: &'pattern [PatternPredicateKind<'db>], subject_ty: Type<'db>,
crates/ty_python_semantic/src/types/narrow.rs:2375
↓ 1 callers
Method
matched_sequence_pattern_subject_type
( &mut self, kind: &'pattern SequencePatternPredicateKind<'db>, subject_ty: Type<'db>,
crates/ty_python_semantic/src/types/narrow.rs:3061
↓ 1 callers
Method
matches
Check if `assertion` matches any [`Diagnostic`]s in `unmatched`. If so, return `Some` and remove the matched diagnostics from `unmatched`. Otherwise,
crates/mdtest/src/matcher.rs:401
↓ 1 callers
Method
matches
(&self, tested_id: LintId)
crates/ty_python_semantic/src/suppression.rs:530
↓ 1 callers
Method
matches
Whether the comment "matches" another comment, based on indentation and suppressed codes. Expects a "forward search" for matches, ie, will only match
crates/ruff_linter/src/suppression.rs:109
↓ 1 callers
Function
matches_comment
(comment: dict[str, Any], pull_request: int, marker: str)
scripts/publish_pr_report.py:97
↓ 1 callers
Function
matches_constant
(constant: f64, value: f64)
crates/ruff_linter/src/rules/refurb/rules/math_constant.rs:91
↓ 1 callers
Method
matches_file
Returns whether this override applies to the given file path.
crates/ty_project/src/metadata/settings.rs:122
↓ 1 callers
Function
matches_ignoring_indentation
Compares two strings, returning true if they are equal modulo whitespace at the start of each line.
crates/ruff_linter/src/rules/isort/rules/organize_imports.rs:109
↓ 1 callers
Method
matches_source_task
(&self, task_source: &TaskSource)
crates/ty_completion_eval/src/main.rs:112
↓ 1 callers
Method
matches_task
(&self, task: &Task)
crates/ty_completion_eval/src/main.rs:116
↓ 1 callers
Method
matches_tuple_length
(self, actual: TupleLength, expected: i64)
crates/ty_python_semantic/src/types/narrow.rs:1669
↓ 1 callers
Method
matches_value
( &self, literal_expr: LiteralExpressionRef<'_>, unary_op: Option<&UnaryOp>, )
crates/ruff_linter/src/rules/pylint/settings.rs:22
↓ 1 callers
Method
matching
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, preserve_union_altern
crates/ty_python_semantic/src/types/call/arguments.rs:252
↓ 1 callers
Function
matching_pools
(pools: list[Pool], files: list[str])
scripts/pull_request_reviewers.py:76
↓ 1 callers
Function
matching_task_decorator
Return the matched `@task` (or supported `@task.<variant>`) decorator on `function_def`, or `None` if there is none.
crates/ruff_linter/src/rules/airflow/rules/task_implicit_multiple_outputs.rs:115
↓ 1 callers
Method
materialization_changes_requirements
Returns whether a materialization changes any member required by `target`. An unrelated changed member must not prevent an explicitly inherited proto
crates/ty_python_semantic/src/types/instance.rs:1849
↓ 1 callers
Method
materialize_constrained_type_argument
Materializes a constrained covariant or contravariant argument for a relation check. A constrained type variable can only take one of its declared al
crates/ty_python_semantic/src/types/generics.rs:1871
↓ 1 callers
Method
materialize_impl
( self, db: &'db dyn Db, materialization_kind: MaterializationKind, visitor: &
crates/ty_python_semantic/src/types/typevar.rs:434
↓ 1 callers
Method
materialize_type
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>, )
crates/ty_python_semantic/src/types/protocol_class.rs:1514
↓ 1 callers
Method
materialized_interface_member
Returns an effective materialized member without applying the nominal class fallback.
crates/ty_python_semantic/src/types/instance.rs:1999
↓ 1 callers
Method
materialized_origin_property
Returns the nominal origin when a materialized requirement is a property descriptor. Descriptor lookup needs the original property object even though
crates/ty_python_semantic/src/types/instance.rs:1836
↓ 1 callers
Method
materialized_types
The exposed types affected by materialization. Descriptor identity and write presence are fixed by the declaration, so they need not be resolved to co
crates/ty_python_semantic/src/types/protocol_class.rs:1573
↓ 1 callers
Function
materialized_unfold
(db: &'db dyn Db, recursive: RecursiveType<'db>)
crates/ty_python_semantic/src/types/recursive.rs:880
↓ 1 callers
Method
materialized_value_type
( self, db: &'db dyn Db, materialization_kind: MaterializationKind, )
crates/ty_python_semantic/src/types/type_alias.rs:668
↓ 1 callers
Function
math_constant
FURB152
crates/ruff_linter/src/rules/refurb/rules/math_constant.rs:58
↓ 1 callers
Function
max_constructor_and_typevar_depth
Returns the maximum constructor depth of `ty` and the maximum nesting depth of any typevar that it contains. Atomic types and bare typevars have cons
crates/ty_python_semantic/src/types/constraints.rs:2022
↓ 1 callers
Function
max_constructor_and_typevar_depth_impl
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>, _dummy: (),
crates/ty_python_semantic/src/types/constraints.rs:2027
↓ 1 callers
Function
max_iterations
()
crates/ruff_linter/src/test.rs:238
↓ 1 callers
Function
may_be_tuple
Return whether the outer type may be a tuple, without searching nested arguments or members. A recursion cutoff conservatively counts as a possible tu
crates/ty_python_semantic/src/types/tuple/promotion.rs:19
↓ 1 callers
Method
may_contain_configuration
(&self, directory: &SystemPath, project_root: &SystemPath)
crates/ty_project/src/db/changes.rs:502
↓ 1 callers
Function
may_contain_signature_typevar
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, signature: &Signature<'db>, ty: Type<'db>, )
crates/ty_python_semantic/src/types/attribute_write.rs:1480
↓ 1 callers
Function
may_contain_typevar_from
Whether a type may depend on variables from a generic context, including in lazy attributes. Recursive definitions can keep changing their specializa
crates/ty_python_semantic/src/types/visitor.rs:693
↓ 1 callers
Method
may_explain_relation_to
A `false` result guarantees that an eager comparison of these callables would produce an empty error context. The checker suppresses notes while tryi
crates/ty_python_semantic/src/types/signatures.rs:594
↓ 1 callers
Method
may_not
Emit a diagnostic that is uncertain that `iterable_type` is not iterable. `because` should explain why `iterable_type` is likely not iterable.
crates/ty_python_semantic/src/types/iteration.rs:831
↓ 1 callers
Method
may_overlap
(&self, other: &Self)
crates/ty_python_semantic/src/types/equality/enums.rs:1022
↓ 1 callers
Method
may_prefer_declared_type
Returns `true` if this type may contain preferred type mappings when provided as type context during generic call inference. This is the case for any
crates/ty_python_semantic/src/types.rs:2934
↓ 1 callers
Method
may_produce_abstract_method
(&self)
crates/ty_python_semantic/src/types/infer.rs:400
↓ 1 callers
Method
may_share_identity
(&self, db: &'db dyn Db, other: &Self)
crates/ty_python_semantic/src/types/cyclic.rs:831
↓ 1 callers
Method
maybe_apply_argument_index_offset
(mut self, offset: Option<usize>)
crates/ty_python_semantic/src/types/call/bind.rs:10495
← previous
next →
11,601–11,700 of 31,766, ranked by callers