MCPcopy Create free account

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

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

↓ 3 callersFunctionequivalent
Return `true` if the format string is equivalent to the constant type
crates/ruff_linter/src/rules/pylint/rules/bad_string_format_type.rs:121
↓ 3 callersMethoderror
(self)
crates/ruff_python_parser/src/error.rs:53
↓ 3 callersMethodevaluate
Return `None` when the expression cannot finish evaluating, even if its inferred type is inhabited, as in `bool(never)`. This lets required operands p
crates/ty_python_semantic/src/types/infer/expression_truthiness.rs:87
↓ 3 callersMethodevaluate
Validate the assignment and optionally record its accessor deprecations. After validation short-circuits, a pure collector inspects the remaining alte
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:275
↓ 3 callersMethodevaluate_constraint_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/narrow.rs:801
↓ 3 callersMethodevaluate_match_pattern_for_subject_element
( &mut self, subject_expression: Expression<'db>, subject: &ast::Expr, pattern
crates/ty_python_semantic/src/types/narrow.rs:4995
↓ 3 callersFunctionevaluate_reachability_path
Evaluate a reachability decision diagram, reusing checkpoints for previously evaluated suffixes. An inhabited predicate selects its true, false, or a
crates/ty_python_semantic/src/reachability.rs:878
↓ 3 callersMethodevidence_satisfies_declared_constraint
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, storage: &mut Constra
crates/ty_python_semantic/src/types/constraints/solutions.rs:922
↓ 3 callersFunctionexact_sequence_pattern_type
Build the structural type used for a fixed-length sequence pattern. For a pattern like: ```python match value: case [int(), str()]: ... ``` this re
crates/ty_python_semantic/src/types/match_pattern.rs:240
↓ 3 callersFunctionexact_with_provenance
( db: &'db TestDb, builder: &'c ConstraintSetBuilder<'db>, provenance: ConstraintProvenance, t
crates/ty_python_semantic/src/types/constraints/projection/tests.rs:48
↓ 3 callersMethodexecute
( &self, executor: &dyn CommandExecutor, target: &MetadataTarget<'_>, )
crates/ty_project/src/uv/command.rs:50
↓ 3 callersFunctionexists
()
crates/ruff_db/src/system/memory_fs.rs:774
↓ 3 callersFunctionexpand_tabs
Expands tabs to the next eight-column tab stop, matching Python's `str.expandtabs`.
crates/ruff_python_trivia/src/whitespace.rs:7
↓ 3 callersMethodexpect_class_literal
(self)
crates/ty_python_semantic/src/types.rs:3201
↓ 3 callersMethodexpect_function_literal
(self)
crates/ty_python_semantic/src/types.rs:3306
↓ 3 callersMethodexpect_type_alias
(&self)
crates/ty_python_core/src/scope.rs:444
↓ 3 callersMethodexported_symbols
Returns the [`FlatSymbols`] for `test.py`.
crates/ty_ide/src/symbols.rs:3296
↓ 3 callersFunctionexpr_name_to_type_var
( semantic: &'a SemanticModel, name: &'a ExprName, )
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:295
↓ 3 callersMethodexpr_ref_in_ast
Get a "safe" [`ExprRef`] to use for referring to the given (sub-)expression. If we're analyzing a string annotation, it will return the string litera
crates/ty_python_semantic/src/semantic_model.rs:579
↓ 3 callersMethodexpression
(self)
crates/ruff_python_formatter/src/expression/mod.rs:826
↓ 3 callersMethodexpression_type
(&self, expr_id: impl Into<ExpressionNodeKey>)
crates/ty_python_semantic/src/types/unpacker.rs:387
↓ 3 callersMethodexpressions
Returns an [`Iterator`] over the expressions, starting from the given [`NodeId`]. through to any parents.
crates/ruff_python_semantic/src/model.rs:1692
↓ 3 callersMethodextend
(&mut self, iter: I)
crates/ruff_db/src/system/path.rs:734
↓ 3 callersMethodextend_expression
(&mut self, inference: &ExpressionInference<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:779
↓ 3 callersMethodextend_expression_without_bindings
Merges expression results without claiming bindings owned by their enclosing statement.
crates/ty_python_semantic/src/types/infer/builder.rs:813
↓ 3 callersMethodextend_scope
(&mut self, inference: &ScopeInference<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:898
↓ 3 callersFunctionextract_handled_exceptions
Extract the names of all handled exceptions.
crates/ruff_python_ast/src/helpers.rs:867
↓ 3 callersFunctionextract_unpacked_typed_dict_keys_from_kwargs_annotation
Extracts unpacked `TypedDict` keys for a `**kwargs` annotation only when the annotation explicitly uses `Unpack[...]`. Per [PEP 692](https://peps.pyt
crates/ty_python_semantic/src/types/typed_dict.rs:2139
↓ 3 callersMethodfield_specifiers
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class.rs:316
↓ 3 callersMethodfield_specifiers
( db: &'db dyn Db, index: &'db SemanticIndex<'db>, scope: ScopeId<'db>,
crates/ty_python_semantic/src/types/infer/builder.rs:994
↓ 3 callersMethodfile
Returns the file to which this module belongs.
crates/ruff_db/src/parsed.rs:188
↓ 3 callersMethodfile
The file for which the types are inferred.
crates/ty_python_semantic/src/types/context.rs:197
↓ 3 callersMethodfile_path
Get the path for the document selected by this query. Returns `None` if this is an unsaved (untitled) document. The path isn't guaranteed to point t
crates/ruff_server/src/session/index.rs:635
↓ 3 callersFunctionfile_settings
(db: &dyn SemanticDb, file: File)
crates/ty_test/src/db.rs:215
↓ 3 callersMethodfile_type
Returns the type of the entry named `name`, if present.
crates/ruff_db/src/files/directory.rs:16
↓ 3 callersMethodfile_type
Return the file type for the file that this entry points to.
crates/ruff_db/src/system/walk_directory.rs:183
↓ 3 callersMethodfiles
(&self)
crates/ty_project/src/db.rs:684
↓ 3 callersFunctionfilter_generic_narrowing_constraint
Preserve known generic arguments when narrowing a specialized base to one of its subclasses. For example, filtering `Sequence[int]` with `list[Unknow
crates/ty_python_semantic/src/types/narrow.rs:825
↓ 3 callersMethodfilter_tuple_subscript
Retain tuple union members whose indexed element can satisfy a predicate.
crates/ty_python_semantic/src/types/narrow.rs:5435
↓ 3 callersMethodfinalize
Finalize the lookup result by handling dynamic type intersection.
crates/ty_python_semantic/src/types/class.rs:3330
↓ 3 callersMethodfind
Look for the best matching token pattern at the given offset.
crates/ty_ide/src/completion.rs:2492
↓ 3 callersFunctionfind_any_ignore_ascii_case
(expr: &ast::Expr, patterns: &[&'static str])
crates/ruff_linter/src/linter/float.rs:38
↓ 3 callersFunctionfind_goto_target_impl
( model: &'a SemanticModel, tokens: &'a Tokens, syntax: AnyNodeRef<'a>, offset: TextSize, )
crates/ty_ide/src/goto.rs:1441
↓ 3 callersFunctionfind_references
Find all references to a symbol at the given position. Search for references across all files in the project.
crates/ty_ide/src/find_references.rs:14
↓ 3 callersFunctionfind_settings_toml
Find the path to the `pyproject.toml` or `ruff.toml` file, if such a file exists.
crates/ruff_workspace/src/pyproject.rs:109
↓ 3 callersFunctionfind_trailing_pragma_offset
Returns the byte offset within `comment` where a trailing pragma comment starts, or `None` if no pragma is found. For a plain pragma like `# noqa: F4
crates/ruff_python_trivia/src/pragmas.rs:56
↓ 3 callersFunctionfind_typevar_annotation_range
( context: &InferContext<'db, '_>, node: &ast::StmtFunctionDef, typevar: TypeVarInstance<'db>,
crates/ty_python_semantic/src/types/infer/builder/post_inference/function.rs:512
↓ 3 callersFunctionfind_underline
Returns the [`TextRange`] of the underline, if a line consists of only dashes.
crates/ruff_linter/src/rules/pydocstyle/helpers.rs:151
↓ 3 callersFunctionfind_will_execute_event_by_name
( db: &dyn salsa::Database, query_name: &str, input: Option<salsa::Id>, events: &'a [salsa::Ev
crates/ruff_db/src/testing.rs:123
↓ 3 callersMethodfinish
(mut self)
crates/ruff_formatter/src/printer/mod.rs:1543
↓ 3 callersMethodfinish
(self)
crates/ruff_db/src/vendored.rs:503
↓ 3 callersMethodfinish
(mut self)
crates/ruff_db/src/parsed.rs:409
↓ 3 callersMethodfinish
(self)
crates/ty_ide/src/docstring/document/numpy.rs:376
↓ 3 callersMethodfinish
(self)
crates/ty_ide/src/docstring/document/google.rs:463
↓ 3 callersMethodfinish
( mut self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/call/bind.rs:5736
↓ 3 callersMethodfinish_definition
( mut self, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:12499
↓ 3 callersMethodfinish_expression_type
Apply context before recording an inferred expression type.
crates/ty_python_semantic/src/types/infer/builder.rs:7086
↓ 3 callersFunctionfinite_alternatives
Expand a type into its finite runtime alternatives when its comparison semantics are known. Enum classes with custom comparison methods are deliberat
crates/ty_python_semantic/src/types/equality.rs:1500
↓ 3 callersFunctionfirst_argument_with_matching_function
( name: &str, func: &Expr, args: &'a [Expr], )
crates/ruff_linter/src/rules/flake8_comprehensions/helpers.rs:22
↓ 3 callersMethodfirst_literal_flags
Returns the [`StringLiteralFlags`] associated with this string literal. For an implicitly concatenated string, it returns the flags for the first lit
crates/ruff_python_ast/src/nodes.rs:1558
↓ 3 callersFunctionfix_all
(snapshot: &DocumentSnapshot)
crates/ruff_server/src/server/api/requests/code_action.rs:193
↓ 3 callersFunctionfix_file
Fix errors in a file, and write the fixed source code to disk.
crates/ruff_linter/src/fix/mod.rs:30
↓ 3 callersMethodfixture
Returns the decorated function that declares the fixture.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:251
↓ 3 callersFunctionfixture_exposures_for_name_in_scope
( db: &'db dyn Db, scope: ScopeId<'db>, name: Name, )
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:1532
↓ 3 callersMethodflip
(self)
crates/ty_python_semantic/src/types.rs:801
↓ 3 callersMethodflow_snapshot_for_condition
(&mut self, condition: &ast::Expr)
crates/ty_python_core/src/builder.rs:1354
↓ 3 callersMethodflush
(&mut self)
crates/ty/src/printer.rs:168
↓ 3 callersMethodfmt
(&self, statements: &Suite, f: &mut PyFormatter)
crates/ruff_python_formatter/src/statement/suite.rs:96
↓ 3 callersMethodfollowed_by_multi_statement_line
Return `true` if a [`Stmt`] appears to be followed by other statements in a multi-statement line.
crates/ruff_python_index/src/indexer.rs:219
↓ 3 callersMethodfollowing_lines_str
(&self)
crates/ruff_linter/src/docstrings/sections.rs:410
↓ 3 callersMethodfoo
(self, timeout: float)
crates/ruff_linter/resources/test/fixtures/flake8_async/ASYNC109_0.py:20
↓ 3 callersMethodfor_path
Returns a reference to the workspace for the given path, [`None`] if there's no workspace registered for the path.
crates/ty_server/src/session.rs:1812
↓ 3 callersMethodforce
(self)
crates/ty_python_semantic/src/importer.rs:842
↓ 3 callersMethodforce_exclude
(&self)
crates/ruff_workspace/src/resolver.rs:95
↓ 3 callersFunctionformat
Format a docstring by trimming whitespace and adjusting the indentation. Summary of changes we make: Normalize the string like all other strings Igno
crates/ruff_python_formatter/src/string/docstring.rs:113
↓ 3 callersMethodformat_backend
(&self)
crates/ruff_server/src/session/settings.rs:173
↓ 3 callersMethodformat_file_with_cache
( &self, path: &str, cache: &Cache, )
crates/ruff/src/cache.rs:1075
↓ 3 callersFunctionformat_import_from
( import_from: &ImportFromData, comments: &ImportFromCommentSet, aliases: &[(AliasData, ImportFrom
crates/ruff_linter/src/rules/isort/format.rs:47
↓ 3 callersFunctionformat_range
( source: &str, range: TextRange, options: PyFormatOptions, )
crates/ruff_python_formatter/src/range.rs:52
↓ 3 callersFunctionformat_with_options
( root: &dyn Format<SimpleFormatContext>, options: PrinterOptions, )
crates/ruff_formatter/src/printer/mod.rs:1688
↓ 3 callersMethodformatted_names
Return a string that contains a formatted subset of the abstract methods in this collection. This is useful for diagnostics.
crates/ty_python_semantic/src/types/abstract_methods.rs:220
↓ 3 callersMethodfreshen_member_for_owner_specialization
Freshens a member's method binders to avoid capturing typevars in incoming class arguments. Constructor lookup must do this before adding the inherite
crates/ty_python_semantic/src/types.rs:9707
↓ 3 callersFunctionfrom_nonnegative_i32
(index: i32)
crates/ty_python_semantic/src/subscript.rs:24
↓ 3 callersMethodfs
(&self)
crates/ruff_db/src/system/test.rs:385
↓ 3 callersMethodfull_line_end
(&self, offset: TextSize)
crates/ruff_source_file/src/line_ranges.rs:359
↓ 3 callersFunctionfull_module_name
(prefix: Option<&ModuleName>, component_name: &str)
crates/ty_module_resolver/src/resolve/search.rs:1175
↓ 3 callersMethodfull_mro_except_first_element
Materialize the full MRO of the class. Return an iterator over that MRO which skips the first element of the MRO.
crates/ty_python_semantic/src/types/mro.rs:660
↓ 3 callersFunctionfunc
()
crates/ruff_python_semantic/resources/test/fixtures/cfg/no_flow.py:1
↓ 3 callersFunctionfunc
()
crates/ruff_python_formatter/resources/test/fixtures/black/cases/python37.py:12
↓ 3 callersFunctionfunc1
(arg: None | int)
crates/ruff_linter/resources/test/fixtures/ruff/RUF036.py:4
↓ 3 callersFunctionfunction
Docstring comes first. Possibly many lines.
crates/ruff_python_formatter/resources/test/fixtures/black/cases/comments.py:32
↓ 3 callersFunctionfunction_has_deferred_annotations
(function: &ast::StmtFunctionDef)
crates/ty_python_semantic/src/types/infer/builder/function.rs:79
↓ 3 callersFunctionfunction_has_stub_body
Returns `true` if the function body is stub-like, ignoring a leading docstring.
crates/ty_python_semantic/src/types/function.rs:2191
↓ 3 callersMethodfunction_like_dunder_get
Model the effect of `__get__` on functions, staticmethods, and classmethods. See [`Self::try_call_dunder_get`] for general descriptor access, includi
crates/ty_python_semantic/src/types/callable.rs:70
↓ 3 callersFunctionfunction_signature_expression_type
Infer the type of a parameter or return annotation in a function signature. This is very similar to `definition_expression_type`, but knows that `Typ
crates/ty_python_semantic/src/types/signatures.rs:75
↓ 3 callersMethodfunction_spans
Returns a collection of useful spans for a function signature. These are useful for creating annotations on diagnostics. If there are no meaningful s
crates/ty_python_semantic/src/types.rs:11109
↓ 3 callersMethodfunction_type
(&self, function: &ast::StmtFunctionDef)
crates/ty_python_semantic/src/types/infer/builder.rs:2207
↓ 3 callersFunctiong
(x: list["int"])
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI020.py:8
↓ 3 callersMethodgenerate
(&self, db: &'db dyn Db, classinfo: Type<'db>)
crates/ty_python_semantic/src/types/narrow.rs:555
↓ 3 callersFunctiongenerate_comparison
( left: &Expr, ops: &[CmpOp], comparators: &[Expr], parent: AnyNodeRef, tokens: &Tokens,
crates/ruff_python_ast/src/helpers.rs:1645
← previousnext →4,001–4,100 of 31,766, ranked by callers