MCPcopy Create free account

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

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

↓ 2 callersMethodhas_bound_prefix
Returns whether any tracked prefix is at least possibly bound.
crates/ty_python_semantic/src/place_load.rs:1111
↓ 2 callersMethodhas_builtin_binding_in_scope
Return `true` if `member` is bound as a builtin *in a given scope*. Note that a "builtin binding" does *not* include explicit lookups via the `builti
crates/ruff_python_semantic/src/model.rs:390
↓ 2 callersFunctionhas_conditional_body
Returns `true` if the [`With`] statement is known to have a conditional body. In other words: if the [`With`] statement's body may or may not run. Fo
crates/ruff_linter/src/rules/flake8_return/visitor.rs:234
↓ 2 callersFunctionhas_duplicate
Return true if a string or byte sequence has a duplicate.
crates/ruff_linter/src/rules/pylint/rules/bad_str_strip_call.rs:164
↓ 2 callersMethodhas_empty_text
(&self)
crates/ruff_linter/src/rules/flake8_quotes/rules/check_string_quotes.rs:209
↓ 2 callersMethodhas_explicit_legacy_generic_base
Returns `true` if the class has a subscripted `Generic` or `Protocol` base, including an empty subscription such as `Generic[()]`.
crates/ty_python_semantic/src/types/class/static_literal.rs:442
↓ 2 callersMethodhas_explicit_metaclass
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:226
↓ 2 callersMethodhas_explicit_positional_receiver_annotation
(&self)
crates/ty_python_semantic/src/types/signatures.rs:1846
↓ 2 callersMethodhas_explicit_receiver_annotation
Returns whether an instance method has an explicit positional receiver annotation.
crates/ty_python_semantic/src/types/protocol_class.rs:2262
↓ 2 callersMethodhas_extra
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:13081
↓ 2 callersMethodhas_failed_call
(&self)
crates/ty_python_semantic/src/types/context.rs:287
↓ 2 callersFunctionhas_indented_description
(line: &ParsedLine<'_>, following_lines: &[ParsedLine<'_>])
crates/ty_ide/src/docstring/document/numpy.rs:764
↓ 2 callersMethodhas_inference
(&self, source: EvidenceSource)
crates/ty_python_semantic/src/types/constraints.rs:1920
↓ 2 callersMethodhas_lower_inference
(&self)
crates/ty_python_semantic/src/types/constraints.rs:3528
↓ 2 callersFunctionhas_magic_trailing_comma
Returns `true` if the range ends with a magic trailing comma (and the magic trailing comma should be respected).
crates/ruff_python_formatter/src/other/commas.rs:10
↓ 2 callersMethodhas_member_declaration
Return whether `name` is declared by this protocol or one of its superclasses. Unlike [`ProtocolClass::interface`], this includes names deliberately
crates/ty_python_semantic/src/types/protocol_class.rs:276
↓ 2 callersMethodhas_named_tuple_class_in_mro
Return `true` if this class is, or inherits from, a `NamedTuple` (inherits from `typing.NamedTuple`, either directly or indirectly, including function
crates/ty_python_semantic/src/types/class/static_literal.rs:1132
↓ 2 callersMethodhas_named_tuple_slots
Returns whether this class directly inherits the synthesized named-tuple layout.
crates/ty_python_semantic/src/types/class/slots.rs:274
↓ 2 callersMethodhas_own_class_binding
Returns whether a binding for this name reaches the end of the class body.
crates/ty_python_semantic/src/types/class/slots.rs:228
↓ 2 callersMethodhas_own_comparison_methods
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:307
↓ 2 callersMethodhas_own_custom_getattribute
Return whether this class defines its own non-default `__getattribute__`. An explicit metaclass can install the method even when the class body does
crates/ty_python_semantic/src/types/class/static_literal.rs:1024
↓ 2 callersMethodhas_own_diagnostics
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:430
↓ 2 callersMethodhas_own_slot_descriptor
Whether this class creates a descriptor for `name` in its own namespace.
crates/ty_python_semantic/src/types/class/slots.rs:539
↓ 2 callersMethodhas_parameters
(&self)
crates/ty_python_semantic/src/types/signatures.rs:540
↓ 2 callersMethodhas_pending
Returns `true` if there are any line suffixes and `false` otherwise.
crates/ruff_formatter/src/printer/line_suffixes.rs:29
↓ 2 callersMethodhas_receiver_determined_method_typevar
Returns whether the receiver can determine a method type variable used elsewhere. Receiver-only variables cannot affect the rest of the signature, cl
crates/ty_python_semantic/src/types/signatures.rs:1856
↓ 2 callersMethodhas_relation_to
Check a nominal type relation directly between classes, including their specializations. Assignability allows unknown bases to supply a subclass rela
crates/ty_python_semantic/src/types/class.rs:1515
↓ 2 callersFunctionhas_star_star_kwargs
(keywords: &[Keyword])
crates/ruff_linter/src/rules/pyflakes/rules/strings.rs:564
↓ 2 callersMethodhas_staticmethod_declaration
Whether this function was declared as a staticmethod, even if descriptor access has already exposed the ordinary function. Diagnostics can still use i
crates/ty_python_semantic/src/types/function.rs:1608
↓ 2 callersFunctionhas_trailing_comma
Returns `true` if the range ends with a trailing comma.
crates/ruff_python_formatter/src/other/commas.rs:18
↓ 2 callersMethodhas_unrestricted_variadics
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/signatures.rs:5263
↓ 2 callersMethodhas_upper_inference
(&self)
crates/ty_python_semantic/src/types/constraints.rs:3532
↓ 2 callersMethodhas_value
Returns whether this annotated assignment has a right-hand-side value.
crates/ty_python_core/src/definition.rs:1521
↓ 2 callersMethodhash
(&self, state: &mut H)
crates/ruff_python_formatter/src/comments/node_key.rs:42
↓ 2 callersMethodhash
(&self, state: &mut H)
crates/ruff_db/src/system/path.rs:23
↓ 2 callersMethodhash
(&self, state: &mut H)
crates/ty_python_core/src/place.rs:193
↓ 2 callersMethodhash
(&self, state: &mut H)
crates/ty_python_semantic/src/lint.rs:348
↓ 2 callersMethodheader_span
Returns a [`Span`] pointing to the `TypedDict` call expression.
crates/ty_python_semantic/src/types/class/typed_dict.rs:962
↓ 2 callersFunctionhierarchy_handler
The subtype and supertype implementation.
crates/ty_server/src/server/api/type_hierarchy.rs:16
↓ 2 callersMethodhint
Returns details for failures whose message only identifies the failed operation.
crates/ty_project/src/metadata/options.rs:2441
↓ 2 callersFunctionhint_if_stdlib_attribute_exists_on_other_versions
This function receives an unresolved `foo.bar` attribute access, where `foo` can be resolved to have a type but that type does not have a `bar` attrib
crates/ty_python_semantic/src/types/diagnostic.rs:6228
↓ 2 callersFunctionhint_if_stdlib_submodule_exists_on_other_versions
This function receives an unresolved `from foo import bar` import, where `foo` can be resolved to a module but that module does not have a `bar` membe
crates/ty_python_semantic/src/types/diagnostic.rs:6179
↓ 2 callersMethodid_url
Provide a URL for [`Title::id`] for more information on this diagnostic <div class="warning"> This is only relevant if `id` is present </div>
crates/ruff_annotate_snippets/src/snippet.rs:205
↓ 2 callersMethodidentifier
Returns the identifier of the command.
crates/ty_server/src/capabilities.rs:62
↓ 2 callersMethodidentifies_all_bindings
Returns whether [`Self::definitions()`] identifies the Python code that binds the name on every path where the name can have a value. For example, if
crates/ty_python_semantic/src/place/definitions.rs:179
↓ 2 callersMethodidentity_comparison_type
Upcast `self` to a type that conservatively describes its possible runtime objects in an identity comparison. Python's [`is` operator][is operator] t
crates/ty_python_semantic/src/types/infer/comparisons.rs:80
↓ 2 callersMethodiff
Returns a constraint set encoding that this constraint set is equivalent to another. In the result's source order, `self` will appear before `other`.
crates/ty_python_semantic/src/types/constraints.rs:779
↓ 2 callersFunctionimplementation
( server: &mut crate::TestServer, path: impl AsRef<ruff_db::system::SystemPath>, position: Positio
crates/ty_server/tests/e2e/implementation.rs:101
↓ 2 callersMethodimplementation_deprecated
If the implementation of this function is deprecated, returns the `@warnings.deprecated`. Checking if an overload is deprecated requires deeper call
crates/ty_python_semantic/src/types/function.rs:911
↓ 2 callersMethodimplicit_attribute
Tries to find declarations/bindings of an attribute named `name` that are only "implicitly" defined (`self.x = …`, `cls.x = …`) in a method of this cl
crates/ty_python_semantic/src/types/class/implicit_attributes.rs:510
↓ 2 callersFunctionimplicit_attribute_names
( db: &'db dyn Db, class_body_scope: ScopeId<'db>, )
crates/ty_python_semantic/src/types/class/implicit_attributes.rs:462
↓ 2 callersMethodimplicit_hash
A missing `__hash__` defaults to `None` on paths where the class body binds `__eq__`. Named tuples install their methods after class creation.
crates/ty_python_semantic/src/types/class/static_literal.rs:1818
↓ 2 callersMethodimport
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1235
↓ 2 callersMethodimport_laziness
Classify an import using its syntax and the current `__lazy_modules__` declaration. The caller must check that the import occurs in a context where la
crates/ruff_python_semantic/src/model.rs:2438
↓ 2 callersFunctionimport_literal_for_fix
(context: &InferContext, at: TextSize)
crates/ty_python_semantic/src/types/diagnostic.rs:3389
↓ 2 callersFunctionimport_name
Helper to get the module name up to the given component index
crates/ty_ide/src/goto.rs:1526
↓ 2 callersMethodimport_owner
Returns the distribution ID to use when checking the dependency required by an import. The returned string is an opaque package-manager ID from [`Sel
crates/ty_python_semantic/src/dependency.rs:216
↓ 2 callersMethodimport_symbol
Generate an [`Edit`] to reference the given symbol. Returns the [`Edit`] necessary to make the symbol available in the current scope along with the bo
crates/ruff_linter/src/importer/mod.rs:398
↓ 2 callersMethodimported_final_candidates_at_binding
Imports that may contribute a `Final` qualifier at this binding. These imports do not declare a type. Whether their source is actually `Final` is det
crates/ty_python_core/src/use_def.rs:1330
↓ 2 callersMethodimported_from
Returns the module that this symbol was re-exported from. This is only available for symbols that have been imported into `Self::module()` *and* are
crates/ty_ide/src/all_symbols.rs:189
↓ 2 callersMethodin_assert_statement
Return `true` if the model is in an `assert` statement.
crates/ruff_python_semantic/src/model.rs:2254
↓ 2 callersMethodin_async_context
(&self)
crates/ruff_python_parser/tests/fixtures.rs:656
↓ 2 callersMethodin_builder
Returns the builder-specific order that the typevars in this bound should be added in.
crates/ty_python_semantic/src/types/constraints/variables.rs:1296
↓ 2 callersMethodin_class_base
Return `true` if the model is visiting an item in a class's bases tuple (e.g. `Foo` in `class Bar(Foo): ...`)
crates/ruff_python_semantic/src/model.rs:2355
↓ 2 callersMethodin_complex_string_type_definition
Return `true` if the model is visiting a "complex string type definition" that was previously deferred when initially traversing the AST
crates/ruff_python_semantic/src/model.rs:2168
↓ 2 callersMethodin_docstring_position
Returns `true` if the expression spanning `range` sits in a docstring position: it makes up the whole of the current expression statement, and that st
crates/ruff_linter/src/checkers/ast/mod.rs:710
↓ 2 callersMethodin_dunder_all_assignment
Report whether a module-level `__all__` assignment is being visited. This differs from [`SemanticModel::in_dunder_all_definition`], which is set only
crates/ruff_linter/src/checkers/ast/mod.rs:3470
↓ 2 callersMethodin_f_string
Return `true` if the model is in an f-string.
crates/ruff_python_semantic/src/model.rs:2259
↓ 2 callersMethodin_function_overload_or_abstractmethod
Returns `true` if the current scope is the function body scope of a function overload (that is, the stub declaration decorated with `@overload`, not t
crates/ty_python_semantic/src/types/infer/builder.rs:2233
↓ 2 callersMethodin_interpolated_string_replacement_field
Return `true` if the model is in an f-string replacement field.
crates/ruff_python_semantic/src/model.rs:2274
↓ 2 callersFunctionin_nested_context
Check if the current statement is nested within another [`StmtClassDef`] or [`StmtFunctionDef`].
crates/ruff_linter/src/rules/pyupgrade/rules/pep695/mod.rs:376
↓ 2 callersMethodin_no_type_check
Return `true` if the model is in a `@no_type_check` context.
crates/ruff_python_semantic/src/model.rs:2314
↓ 2 callersFunctionin_parentheses_only_soft_line_break_or_space
Creates a [`soft_line_break_or_space`] if the expression is enclosed by (optional) parentheses (`()`, `[]`, or `{}`). Prints a [`space`] if the expres
crates/ruff_python_formatter/src/expression/parentheses.rs:253
↓ 2 callersMethodin_protocol_or_abstract_method
Return `true` if the model is in a `typing.Protocol` subclass or an abstract method.
crates/ruff_python_semantic/src/model.rs:2423
↓ 2 callersMethodin_runtime_ambiguous_annotation
Return `true` if the context is in a runtime-ambiguous type annotation.
crates/ruff_python_semantic/src/model.rs:2142
↓ 2 callersMethodin_stub
Are we currently inferring types in a stub file?
crates/ty_python_semantic/src/types/context.rs:429
↓ 2 callersMethodin_stub_file
Return `true` if the model is in a stub file (i.e., a file with a `.pyi` extension).
crates/ruff_python_semantic/src/model.rs:2336
↓ 2 callersMethodin_type_expression
If we see a value of this type used as a type expression, what type does it name? For example, the builtin `int` as a value expression is of type `Ty
crates/ty_python_semantic/src/types.rs:9171
↓ 2 callersMethodin_type_expression_impl
( &self, db: &'db dyn Db, scope_id: ScopeId<'db>, typevar_binding_context: Opt
crates/ty_python_semantic/src/types.rs:9181
↓ 2 callersMethodin_typing_context
Return `true` if the context is in a typing context.
crates/ruff_python_semantic/src/reference.rs:46
↓ 2 callersMethodinclude
(&self)
crates/ruff_linter/src/rules/flake8_tidy_imports/settings.rs:134
↓ 2 callersMethodincludes
Returns whether this selection mode should count the given error.
crates/ty_python_semantic/src/types/call/bind.rs:3569
↓ 2 callersMethodincludes_member_or_object_fallback
Includes inherited `object` members that are guaranteed for every instance. Subclasses can disable `__hash__`, and slotted instances can omit the `__
crates/ty_python_semantic/src/types/protocol_class.rs:545
↓ 2 callersMethodincludes_name
Returns `true` if the file is exempt from the rule with the given name.
crates/ruff_linter/src/noqa.rs:197
↓ 2 callersMethodincoming_mut
(&mut self)
crates/ruff_server/src/session/request_queue.rs:38
↓ 2 callersMethodincrement_indent_level
(mut self, indent_style: IndentStyle)
crates/ruff_formatter/src/printer/call_stack.rs:54
↓ 2 callersMethodincremental_matcher
Creates a matcher for determining whether paths are ignored during incremental walking.
crates/ruff_db/src/system/walk_directory.rs:75
↓ 2 callersMethodindent
(&mut self, indent: Indentation)
crates/ruff_python_parser/src/lexer/indentation.rs:95
↓ 2 callersFunctionindentation
(source: &'a str, located: &T)
crates/ruff_python_ast/src/whitespace.rs:9
↓ 2 callersMethodindentation
(self)
crates/ruff_formatter/src/printer/call_stack.rs:50
↓ 2 callersMethodindex
(&self)
crates/ruff_server/src/lint.rs:336
↓ 2 callersMethodindex
(self)
crates/ty_python_core/src/narrowing_constraints.rs:70
↓ 2 callersMethodindexed_source_place
Retrieve the lexical operand produced for this expression in the current scope.
crates/ty_python_semantic/src/types/infer/builder.rs:11023
↓ 2 callersMethodinfer_all_argument_types
Infers every call argument using the provided set of type context.
crates/ty_python_semantic/src/types/infer/builder.rs:6627
↓ 2 callersMethodinfer_and_try_call_dunder
( &mut self, object: Type<'db>, name: &str, lookup_policy: MemberLookupPolicy,
crates/ty_python_semantic/src/types/infer/builder.rs:5937
↓ 2 callersMethodinfer_and_try_call_dunder_member
( &mut self, member: PlaceAndQualifiers<'db>, ast_arguments: ArgumentsIter<'_>,
crates/ty_python_semantic/src/types/infer/builder.rs:5959
↓ 2 callersMethodinfer_and_try_call_setattr
Infer an attribute-assignment value using the context provided by `__setattr__`, then validate the synthesized setter call and return both its result
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:242
↓ 2 callersMethodinfer_annotated_assignment_annotation
Infer an annotated assignment's annotation using the file's deferred-annotation semantics.
crates/ty_python_semantic/src/types/infer/builder.rs:4696
↓ 2 callersMethodinfer_annotation_expression_inner
( &mut self, annotation: &ast::Expr, deferred_state: DeferredExpressionState,
crates/ty_python_semantic/src/types/infer/builder/annotation_expression.rs:66
↓ 2 callersMethodinfer_argument_constraints
( &self, builder: &mut SpecializationBuilder<'db, 'c>, preferred_type_mappings: &FxHas
crates/ty_python_semantic/src/types/call/bind.rs:7695
← previousnext →5,801–5,900 of 31,766, ranked by callers