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
↓ 1 callers
Method
eat_indentation
(&mut self)
crates/ruff_python_parser/src/lexer.rs:230
↓ 1 callers
Method
eat_kind
(&mut self)
crates/ty_python_semantic/src/suppression/parser.rs:59
↓ 1 callers
Method
eat_word
(&mut self)
crates/ty_python_semantic/src/suppression/parser.rs:137
↓ 1 callers
Method
eat_word
(&mut self)
crates/ruff_linter/src/suppression.rs:1363
↓ 1 callers
Function
ecosystem_python_files
( corpus_directory: Path, *, environment: dict[str, str] )
scripts/build_ruff_pgo.py:392
↓ 1 callers
Method
edit_attribute_reference
Chooses a reference edit for an attribute such as `pkg.old`. Both the attribute and its receiver must resolve to modules. For attributes defined in t
crates/ty_ide/src/will_rename.rs:845
↓ 1 callers
Method
edit_import_from
Computes imported name and module name edits for an import-from statement. For example, `from pkg import old` becomes `from pkg import new`, and `fro
crates/ty_ide/src/will_rename.rs:343
↓ 1 callers
Method
edit_name_reference
Chooses a reference edit for a name by considering the definitions that connect that name to a bound name change from an import statement.
crates/ty_ide/src/will_rename.rs:808
↓ 1 callers
Method
edit_plain_import
Computes imported name edits for a plain import statement, such as `import old` to `import new`.
crates/ty_ide/src/will_rename.rs:328
↓ 1 callers
Method
edit_string_annotation_references
Computes reference edits in string annotations, such as `value: 'old.C'`. Ordinary strings in `__all__ = ["old"]` or `importlib.import_module("pkg.ol
crates/ty_ide/src/will_rename.rs:918
↓ 1 callers
Method
editable_inline_suppressions_rev
Returns applicable comments whose targets allow `--add-ignore` to append a code, in reverse source order. The interval index filters out blanket supp
crates/ty_python_semantic/src/suppression.rs:429
↓ 1 callers
Method
editable_owner
(&self, path: &SystemPath)
crates/ty_python_semantic/src/dependency.rs:275
↓ 1 callers
Function
editable_search_paths
Returns the validated roots listed in the environment's `.pth` files. Unlike [`search_paths`], this includes editable roots that are also first-party
crates/ty_module_resolver/src/resolve.rs:971
↓ 1 callers
Function
editable_suppression_prefix
Returns the portion of an ignore comment before its closing bracket if another code can be appended to it. ```python # ty: ignore[] # Editabl
crates/ty_python_semantic/src/suppression/add_ignore.rs:310
↓ 1 callers
Function
edits_for_file
Computes edits for one candidate file in two AST passes. 1. [`ImportStatementVisitor`] extracts source edits and bound name changes from import state
crates/ty_ide/src/will_rename.rs:244
↓ 1 callers
Method
element
Return the generated element for the candidate.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs:216
↓ 1 callers
Method
element_type
Returns the element type if it is known, or `None` if the type is never iterable.
crates/ty_python_semantic/src/types/iteration.rs:678
↓ 1 callers
Function
eligible_pull
(pull: dict, pull_request: int, head_sha: str)
scripts/pull_request_reviewers.py:110
↓ 1 callers
Function
ellipsis_in_non_empty_class_body
PYI013
crates/ruff_linter/src/rules/flake8_pyi/rules/ellipsis_in_non_empty_class_body.rs:49
↓ 1 callers
Function
else_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 callers
Function
else_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 callers
Function
else_contains_comments
( stmt: AnyNodeWithOrElse, else_range: TextRange, checker: &Checker, )
crates/ruff_linter/src/rules/ruff/rules/needless_else.rs:89
↓ 1 callers
Method
else_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 callers
Function
elts_to_csv
(elts: &[Expr], generator: Generator, flags: StringLiteralFlags)
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:306
↓ 1 callers
Method
emit
Writes the buffered prefix to `output` and clears it.
crates/ty_ide/src/docstring/markdown/general.rs:459
↓ 1 callers
Function
emit_default_option
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:281
↓ 1 callers
Function
emit_env_option
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:269
↓ 1 callers
Function
emit_field
(output: &mut String, name: &str, field: &OptionField, parents: &[Set])
crates/ruff_dev/src/generate_ty_options.rs:140
↓ 1 callers
Function
emit_field
(output: &mut String, name: &str, field: &OptionField, parents: &[Set])
crates/ruff_dev/src/generate_options.rs:96
↓ 1 callers
Function
emit_possible_options
(opt: &clap::Arg, output: &mut String)
crates/ruff_dev/src/generate_ty_cli_reference.rs:299
↓ 1 callers
Function
emit_suggestion_default
( renderer: &Renderer, buffer: &mut StyledBuffer, suggestion: &Snippet<'_, Patch<'_>>, spliced
crates/ruff_annotate_snippets/src/renderer/render.rs:1516
↓ 1 callers
Method
emphasis
Override the output style for emphasis for the [`primary_title`][crate::Level::primary_title]
crates/ruff_annotate_snippets/src/renderer/mod.rs:247
↓ 1 callers
Function
empty
()
crates/mdtest/src/parser.rs:1170
↓ 1 callers
Function
empty_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 callers
Function
empty_comments
PLR2044
crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs:51
↓ 1 callers
Function
empty_type_checking_block
TC005
crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs:52
↓ 1 callers
Method
enable
(&mut self, rule: Rule, should_fix: bool)
crates/ruff_linter/src/settings/rule_table.rs:56
↓ 1 callers
Method
enable_call_argument_edit
Attach the edits that turn this positional argument into a keyword argument.
crates/ty_ide/src/inlay_hints.rs:225
↓ 1 callers
Method
enable_diagnostic_related_information
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1100
↓ 1 callers
Method
enable_formatting_dynamic_registration
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1070
↓ 1 callers
Method
enable_inlay_hint_refresh
Enable server-requested refreshes for inlay hints.
crates/ty_server/tests/e2e/main.rs:1484
↓ 1 callers
Method
enable_range_formatting_dynamic_registration
(mut self, enabled: bool)
crates/ruff_server/tests/e2e/main.rs:1080
↓ 1 callers
Function
enclosing_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 callers
Function
enclosing_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 callers
Method
enclosing_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:1451
↓ 1 callers
Method
enclosing_finally
Return the enclosing `finally` suites that run after this `return`.
crates/ruff_linter/src/rules/flake8_return/visitor.rs:68
↓ 1 callers
Method
enclosing_lambda_statement
(&self, lambda: ExpressionNodeKey)
crates/ty_python_core/src/lib.rs:590
↓ 1 callers
Method
enclosing_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:911
↓ 1 callers
Method
enclosing_snapshot
( &self, snapshot_id: ScopedEnclosingSnapshotId, nested_laziness: ScopeLaziness, )
crates/ty_python_core/src/use_def.rs:1273
↓ 1 callers
Method
enclosing_string_literal_expr
Returns the string literal expression that the cursor is positioned within, if any.
crates/ty_ide/src/completion.rs:1032
↓ 1 callers
Function
end_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 callers
Function
end_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 callers
Method
end_of_scope_member_bindings
( &self, member: ScopedMemberId, )
crates/ty_python_core/src/use_def.rs:1233
↓ 1 callers
Method
end_of_scope_member_declarations
( &'map self, member: ScopedMemberId, )
crates/ty_python_core/src/use_def.rs:1367
↓ 1 callers
Method
end_of_scope_reachability
(&self)
crates/ty_python_core/src/use_def.rs:1071
↓ 1 callers
Method
end_tag
(&self, kind: TagKind)
crates/ruff_formatter/src/format_element/document.rs:779
↓ 1 callers
Method
end_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 callers
Function
ends_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 callers
Function
ends_with_period
D400
crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_period.rs:73
↓ 1 callers
Function
ends_with_punctuation
D415
crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs:67
↓ 1 callers
Function
ensure_blank_line
(output: &mut String)
crates/ty_ide/src/docstring/markdown/structured.rs:117
↓ 1 callers
Function
ensure_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 callers
Method
enter_interior
( &mut self, _db: &'db dyn Db, storage: &mut ConstraintSetStor
crates/ty_python_semantic/src/types/constraints.rs:4619
↓ 1 callers
Method
enter_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 callers
Method
enter_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 callers
Method
enter_node
(&mut self, node: AnyNodeRef<'ast>)
crates/ruff_python_formatter/src/comments/visitor.rs:73
↓ 1 callers
Method
enter_node
(&mut self, node: AnyNodeRef<'a>)
crates/ty_ide/src/inlay_hints.rs:518
↓ 1 callers
Method
enter_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 callers
Method
entry
( &'a mut self, symbols: &IndexVec<ScopedSymbolId, Symbol>, symbol: &Symbol, )
crates/ty_python_core/src/symbol.rs:189
↓ 1 callers
Method
entry_with_line_separator
( &mut self, node: &N, content: &dyn Format<PyFormatContext<'ast>>, separator:
crates/ruff_python_formatter/src/builders.rs:167
↓ 1 callers
Function
enum_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 callers
Function
enum_class_literal
( db: &'db dyn Db, class: ClassLiteral<'db>, )
crates/ty_python_semantic/src/types/enums.rs:331
↓ 1 callers
Function
enum_comparison_key
( semantics: KnownComparisonSemantics, value: Type<'_>, )
crates/ty_python_semantic/src/types/equality/enums.rs:1223
↓ 1 callers
Function
enum_functional_call_keyword_is_valid
(name: &str, python_version: PythonVersion)
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:130
↓ 1 callers
Function
enum_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 callers
Function
enum_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:1088
↓ 1 callers
Function
enum_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 callers
Function
enum_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 callers
Function
enum_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 callers
Function
enum_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:1349
↓ 1 callers
Function
enum_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 callers
Method
enumerable_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:349
↓ 1 callers
Function
enumerate_for_loop
SIM113
crates/ruff_linter/src/rules/flake8_simplify/rules/enumerate_for_loop.rs:61
↓ 1 callers
Method
enumerates
Returns `true` if the file exemption lists the rule directly, rather than via a blanket exemption.
crates/ruff_linter/src/noqa.rs:206
↓ 1 callers
Method
env_merge
(&mut self, environment: &CommandEnv)
crates/ruff_db/src/system/command.rs:105
↓ 1 callers
Function
environment_from_binary
(system: &dyn System, binary: &str)
crates/ty_site_packages/src/lib.rs:1077
↓ 1 callers
Method
eq
(&self, other: &Self)
crates/ruff_db/src/parsed.rs:205
↓ 1 callers
Method
eq
(&self, other: &Self)
crates/ty_python_semantic/src/types/cyclic.rs:1307
↓ 1 callers
Method
eq
(&self, other: &&str)
crates/ruff_linter/src/codes.rs:51
↓ 1 callers
Function
equality_exclusion_constraint
Return a constraint excluding every value known to compare equal to `ty`.
crates/ty_python_semantic/src/types/equality.rs:154
↓ 1 callers
Function
error
(obj=OtherClass())
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B008_extended.py:36
↓ 1 callers
Function
error_instead_of_exception
TRY400
crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs:77
↓ 1 callers
Function
error_suffix_on_exception_name
N818
crates/ruff_linter/src/rules/pep8_naming/rules/error_suffix_on_exception_name.rs:53
↓ 1 callers
Function
error_to_string
(err: &FormatParseError)
crates/ruff_linter/src/rules/pyflakes/format.rs:8
↓ 1 callers
Function
escape_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:2358
↓ 1 callers
Function
escape_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 callers
Function
escape_glob_path_component
(component: &str)
crates/ty_project/src/glob/portable.rs:210
↓ 1 callers
Function
escaped_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 callers
Method
eval
(self)
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S307.py:8
↓ 1 callers
Method
evaluate
(self, db: &'db dyn Db, all_declarations_definitely_reachable: bool)
crates/ty_python_semantic/src/place.rs:1550
← previous
next →
9,001–9,100 of 31,562, ranked by callers