MCPcopy Create free account

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

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

↓ 1 callersFunctionhandle_enclosed_comment
Handle a comment that is enclosed by a node.
crates/ruff_python_formatter/src/comments/placement.rs:192
↓ 1 callersFunctionhandle_end_of_line_comment_around_body
Handle an end-of-line comment around a body.
crates/ruff_python_formatter/src/comments/placement.rs:399
↓ 1 callersFunctionhandle_expr_if_comment
Assign comments between `if` and `test` and `else` and `orelse` as leading to the respective node. ```python x = ( "a" if # leading comment of `True`
crates/ruff_python_formatter/src/comments/placement.rs:1517
↓ 1 callersMethodhandle_implicitly_concatenated_strings
Handles implicitly concatenated strings. # Panics If the length of `strings` is less than 2.
crates/ruff_python_parser/src/parser/expression.rs:1352
↓ 1 callersFunctionhandle_import_from_comment
Attach an enclosed comment to a [`ast::StmtImportFrom`]. For example, given: ```python from foo import ( # comment bar, ) ``` The comment will be a
crates/ruff_python_formatter/src/comments/placement.rs:2058
↓ 1 callersMethodhandle_indentation
(&mut self, indentation: Indentation)
crates/ruff_python_parser/src/lexer.rs:309
↓ 1 callersFunctionhandle_key_value_comment
Handles comments around the `:` in a key-value pair: ```python { key # dangling : # dangling # dangling value } ```
crates/ruff_python_formatter/src/comments/placement.rs:1361
↓ 1 callersFunctionhandle_keyword_comment
Handles comments between a keyword's identifier and value: ```python func( x # dangling = # dangling # dangling 1, # dangling y ) ```
crates/ruff_python_formatter/src/comments/placement.rs:1252
↓ 1 callersFunctionhandle_lambda_comment
Handles comments around the `:` token in a lambda expression. For parameterized lambdas, both the comments between the `lambda` and the parameters, a
crates/ruff_python_formatter/src/comments/placement.rs:1825
↓ 1 callersFunctionhandle_leading_class_with_decorators_comment
Handle comments between decorators and the decorated node. For example, given: ```python @dataclass # comment class Foo(Bar): ... ``` The comment sh
crates/ruff_python_formatter/src/comments/placement.rs:1227
↓ 1 callersFunctionhandle_leading_function_with_decorators_comment
Handles own line comments between the last function decorator and the *header* of the function. It attaches these comments as dangling comments to the
crates/ruff_python_formatter/src/comments/placement.rs:1199
↓ 1 callersFunctionhandle_module_level_own_line_comment_before_class_or_function_comment
Handles own line comments on the module level before a class or function statement. A comment only becomes the leading comment of a class or function
crates/ruff_python_formatter/src/comments/placement.rs:1091
↓ 1 callersFunctionhandle_named_expr_comment
Handles comments around the `:=` token in a named expression (walrus operator). For example, here, `# 1` and `# 2` will be marked as dangling comment
crates/ruff_python_formatter/src/comments/placement.rs:1770
↓ 1 callersMethodhandle_node_delete
(&mut self, expr: &'a Expr)
crates/ruff_linter/src/checkers/ast/mod.rs:3014
↓ 1 callersMethodhandle_node_store
(&mut self, id: &'a str, expr: &Expr)
crates/ruff_linter/src/checkers/ast/mod.rs:2905
↓ 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:276
↓ 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:334
↓ 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 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:3736
↓ 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:999
↓ 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:4577
↓ 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:1545
↓ 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:820
↓ 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:203
↓ 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:272
↓ 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:2074
↓ 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:945
↓ 1 callersMethodhas_expanding_cycle
( &self, generic_context: GenericContext<'db>, types: &FxHashMap<BoundTypeVarIdentity<
crates/ty_python_semantic/src/types/generics.rs:3266
↓ 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:5903
↓ 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:4023
↓ 1 callersFunctionhas_identifier_boundaries
(source: &[u8], start: usize, end: usize)
crates/ruff_python_trivia/src/name_matcher.rs:61
↓ 1 callersMethodhas_implicit_dunder_init_is_possibly_unbound
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:953
↓ 1 callersMethodhas_implicit_dunder_new_is_possibly_unbound
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:949
↓ 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:511
↓ 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:1693
↓ 1 callersMethodhas_inferred_type
Whether inference supplied a type for this variable, before applying defaults.
crates/ty_python_semantic/src/types/generics.rs:2580
↓ 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:1174
↓ 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:1204
↓ 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:6342
↓ 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:2048
↓ 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:5089
↓ 1 callersFunctionhas_legacy_namespace_declaration
(db: &dyn Db, init: PythonFile<'_>)
crates/ty_module_resolver/src/resolve.rs:1663
↓ 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:304
↓ 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:214
← previousnext →9,901–10,000 of 31,562, ranked by callers