MCPcopy Create free account

hub / github.com/astral-sh/ruff / functions

Functions31,766 in github.com/astral-sh/ruff

↓ 1 callersMethodhandle_node_delete
(&mut self, expr: &'a Expr)
crates/ruff_linter/src/checkers/ast/mod.rs:3024
↓ 1 callersMethodhandle_node_store
(&mut self, id: &'a str, expr: &Expr)
crates/ruff_linter/src/checkers/ast/mod.rs:2915
↓ 1 callersFunctionhandle_non_finite_float_special_case
Handle the special case for non-finite float literals
crates/ruff_linter/src/rules/refurb/rules/unnecessary_from_float.rs:273
↓ 1 callersFunctionhandle_option
Parse an `#[option(doc="...", default="...", value_type="...", example="...")]` attribute and return data in the form of an `OptionField`.
crates/ruff_macros/src/config.rs:157
↓ 1 callersFunctionhandle_option_group
For a field with type `Option<Foobar>` where `Foobar` itself is a struct deriving `ConfigurationOptions`, create code that calls retrieves options fro
crates/ruff_macros/src/config.rs:108
↓ 1 callersFunctionhandle_own_line_comment_after_branch
Determine where to attach an own line comment after a branch depending on its indentation
crates/ruff_python_formatter/src/comments/placement.rs:702
↓ 1 callersFunctionhandle_own_line_comment_around_body
Handles own-line comments around a body (at the end of the body, at the end of the header preceding the body, or between bodies): ```python for x in
crates/ruff_python_formatter/src/comments/placement.rs:468
↓ 1 callersFunctionhandle_own_line_comment_between_branches
Handles own line comments between two branches of a node. ```python for x in y: pass # This one ... else: print("I have no comments") # ... but not th
crates/ruff_python_formatter/src/comments/placement.rs:588
↓ 1 callersFunctionhandle_own_line_comment_between_statements
Handles own-line comments between statements. If an own-line comment is between two statements, it's treated as a leading comment of the following sta
crates/ruff_python_formatter/src/comments/placement.rs:530
↓ 1 callersFunctionhandle_parameter_comment
Associate comments that come before the `:` starting the type annotation or before the parameter's name for unannotated parameters as leading paramete
crates/ruff_python_formatter/src/comments/placement.rs:855
↓ 1 callersFunctionhandle_parameters_separator_comment
Attaches comments for the positional-only parameters separator `/` or the keywords-only parameters separator `*` as dangling comments to the enclosing
crates/ruff_python_formatter/src/comments/placement.rs:826
↓ 1 callersFunctionhandle_parenthesized_comment
Handle parenthesized comments. A parenthesized comment is a comment that appears within a parenthesis, but not within the range of the expression encl
crates/ruff_python_formatter/src/comments/placement.rs:72
↓ 1 callersFunctionhandle_part
Convert a [`PercentFormat`] struct into a `String`.
crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs:120
↓ 1 callersFunctionhandle_pattern_keyword_comment
Handles comments between a pattern keyword's identifier and value: ```python case Point2D( x # dangling = # dangling # dangling 1 ) ```
crates/ruff_python_formatter/src/comments/placement.rs:1284
↓ 1 callersFunctionhandle_pattern_match_as_comment
Handles trailing comments after the `as` keyword of a pattern match item: ```python case ( pattern as # dangling end of line comment # dangling own l
crates/ruff_python_formatter/src/comments/placement.rs:1658
↓ 1 callersFunctionhandle_pattern_match_class_comment
Handles trailing comments between the class name and its arguments in: ```python case ( Pattern # dangling (...) ): ... ```
crates/ruff_python_formatter/src/comments/placement.rs:1637
↓ 1 callersFunctionhandle_pattern_match_mapping_comment
Handles trailing comments after the `**` in a pattern match item. The comments can either appear between the `**` and the identifier, or after the ide
crates/ruff_python_formatter/src/comments/placement.rs:1715
↓ 1 callersFunctionhandle_pattern_match_star_comment
Handles dangling comments between the `*` token and identifier of a pattern match star: ```python case [ ..., # dangling end of line comment # dangli
crates/ruff_python_formatter/src/comments/placement.rs:1699
↓ 1 callersMethodhandle_response
( self, client: &Client, session: &mut Session, response: lsp_server::Response
crates/ty_server/src/session/client.rs:316
↓ 1 callersFunctionhandle_single_name
(checker: &Checker, argnames: &Expr, value: &Expr, argvalues: &Expr)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:696
↓ 1 callersFunctionhandle_slice_comments
Handles the attaching comments left or right of the colon in a slice as trailing comment of the preceding node or leading comment of the following nod
crates/ruff_python_formatter/src/comments/placement.rs:1133
↓ 1 callersFunctionhandle_trailing_binary_expression_left_or_operator_comment
Handles comments between the left side and the operator of a binary expression (trailing comments of the left), and trailing end-of-line comments that
crates/ruff_python_formatter/src/comments/placement.rs:904
↓ 1 callersFunctionhandle_trailing_binary_like_comment
Attaches comments between two bool or compare expression operands to the preceding operand if the comment is before the operator. ```python a = ( 5 >
crates/ruff_python_formatter/src/comments/placement.rs:994
↓ 1 callersFunctionhandle_trailing_expression_starred_star_end_of_line_comment
Handles trailing comments on between the `*` of a starred expression and the expression itself. For example, attaches the first two comments here as l
crates/ruff_python_formatter/src/comments/placement.rs:1569
↓ 1 callersFunctionhandle_trailing_implicit_concatenated_string_comment
Handle end-of-line comments for parenthesized implicitly concatenated strings when used in a `FormatStatementLastExpression` context: ```python a = (
crates/ruff_python_formatter/src/comments/placement.rs:2334
↓ 1 callersFunctionhandle_trailing_module_comment
Handles trailing comments after the last statement in a module. Ruff's parser sets the module range to exclude trailing comments and the result is tha
crates/ruff_python_formatter/src/comments/placement.rs:1040
↓ 1 callersFunctionhandle_unary_op_comment
Move an end-of-line comment between a unary op and its operand after the operand by marking it as dangling. For example, given: ```python ( not # c
crates/ruff_python_formatter/src/comments/placement.rs:1938
↓ 1 callersFunctionhandle_value_rows
( checker: &Checker, elts: &[Expr], values_type: types::ParametrizeValuesType, values_row_type
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:801
↓ 1 callersFunctionhandle_with_comment
Attach an enclosed end-of-line comment to a [`ast::StmtWith`]. For example, given: ```python with ( # foo CtxManager1() as example1, CtxManager2() as
crates/ruff_python_formatter/src/comments/placement.rs:2166
↓ 1 callersFunctionhandle_with_item_comment
Handles trailing own line comments before the `as` keyword of a with item and end of line comments that are on the same line as the `as` keyword: ```
crates/ruff_python_formatter/src/comments/placement.rs:1599
↓ 1 callersMethodhandle_workspace_configuration_request
( &mut self, request_id: RequestId, params: &ConfigurationParams, )
crates/ty_server/tests/e2e/main.rs:800
↓ 1 callersMethodhandled_exceptions
( &self, module: &'ast ParsedModuleRef, )
crates/ty_python_core/src/definition.rs:1623
↓ 1 callersFunctionhardcoded_bind_all_interfaces
S104
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_bind_all_interfaces.rs:42
↓ 1 callersFunctionhardcoded_password_default
S107
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_password_default.rs:76
↓ 1 callersFunctionhardcoded_password_func_arg
S106
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_password_func_arg.rs:56
↓ 1 callersFunctionhardcoded_sql_expression
S608
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_sql_expression.rs:60
↓ 1 callersFunctionhardcoded_string_charset_literal
FURB156
crates/ruff_linter/src/rules/refurb/rules/hardcoded_string_charset.rs:51
↓ 1 callersFunctionhardcoded_tmp_directory
S108
crates/ruff_linter/src/rules/flake8_bandit/rules/hardcoded_tmp_directory.rs:61
↓ 1 callersMethodhas
Returns `true` if this scope has a binding with the given name.
crates/ruff_python_semantic/src/scope.rs:93
↓ 1 callersMethodhas_all_negative_counterexample
With every atom on this path false, the diagram reaches its false terminal. Add those assignments to the path and check whether they can hold together
crates/ty_python_semantic/src/types/constraints/solutions.rs:182
↓ 1 callersFunctionhas_all_protocol_members_defined
Protocol compatibility can only succeed if every required member is present. Check that necessary condition up front so we can avoid expensive per-me
crates/ty_python_semantic/src/types/protocol_class.rs:3826
↓ 1 callersFunctionhas_before_or_plain_field_validator
( db: &'db dyn Db, class: StaticClassLiteral<'db>, field_name: Name, )
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:1056
↓ 1 callersMethodhas_binding_errors
Returns whether there were any errors binding this call site. This is true if either: - No overloads matched (all had type/arity errors). - A matchin
crates/ty_python_semantic/src/types/call/bind.rs:4614
↓ 1 callersFunctionhas_binding_in_init
Returns `true` if `name` has any attribute assignment (`self.<name> = ...`) in an `__init__` method of the class whose body scope is `class_body_scope
crates/ty_python_semantic/src/types/infer/builder/post_inference/static_class.rs:1621
↓ 1 callersFunctionhas_bound_prefix
Check whether a member prefix has a binding without inferring its value when possible.
crates/ty_python_semantic/src/place.rs:821
↓ 1 callersFunctionhas_brackets
(possible_fstring: &str)
crates/ruff_linter/src/rules/ruff/rules/missing_fstring_syntax.rs:279
↓ 1 callersFunctionhas_break_or_continue
Returns `true` if a `break` or `continue` statement is present in `body`.
crates/ruff_linter/src/rules/perflint/rules/try_except_in_loop.rs:115
↓ 1 callersFunctionhas_comment_break
Return `true` if a [`Stmt`] is preceded by a "comment break"
crates/ruff_linter/src/rules/isort/helpers.rs:36
↓ 1 callersFunctionhas_complex_conversion_specifier
Check if a conversion specifier has complex flags or precision that make `oct()` or `hex()` necessary. Returns `true` if any of these conditions are
crates/ruff_linter/src/rules/ruff/rules/logging_eager_conversion.rs:244
↓ 1 callersMethodhas_context_manager_exception_checkpoint
Returns whether an enclosing context manager has already seen an exception checkpoint.
crates/ty_python_core/src/builder/except_handlers.rs:170
↓ 1 callersFunctionhas_contextmanager_decorator
(checker: &Checker, function_def: &StmtFunctionDef)
crates/ruff_linter/src/rules/ruff/rules/fallible_context_manager.rs:73
↓ 1 callersFunctionhas_control_flow
Returns `true` if a [`Stmt`] contains a `return`, `break`, or `continue`.
crates/ruff_linter/src/rules/tryceratops/rules/type_check_without_type_error.rs:72
↓ 1 callersFunctionhas_default_copy_semantics
Returns `true` if the given class has "default copy" semantics. For example, Pydantic `BaseModel` and `BaseSettings` subclasses copy attribute defaul
crates/ruff_linter/src/rules/ruff/helpers.rs:201
↓ 1 callersFunctionhas_default_pytest_constructors
Returns whether `class` inherits both constructors from `object`.
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:411
↓ 1 callersMethodhas_diagnostics
(&self)
crates/ty_python_semantic/src/types/context.rs:275
↓ 1 callersMethodhas_disjoint_literal_argument
A disjoint literal argument rules out an overload regardless of how its type variables are specialized. For example, a `TypedDict` lookup can skip ove
crates/ty_python_semantic/src/types/call/bind.rs:9467
↓ 1 callersFunctionhas_dunder_method
Returns `true` if the class has `__str__` method.
crates/ruff_linter/src/rules/flake8_django/rules/model_without_dunder_str.rs:73
↓ 1 callersMethodhas_empty_enum_complement
Return `true` when an intersection excludes every member of an enum class. This recognizes enum complements that have become empty, such as `Color &
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:2114
↓ 1 callersFunctionhas_exact_runtime_class
Returns whether every inhabitant of `ty` has the same nominal runtime class. This is intentionally conservative: a false negative only widens a binar
crates/ty_python_semantic/src/types/call.rs:59
↓ 1 callersMethodhas_expandable_variadic
Whether a starred positional argument can expand into alternative types.
crates/ty_python_semantic/src/types/call/arguments.rs:960
↓ 1 callersMethodhas_expanding_cycle
( &self, types: &FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>, identity: BoundTypeV
crates/ty_python_semantic/src/types/generics.rs:3279
↓ 1 callersFunctionhas_float
(expr: &Expr, semantic: &SemanticModel)
crates/ruff_linter/src/rules/ruff/rules/float_equality_comparison.rs:150
↓ 1 callersFunctionhas_format_spec_with_opposite_quote
( elements: &InterpolatedStringElements, flags: AnyStringFlags, context: &PyFormatCont
crates/ruff_python_formatter/src/string/normalize.rs:1040
↓ 1 callersMethodhas_future_annotations
Checks if there is an import of `__future__.annotations` in the global scope, which affects the logic for type inference.
crates/ty_python_core/src/lib.rs:800
↓ 1 callersMethodhas_generic_instance_attribute
Whether class access exposes an instance attribute whose type depends on the class's type parameters. Specializing a class does not give it separate a
crates/ty_python_semantic/src/types.rs:5960
↓ 1 callersMethodhas_gradual_union_evidence
Conservatively checks whether union matching may discard gradual evidence. The formal type limits which gradual types we look for in the actual type;
crates/ty_python_semantic/src/types/generics.rs:4044
↓ 1 callersFunctionhas_identifier_boundaries
(source: &[u8], start: usize, end: usize)
crates/ruff_python_trivia/src/name_matcher.rs:99
↓ 1 callersMethodhas_implicit_dunder_init_is_possibly_unbound
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:964
↓ 1 callersMethodhas_implicit_dunder_new_is_possibly_unbound
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:960
↓ 1 callersMethodhas_implicit_instance_attribute
Does a method establish instance storage for an attribute already typed by the class?
crates/ty_python_semantic/src/types/class/implicit_attributes.rs:499
↓ 1 callersFunctionhas_implicit_return
(checker: &Checker, stmt: &Stmt)
crates/ruff_linter/src/rules/flake8_return/rules/function.rs:489
↓ 1 callersMethodhas_implicit_return
Returns `true` if the [`Terminal`] behavior includes at least one implicit `return` path.
crates/ruff_python_semantic/src/analyze/terminal.rs:39
↓ 1 callersMethodhas_implicit_upper_bound
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/bound_super.rs:45
↓ 1 callersMethodhas_incompatible_generic_base
( self, db: &'db dyn Db, other: Self, specializations_are_disjoint: impl Fn(Sp
crates/ty_python_semantic/src/types/class.rs:1712
↓ 1 callersMethodhas_inferred_type
Whether inference supplied a type for this variable, before applying defaults.
crates/ty_python_semantic/src/types/generics.rs:2606
↓ 1 callersFunctionhas_inherited_dataclass_field_order_violation
Returns whether the same default-before-required field pair already violates an ancestor's generated constructor ordering. ```python from dataclasses
crates/ty_python_semantic/src/types/infer/builder/post_inference/static_class.rs:1250
↓ 1 callersMethodhas_instance_dictionary
Returns whether instance dictionary storage exists or cannot be ruled out.
crates/ty_python_semantic/src/types/class/slots.rs:511
↓ 1 callersMethodhas_intersection_disjuncts
(&self)
crates/ty_python_semantic/src/types/narrow.rs:1206
↓ 1 callersMethodhas_invalid_syntax
Returns `true` if the parsed source code is invalid i.e., it has [`ParseError`]s. Note that this does not include version-related [`UnsupportedSyntax
crates/ruff_python_parser/src/lib.rs:447
↓ 1 callersMethodhas_invariant_return_difference
Conservatively checks whether two inferred returns differ in an invariant component. Matching tuple positions and generic arguments can vary independe
crates/ty_python_semantic/src/types/call/bind.rs:6459
↓ 1 callersFunctionhas_known_identity_comparison_semantics
Return whether `ty` is a singleton whose comparison uses object identity semantics.
crates/ty_python_semantic/src/types/equality.rs:2113
↓ 1 callersMethodhas_known_type_metaclass
Return whether this class is known to have `type` as its runtime metaclass. Built-in and extension types can inherit from collection ABCs only in the
crates/ty_python_semantic/src/types/class/known.rs:186
↓ 1 callersMethodhas_label
(&self)
crates/ruff_annotate_snippets/src/renderer/render.rs:2508
↓ 1 callersMethodhas_later_positional_input
(&self, argument_index: usize)
crates/ty_python_semantic/src/types/call/bind.rs:5159
↓ 1 callersFunctionhas_legacy_namespace_declaration
(db: &dyn Db, init: PythonFile<'_>)
crates/ty_module_resolver/src/resolve.rs:1708
↓ 1 callersFunctionhas_local_dunder_class_var_ref
Returns `true` if the callable body contains load references to `__class__` or `super` without a local binding. This indicates that the callable reli
crates/ruff_linter/src/rules/pyupgrade/rules/super_call_with_parameters.rs:303
↓ 1 callersFunctionhas_magic_trailing_comma
(with: &StmtWith, context: &PyFormatContext)
crates/ruff_python_formatter/src/statement/stmt_with.rs:323
↓ 1 callersFunctionhas_metaclass_new_signature
Check if a class has a metaclass-like `__new__` method signature. A metaclass-like `__new__` method signature has: 1. Exactly 5 parameters (including
crates/ruff_python_semantic/src/analyze/class.rs:331
↓ 1 callersFunctionhas_missing_generic_nominal_bound
Return whether a generic target positive has a static nominal origin missing from every source positive. Return `false` unless the source positives ar
crates/ty_python_semantic/src/types/relation.rs:215
↓ 1 callersFunctionhas_nested_block
Returns `true` if the given statement is a leaf node.
crates/ruff_linter/src/rules/pylint/rules/too_many_nested_blocks.rs:97
↓ 1 callersMethodhas_nested_gradual_evidence
( &self, formal: Type<'db>, actual: Type<'db>, seen_classes: &RefCell<FxHashSe
crates/ty_python_semantic/src/types/generics.rs:4101
↓ 1 callersFunctionhas_nested_union
Returns `true` if a union expression contains nested sub-unions that would need to be flattened by a fix. For PEP 604 unions (`a | b | c`), the AST i
crates/ruff_linter/src/rules/ruff/rules/none_not_at_end_of_union.rs:60
↓ 1 callersMethodhas_no_syntax_errors
Returns `true` if the parsed source code does not contain any [`ParseError`]s *or [`UnsupportedSyntaxError`]s. See [`Parsed::has_valid_syntax`] for a
crates/ruff_python_parser/src/lib.rs:455
↓ 1 callersMethodhas_no_valid_solutions
Returns whether no specialization satisfying the type variables' upper bounds and constraints can satisfy this constraint set. Unlike [`Self::is_neve
crates/ty_python_semantic/src/types/constraints.rs:579
↓ 1 callersFunctionhas_non_default_output_target
( semantic: &SemanticModel, call: &ast::ExprCall, keyword: &str, )
crates/ruff_linter/src/rules/flake8_print/rules/print_call.rs:164
↓ 1 callersMethodhas_non_self_typevar
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:115
↓ 1 callersFunctionhas_non_trivia_tokens_till
Returns `true` if there are any non-trivia tokens from the given token iterator till the given end offset.
crates/ruff_linter/src/rules/pycodestyle/rules/compound_statements.rs:318
↓ 1 callersMethodhas_nonempty_slots
Returns whether this class definitely introduces at least one instance slot.
crates/ty_python_semantic/src/types/class/slots.rs:255
↓ 1 callersMethodhas_nonlocal_binding
(&self, _name: &str)
crates/ruff_python_parser/tests/fixtures.rs:652
↓ 1 callersFunctionhas_odd_consecutive_backslashes
(mut itr: impl Iterator<Item = u8>)
crates/ruff_linter/src/rules/flake8_implicit_str_concat/rules/implicit.rs:265
← previousnext →10,001–10,100 of 31,766, ranked by callers