MCPcopy Create free account

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

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

↓ 1 callersFunctioneligible_pull
(pull: dict[str, Any], pull_request: int, head_sha: str)
scripts/pull_request_reviewers.py:113
↓ 1 callersFunctionellipsis_in_non_empty_class_body
PYI013
crates/ruff_linter/src/rules/flake8_pyi/rules/ellipsis_in_non_empty_class_body.rs:49
↓ 1 callersFunctionelse_branch_has_preceding_comment
Returns `true` if the `else` clause header has a leading own-line comment. ```python if ...: ... # some comment else: pass ```
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:130
↓ 1 callersFunctionelse_branch_has_trailing_comment
Returns `true` if the `else` branch has a trailing own line comment: ```python if ...: ... else: pass # some comment ```
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:170
↓ 1 callersFunctionelse_contains_comments
( stmt: AnyNodeWithOrElse, else_range: TextRange, checker: &Checker, )
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:89
↓ 1 callersMethodelse_range
Returns the range from the `else` keyword to the last statement in its block.
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:215
↓ 1 callersFunctionelts_to_csv
(elts: &[Expr], generator: Generator, flags: StringLiteralFlags)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:306
↓ 1 callersMethodemit
Writes the buffered prefix to `output` and clears it.
crates/ty_ide/src/docstring/markdown/general.rs:459
↓ 1 callersFunctionemit_default_option
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:281
↓ 1 callersFunctionemit_env_option
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:269
↓ 1 callersFunctionemit_field
(output: &mut String, name: &str, field: &OptionField, parents: &[Set])
crates/ruff_dev/src/generate_ty_options.rs:140
↓ 1 callersFunctionemit_field
(output: &mut String, name: &str, field: &OptionField, parents: &[Set])
crates/ruff_dev/src/generate_options.rs:96
↓ 1 callersFunctionemit_possible_options
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:299
↓ 1 callersFunctionemit_suggestion_default
( renderer: &Renderer, buffer: &mut StyledBuffer, suggestion: &Snippet<'_, Patch<'_>>, spliced
crates/ruff_annotate_snippets/src/renderer/render.rs:1516
↓ 1 callersMethodemphasis
Override the output style for emphasis for the [`primary_title`][crate::Level::primary_title]
crates/ruff_annotate_snippets/src/renderer/mod.rs:247
↓ 1 callersFunctionempty
()
crates/mdtest/src/parser.rs:1167
↓ 1 callersFunctionempty_comment
Return a [`Diagnostic`] if the comment at the given [`TextRange`] is empty.
crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs:71
↓ 1 callersFunctionempty_comments
PLR2044
crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs:51
↓ 1 callersFunctionempty_type_checking_block
TC005
crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs:52
↓ 1 callersMethodenable
(&mut self, rule: Rule, should_fix: bool)
crates/ruff_linter/src/settings/rule_table.rs:56
↓ 1 callersMethodenable_call_argument_edit
Attach the edits that turn this positional argument into a keyword argument.
crates/ty_ide/src/inlay_hints.rs:225
↓ 1 callersMethodenable_diagnostic_related_information
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1100
↓ 1 callersMethodenable_formatting_dynamic_registration
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1070
↓ 1 callersMethodenable_inlay_hint_refresh
Enable server-requested refreshes for inlay hints.
crates/ty_server/tests/e2e/main.rs:1491
↓ 1 callersMethodenable_range_formatting_dynamic_registration
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1080
↓ 1 callersFunctionenclosing_async_function
Returns the enclosing `async` function definition, if any.
crates/ruff_linter/src/rules/flake8_async/rules/yield_in_context_manager_in_async_generator.rs:113
↓ 1 callersFunctionenclosing_binding_contexts
Returns the binding contexts introduced by the given scope or any enclosing scope.
crates/ty_python_semantic/src/types/generics.rs:68
↓ 1 callersMethodenclosing_class_def
Returns the class definition if the cursor is within its arguments node. E.g. `class Foo(Bar<CURSOR>)`
crates/ty_ide/src/completion.rs:1455
↓ 1 callersMethodenclosing_finally
Return the enclosing `finally` suites that run after this `return`.
crates/ruff_linter/src/rules/flake8_return/visitor.rs:68
↓ 1 callersMethodenclosing_lambda_statement
(&self, lambda: ExpressionNodeKey)
crates/ty_python_core/src/lib.rs:590
↓ 1 callersMethodenclosing_slots_class
Returns the class definition whose `__slots__` assignment contains the string literal currently being visited, if the ancestor chain matches one of th
crates/ty_ide/src/references.rs:918
↓ 1 callersMethodenclosing_snapshot
( &self, snapshot_id: ScopedEnclosingSnapshotId, nested_laziness: ScopeLaziness, )
crates/ty_python_core/src/use_def.rs:1273
↓ 1 callersMethodenclosing_string_literal_expr
Returns the string literal expression that the cursor is positioned within, if any.
crates/ty_ide/src/completion.rs:1032
↓ 1 callersFunctionend_of_last_statement
Given a statement, find its "logical end". For example: the statement could be following by a trailing semicolon, by an end-of-line comment, or by an
crates/ruff_linter/src/rules/flake8_return/helpers.rs:25
↓ 1 callersFunctionend_of_scope_function_definitions
Return reachable function definitions that bind `member_name` at the end of `subclass_scope`.
crates/ty_python_semantic/src/types/list_members.rs:876
↓ 1 callersMethodend_of_scope_member_bindings
( &self, member: ScopedMemberId, )
crates/ty_python_core/src/use_def.rs:1233
↓ 1 callersMethodend_of_scope_member_declarations
( &'map self, member: ScopedMemberId, )
crates/ty_python_core/src/use_def.rs:1367
↓ 1 callersMethodend_of_scope_reachability
(&self)
crates/ty_python_core/src/use_def.rs:1071
↓ 1 callersMethodend_tag
(&self, kind: TagKind)
crates/ruff_formatter/src/format_element/document.rs:779
↓ 1 callersMethodend_try_suite
Retrieve the [`ExceptionContext`] at the top of the stack, and take all snapshots recorded while visiting the `try` suite. Taking the snapshots deact
crates/ty_python_core/src/builder/except_handlers.rs:110
↓ 1 callersFunctionends_with_backslash
Return true if a line ends with an odd number of backslashes (i.e., ends with an escape).
crates/ruff_linter/src/rules/pydocstyle/helpers.rs:42
↓ 1 callersFunctionends_with_period
D400
crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_period.rs:73
↓ 1 callersFunctionends_with_punctuation
D415
crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs:67
↓ 1 callersFunctionensure_blank_line
(output: &mut String)
crates/ty_ide/src/docstring/markdown/structured.rs:117
↓ 1 callersFunctionensure_indexed
Ensure the following sub-AST is indexed, using the parent node's index as a basis for unambiguous AST node indices.
crates/ruff_db/src/parsed.rs:593
↓ 1 callersMethodenter_interior
( &mut self, _db: &'db dyn Db, storage: &mut ConstraintSetStor
crates/ty_python_semantic/src/types/constraints.rs:4694
↓ 1 callersMethodenter_nested_scope
Push a new [`ExceptionContextStack`] onto the stack of stacks. Each [`ExceptionContextStack`] is only valid for a single scope.
crates/ty_python_core/src/builder/except_handlers.rs:50
↓ 1 callersMethodenter_new_branch
Allocate a fresh branch ID and make it current.
crates/ruff_linter/src/rules/flake8_bugbear/rules/loop_iterator_mutation.rs:233
↓ 1 callersMethodenter_node
(&mut self, node: AnyNodeRef<'ast>)
crates/ruff_python_formatter/src/comments/visitor.rs:73
↓ 1 callersMethodenter_node
(&mut self, node: AnyNodeRef<'a>)
crates/ty_ide/src/inlay_hints.rs:518
↓ 1 callersMethodenter_type
Returns the `__enter__` or `__aenter__` return type if it is known, or `None` if the type never has a callable `__enter__` or `__aenter__` attribute
crates/ty_python_semantic/src/types/context_manager.rs:353
↓ 1 callersMethodentry
( &'a mut self, symbols: &IndexVec<ScopedSymbolId, Symbol>, symbol: &Symbol, )
crates/ty_python_core/src/symbol.rs:189
↓ 1 callersMethodentry_with_line_separator
( &mut self, node: &N, content: &dyn Format<PyFormatContext<'ast>>, separator:
crates/ruff_python_formatter/src/builders.rs:167
↓ 1 callersFunctionenum_class_creation_manages_conflict
Returns `true` when this source-level conflict involves a method replaced by `EnumType` during class creation. Restricting this to a known enum imple
crates/ty_python_semantic/src/types/overrides.rs:652
↓ 1 callersFunctionenum_class_literal
( db: &'db dyn Db, class: ClassLiteral<'db>, )
crates/ty_python_semantic/src/types/enums.rs:331
↓ 1 callersFunctionenum_comparison_key
( semantics: KnownComparisonSemantics, value: Type<'_>, )
crates/ty_python_semantic/src/types/equality/enums.rs:1223
↓ 1 callersFunctionenum_functional_call_keyword_is_valid
(name: &str, python_version: PythonVersion)
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:130
↓ 1 callersFunctionenum_has_distinct_member_equality
Whether equality between values of this enum is equivalent to canonical member identity.
crates/ty_python_semantic/src/types/equality/enums.rs:1173
↓ 1 callersFunctionenum_literal_constraint
Return a constraint when every possible value of `left` is a member of the same enum as `right`. For example: ```python from enum import Enum class
crates/ty_python_semantic/src/types/equality.rs:1117
↓ 1 callersFunctionenum_literal_subject_names
Return the enum class and canonical member names represented by an enum-literal subject type. This succeeds only when the subject is a single enum li
crates/ty_python_semantic/src/reachability.rs:343
↓ 1 callersFunctionenum_member_pattern_coverage
Returns enum-member coverage evidence for a pattern. This recognizes patterns like `case Color.RED | Color.GREEN` when the pattern belongs to the exp
crates/ty_python_semantic/src/reachability.rs:426
↓ 1 callersFunctionenum_member_pattern_name
Return the canonical enum-member name matched by a single value pattern. This recognizes patterns like `case Color.RED:` only when the pattern expres
crates/ty_python_semantic/src/reachability.rs:396
↓ 1 callersFunctionenum_metaclass_may_transform_values
Returns whether an enum's metaclass has a custom value-transforming method before the stdlib `EnumType`/`EnumMeta` implementation. `__prepare__` can
crates/ty_python_semantic/src/types/enums.rs:1352
↓ 1 callersFunctionenum_names_type
Returns the effective `_EnumNames` type accepted by the functional enum APIs. This includes the string form, iterables of strings, iterables of itera
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:141
↓ 1 callersMethodenumerable_module_name
Returns the candidate module name supplied by the given directory entry (if the entry does indeed supply a valid module name). `Some(name)` does not
crates/ty_module_resolver/src/resolve/search.rs:348
↓ 1 callersFunctionenumerate_for_loop
SIM113
crates/ruff_linter/src/rules/flake8_simplify/rules/enumerate_for_loop.rs:61
↓ 1 callersMethodenumerates
Returns `true` if the file exemption lists the rule directly, rather than via a blanket exemption.
crates/ruff_linter/src/noqa.rs:206
↓ 1 callersMethodenv_merge
(&mut self, environment: &CommandEnv)
crates/ruff_db/src/system/command.rs:105
↓ 1 callersFunctionenvironment_from_binary
(system: &dyn System, binary: &str)
crates/ty_site_packages/src/lib.rs:1077
↓ 1 callersMethodeq
(&self, other: &Self)
crates/ruff_db/src/parsed.rs:205
↓ 1 callersMethodeq
(&self, rhs: &QueryPattern)
crates/ty_ide/src/symbols.rs:109
↓ 1 callersMethodeq
(&self, other: &Self)
crates/ty_python_semantic/src/types/cyclic.rs:1319
↓ 1 callersMethodeq
(&self, other: &&str)
crates/ruff_linter/src/codes.rs:51
↓ 1 callersFunctionequality_exclusion_constraint
Return a constraint excluding every value known to compare equal to `ty`.
crates/ty_python_semantic/src/types/equality.rs:154
↓ 1 callersFunctionerror
(obj=OtherClass())
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B008_extended.py:36
↓ 1 callersFunctionerror_instead_of_exception
TRY400
crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs:77
↓ 1 callersFunctionerror_suffix_on_exception_name
N818
crates/ruff_linter/src/rules/pep8_naming/rules/error_suffix_on_exception_name.rs:53
↓ 1 callersFunctionerror_to_string
(err: &FormatParseError)
crates/ruff_linter/src/rules/pyflakes/format.rs:8
↓ 1 callersFunctionescape_for_quote
When we insert a completion for a string literal, we need to make sure to properly escape any special characters in the completion value and to use th
crates/ty_ide/src/completion.rs:2361
↓ 1 callersFunctionescape_glob_file_name
Escapes glob operators in a file name using single-character classes. LSP defines the operators but not an escape syntax, so we assume clients interpr
crates/ty_server/src/session/file_watcher.rs:415
↓ 1 callersFunctionescape_glob_path_component
(component: &str)
crates/ty_project/src/glob/portable.rs:210
↓ 1 callersFunctionescaped_char_is_regex_metasequence
Whether the sequence `\<c>` means anything special: `\A`: Start of input `\b`, `\B`: Word boundary and non-word-boundary `\d`, `\D`: Digit and non-di
crates/ruff_linter/src/rules/ruff/rules/pytest_raises_ambiguous_pattern.rs:153
↓ 1 callersMethodeval
(self)
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S307.py:8
↓ 1 callersMethodevaluate
(self, db: &'db dyn Db, all_declarations_definitely_reachable: bool)
crates/ty_python_semantic/src/place.rs:1494
↓ 1 callersMethodevaluate_against_other
Compare one possible value with the other side. Compare `Any` and `Unknown` with the whole union so neither is narrowed by separate values. Return w
crates/ty_python_semantic/src/types/equality/enums.rs:161
↓ 1 callersMethodevaluate_bool_op
( &mut self, expr_bool_op: &ExprBoolOp, expression: Expression<'db>, is_positi
crates/ty_python_semantic/src/types/narrow.rs:5141
↓ 1 callersMethodevaluate_class
( &mut self, object_ty: Type<'db>, member: &ClassAttributeWriteMember<'db>, em
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:707
↓ 1 callersMethodevaluate_class_fallback
( &mut self, object_ty: Type<'db>, requirement: &FallbackAttributeWriteRequirement<'db
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:970
↓ 1 callersFunctionevaluate_comparison_once
Evaluate one comparison after resolving aliases and checking for recursion. Handle enums and dynamic values such as `Any` before checking individual
crates/ty_python_semantic/src/types/equality.rs:612
↓ 1 callersFunctionevaluate_dynamic_comparison
Handle dynamic values such as `Any` before checking individual enum members. A one-member enum can exclude that member from `Any`. An enum with sever
crates/ty_python_semantic/src/types/equality.rs:653
↓ 1 callersFunctionevaluate_enum_comparison
Compare enum values without checking every pair of members. If either side also contains other values, compare those values normally. Return `None`
crates/ty_python_semantic/src/types/equality/enums.rs:25
↓ 1 callersMethodevaluate_expr_call
( &mut self, expr_call: &ast::ExprCall, expression: Expression<'db>, is_positi
crates/ty_python_semantic/src/types/narrow.rs:4614
↓ 1 callersMethodevaluate_expr_compare
( &mut self, expr_compare: &ast::ExprCompare, expression: Expression<'db>, is_
crates/ty_python_semantic/src/types/narrow.rs:4047
↓ 1 callersMethodevaluate_expr_if
( &mut self, expr_if: &ast::ExprIf, expression: Expression<'db>, is_positive:
crates/ty_python_semantic/src/types/narrow.rs:1953
↓ 1 callersMethodevaluate_expr_in
(&self, lhs_ty: Type<'db>, rhs_ty: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:3829
↓ 1 callersMethodevaluate_expr_named
( &mut self, expr_named: &ast::ExprNamed, expression: Expression<'db>, is_posi
crates/ty_python_semantic/src/types/narrow.rs:3794
↓ 1 callersMethodevaluate_expr_not_in
(&self, lhs_ty: Type<'db>, rhs_ty: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:3871
↓ 1 callersFunctionevaluate_finally_continuation
( db: &'db dyn Db, scope: ScopeId<'db>, continuation: ScopedReachabilityConstraintId, )
crates/ty_python_semantic/src/reachability.rs:796
↓ 1 callersFunctionevaluate_finite_comparison
Compare finite sets of values after handling enums and dynamic values. Start with the side being narrowed so its restrictions are not applied to the
crates/ty_python_semantic/src/types/equality.rs:690
↓ 1 callersMethodevaluate_instance
( &mut self, object_ty: Type<'db>, receiver: Option<Type<'db>>, member: &Insta
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:545
← previousnext →9,101–9,200 of 31,766, ranked by callers