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
↓ 2 callers
Function
matches_module_prefix
(module: &str, prefix: &str)
crates/ruff_workspace/src/options.rs:2327
↓ 2 callers
Method
matching_literals
( self, db: &'db dyn Db, kind: LiteralComparisonKind, )
crates/ty_python_semantic/src/types/literal.rs:492
↓ 2 callers
Method
matching_type_annotation
Find a definition's annotation if it matches the type inferred at the use site.
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:924
↓ 2 callers
Method
materialization_equivalence
(&self)
crates/ty_python_semantic/src/types.rs:575
↓ 2 callers
Method
materialization_kind
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:469
↓ 2 callers
Method
materialize_narrowing
( &self, pending: &mut PendingPlaceState, target: PendingReachabilityId, narro
crates/ty_python_core/src/use_def.rs:1832
↓ 2 callers
Method
materialize_ref_at_use
Returns the place state needed to resolve a use. Pending narrowing gates are only needed to preserve path correlations across a later place change or
crates/ty_python_core/src/use_def.rs:1919
↓ 2 callers
Function
max_empty_lines
Counts the number of empty lines in `contents`.
crates/ruff_python_formatter/src/comments/placement.rs:2382
↓ 2 callers
Method
max_remaining_fuel_for
Returns the greatest remaining fuel for any derivation of `assignment` on this path.
crates/ty_python_semantic/src/types/constraints/paths.rs:584
↓ 2 callers
Method
may_affect_source
Returns whether the source may need edits for these module name changes.
crates/ty_ide/src/will_rename.rs:227
↓ 2 callers
Method
may_contain_name
Returns whether or not this directory might contain the given entry.
crates/ty_module_resolver/src/path.rs:399
↓ 2 callers
Method
may_have_comment
(&self, node: impl Into<AnyNodeRef<'a>>)
crates/ruff_python_formatter/src/comments/mod.rs:267
↓ 2 callers
Function
maybe_add_undefined_reveal_clarification
( diagnostic: &Diagnostic, original: std::fmt::Arguments, )
crates/mdtest/src/matcher.rs:237
↓ 2 callers
Method
maybe_flush
Flush any pending reports if streaming diagnostics. Note: The flush is throttled when streaming.
crates/ty_server/src/server/api/requests/workspace_diagnostic.rs:496
↓ 2 callers
Method
maybe_grow_stack
(&mut self, f: impl FnOnce(&mut Self) -> T)
crates/ruff_python_parser/src/parser/mod.rs:959
↓ 2 callers
Function
maybe_lowercase
Lowercase the given string, if it contains any uppercase characters.
crates/ruff_linter/src/rules/isort/sorting.rs:184
↓ 2 callers
Function
mdtest_analysis_settings
(options: Option<&Analysis>)
crates/ty_test/src/db.rs:297
↓ 2 callers
Function
mdtest_lint_registry
Includes a no-op rule for testing renamed rules in suppression comments.
crates/ty_test/src/db.rs:356
↓ 2 callers
Method
member_id
( &self, members: &IndexVec<ScopedMemberId, Member>, member: &MemberExprRef<'_>, )
crates/ty_python_core/src/member.rs:502
↓ 2 callers
Function
member_lookup_or_fall_back_to
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, result: MemberLookupResult<'db>, fallback_fn
crates/ty_python_semantic/src/types.rs:1261
↓ 2 callers
Method
member_mut
(&mut self, id: ScopedMemberId)
crates/ty_python_core/src/place.rs:359
↓ 2 callers
Method
member_promotability
(&self, db: &'db dyn Db, name: &Name)
crates/ty_python_semantic/src/types/equality/enums.rs:578
↓ 2 callers
Function
member_type
(name: &str, settings: &Settings)
crates/ruff_linter/src/rules/isort/sorting.rs:19
↓ 2 callers
Method
member_type
(&self, db: &'db dyn Db, name: &Name, promotable: bool)
crates/ty_python_semantic/src/types/equality/enums.rs:688
↓ 2 callers
Method
member_types
(self)
crates/ty_python_semantic/src/types/protocol_class.rs:1893
↓ 2 callers
Method
member_with_augmented_bindings
Pair an ordinary member lookup with augmented assignments that first read their target. ```python class Counter: value = 0 def increment(self): self
crates/ty_python_semantic/src/types/class.rs:2312
↓ 2 callers
Method
members
Iterator over all members in this scope.
crates/ty_python_core/src/place.rs:235
↓ 2 callers
Method
memoized
Returns a formattable object that memoizes the result of `Format` by cloning. Mainly useful if the same sub-tree can appear twice in the formatted out
crates/ruff_formatter/src/format_extensions.rs:57
↓ 2 callers
Method
merge
(&mut self, snapshot: ExceptionCheckpointSnapshot)
crates/ty_python_core/src/use_def/exception_checkpoint.rs:66
↓ 2 callers
Method
merge
(self, other: Self)
crates/ty_python_semantic/src/place.rs:71
↓ 2 callers
Method
merge
Merge this generic context with another, returning a new generic context that contains type variables from both contexts.
crates/ty_python_semantic/src/types/generics.rs:494
↓ 2 callers
Method
merge_ambiguous_return_types
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/call/bind.rs:4519
↓ 2 callers
Method
merge_column
(&self, types: impl Iterator<Item = Type<'db>>)
crates/ty_python_semantic/src/types/call/ambiguous.rs:103
↓ 2 callers
Method
merge_constraint_or
Merge two constraints with OR semantics (union/disjunction).
crates/ty_python_semantic/src/types/narrow.rs:1290
↓ 2 callers
Function
merge_constraints_or
Merge constraints with OR semantics (union/disjunction). When we have `constraint1 OR constraint2`, we simply concatenate the disjuncts from both con
crates/ty_python_semantic/src/types/narrow.rs:1459
↓ 2 callers
Method
merge_field
( &mut self, db: &'db dyn Db, field: FieldInstance<'db>, specialization: Optio
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:307
↓ 2 callers
Function
merge_receiver_constraints
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, first: Option<&ReceiverConstraints<'db>>, se
crates/ty_python_semantic/src/types/signatures.rs:115
↓ 2 callers
Method
merge_solution
( &self, types: &mut FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>, solution: &[Type
crates/ty_python_semantic/src/types/generics.rs:3066
↓ 2 callers
Method
merge_strict
(&mut self, strict: ConfigBoolean)
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:303
↓ 2 callers
Method
merge_window
Set the "merge window" for annotations and fix diff hunks in this test. Nearby annotations or fix edits are rendered in a single source frame even wh
crates/ruff_db/src/diagnostic/render.rs:2544
↓ 2 callers
Method
message
(&self)
crates/mdtest/src/matcher.rs:73
↓ 2 callers
Method
message
(&self)
crates/ruff_linter/src/rules/pylint/rules/logging.rs:50
↓ 2 callers
Method
message_formats
()
crates/ruff_linter/src/violation.rs:114
↓ 2 callers
Function
metaclass_instance_type
Return the instance type of a metaclass, preserving that its instances are class objects. If the metaclass is `type[Unknown]`, ordinary instance proj
crates/ty_python_semantic/src/types/class.rs:3464
↓ 2 callers
Method
metadata
(&self)
crates/ruff_dev/src/generate_ty_options.rs:132
↓ 2 callers
Method
method
(self)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:10
↓ 2 callers
Method
method1
(self)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/target_version_flag.py:3
↓ 2 callers
Method
min_start
Return the [`TextSize`] of the first [`Edit`] in the [`Fix`].
crates/ruff_diagnostics/src/fix.rs:144
↓ 2 callers
Method
minimum_key_size
(&self)
crates/ruff_linter/src/rules/flake8_bandit/rules/weak_cryptographic_key.rs:72
↓ 2 callers
Function
minimum_parallel_job_len
Chooses a minimum Rayon job length without starving the worker pool on smaller inputs. The maximum should be an empirically chosen upper bound for th
crates/ty_project/src/parallel.rs:12
↓ 2 callers
Function
missing_args
(checker: &Checker, docstring: &Docstring, docstrings_args: &FxHashSet<String>)
crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs:1896
↓ 2 callers
Method
missing_submodule_is_terminal
(&self, context: &ResolverContext)
crates/ty_module_resolver/src/resolve.rs:1365
↓ 2 callers
Function
mixed_case_variable_in_class_scope
N815
crates/ruff_linter/src/rules/pep8_naming/rules/mixed_case_variable_in_class_scope.rs:59
↓ 2 callers
Function
mixed_case_variable_in_global_scope
N816
crates/ruff_linter/src/rules/pep8_naming/rules/mixed_case_variable_in_global_scope.rs:68
↓ 2 callers
Method
mixin_class
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/class/enum_literal.rs:211
↓ 2 callers
Function
mk_table
(safe_fixes: &[&str], unsafe_fixes: &[&str])
crates/ruff_linter/src/settings/fix_safety_table.rs:167
↓ 2 callers
Method
mode
(&self)
crates/ruff_formatter/src/format_element/tag.rs:245
↓ 2 callers
Function
model_config
(db: &'db dyn Db, class: StaticClassLiteral<'db>)
crates/ty_python_semantic/src/types/dedicated/pydantic.rs:734
↓ 2 callers
Method
modify
A private function for overriding how we update the line index by default.
crates/ty_server/src/document/text_document.rs:150
↓ 2 callers
Method
module_completions
Returns completions for symbols available in the given module as if it were imported by this model's `File`.
crates/ty_python_semantic/src/semantic_model.rs:248
↓ 2 callers
Function
module_detail
(db: &dyn Db, file: ResolverFile<'_>)
crates/ty_ide/src/call_hierarchy.rs:121
↓ 2 callers
Function
module_docstring
Get the module-level docstring for the given file.
crates/ty_python_semantic/src/lib.rs:223
↓ 2 callers
Method
module_getattr_call_failure
Recreates a failed module `__getattr__` call without caching its call bindings.
crates/ty_python_semantic/src/types.rs:1032
↓ 2 callers
Method
module_laziness
Test exact module membership in the current `__lazy_modules__` declaration. Returns [`ImportLaziness::Unknown`] for dynamic declarations or uncertain
crates/ruff_python_semantic/src/model.rs:2429
↓ 2 callers
Method
module_name
For example, given `import foo`, returns `["foo"]`.
crates/ruff_python_semantic/src/binding.rs:758
↓ 2 callers
Method
module_owner
(&self, module: &ModuleName)
crates/ty_python_semantic/src/dependency.rs:262
↓ 2 callers
Function
module_type_body_scope
Return the body scope of the canonical `types.ModuleType` class.
crates/ty_python_semantic/src/place.rs:2469
↓ 2 callers
Function
monacoRangeToTyRange
(range: IRange)
playground/ty/src/Editor/Editor.tsx:1079
↓ 2 callers
Method
most_derived_metaclass
Select the more derived metaclass, or return `None` for a conflict. One metaclass must derive from the other. Unlike [`Self::could_coexist_in_mro_wit
crates/ty_python_semantic/src/types/class.rs:1531
↓ 2 callers
Method
must_point_directly_to_sys_prefix
Whether paths with this origin always point directly to the `sys.prefix` directory. Some variants can point either directly to `sys.prefix` or to a P
crates/ty_site_packages/src/lib.rs:2226
↓ 2 callers
Function
name
(name: &str, checker: &Checker, at: TextSize)
crates/ruff_linter/src/rules/flake8_annotations/helpers.rs:251
↓ 2 callers
Method
name
(self)
scripts/ty_benchmark/src/benchmark/tool.py:96
↓ 2 callers
Method
name
(self, name: String)
crates/ty_server/src/server/schedule/thread.rs:48
↓ 2 callers
Method
name
Returns the name used to represent the diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:470
↓ 2 callers
Method
name
(self)
crates/ty_python_semantic/src/types/overrides.rs:2327
↓ 2 callers
Method
name
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:315
↓ 2 callers
Method
name
Return the name of the symbol at runtime
crates/ty_python_semantic/src/types/special_form.rs:685
↓ 2 callers
Method
name_source
Returns the binding or decorator from which this exposure gets its public name.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:781
↓ 2 callers
Method
name_type
Returns the type of `.name`/`._name_` for a given enum member. This is the canonical member name when alias detection is precise. When alias detectio
crates/ty_python_semantic/src/types/enums.rs:402
↓ 2 callers
Method
names
(self)
crates/ty_ide/src/docstring/document/google.rs:175
↓ 2 callers
Function
nan_comparison_impl
(checker: &Checker, comparators: impl Iterator<Item = &'a Expr>)
crates/ruff_linter/src/rules/pylint/rules/nan_comparison.rs:67
↓ 2 callers
Method
narrow
(&mut self, items: I)
crates/ruff_python_formatter/src/range.rs:467
↓ 2 callers
Method
narrow_nominal_attribute
( &self, attribute_value_type: Type<'db>, attribute_value_expr: &ast::Expr, at
crates/ty_python_semantic/src/types/narrow.rs:5437
↓ 2 callers
Method
narrow_offset
(&mut self, offset: TextSize)
crates/ruff_python_formatter/src/range.rs:478
↓ 2 callers
Method
narrow_place_load_source
( &self, place_expr: PlaceExprRef, operand: Option<PlaceUse>, source: &mut Res
crates/ty_python_semantic/src/types/infer/builder.rs:10981
↓ 2 callers
Method
narrow_place_with_applicable_constraints
Perform narrowing with applicable constraints between the current scope and the enclosing scope.
crates/ty_python_semantic/src/types/infer/builder.rs:10519
↓ 2 callers
Method
narrow_projected
Narrows a projected constraint while reusing suffix results for its original binding type. Registering each root lets the graph recognize shared join
crates/ty_python_semantic/src/reachability.rs:1256
↓ 2 callers
Method
narrow_source_place
( &self, place: Option<&SourcePlace>, ty: Type<'db>, constraint_keys: &[(FileS
crates/ty_python_semantic/src/types/infer/builder.rs:11111
↓ 2 callers
Function
narrow_string_membership
Narrow membership in a known string literal using substring semantics.
crates/ty_python_semantic/src/types/narrow/containment.rs:157
↓ 2 callers
Method
narrow_tuple_subscript
Narrow unions of tuples by comparing an element's value. Given a subscript expression like `t[0]` where `t` is a union of tuple types, and a comparis
crates/ty_python_semantic/src/types/narrow.rs:5307
↓ 2 callers
Method
narrow_tuple_subscript_by_type
Apply an element's type constraint to its containing tuple union.
crates/ty_python_semantic/src/types/narrow.rs:5363
↓ 2 callers
Method
narrow_typeddict_subscript
Narrow tagged unions of `TypedDict`s with `Literal` keys. Given a subscript expression like `union["tag"]` where `union` is a `TypedDict` (or union c
crates/ty_python_semantic/src/types/narrow.rs:5163
↓ 2 callers
Method
narrow_uncached
Recursively evaluates an unshared projected path while accumulating narrowing constraints.
crates/ty_python_semantic/src/reachability.rs:1687
↓ 2 callers
Method
navigation_targets
(&self, db: &dyn Db, env: &ProgramEnvironment<'_>)
crates/ty_ide/src/lib.rs:294
↓ 2 callers
Function
needs_chaperone_space
If the last line of the docstring is `content""""` or `content\"""`, we need a chaperone space that avoids `content""""` and `content\"""`. This only
crates/ruff_python_formatter/src/string/docstring.rs:1601
↓ 2 callers
Function
needs_line_break
Returns `true` if the unary operator will have a hard line break between the operator and its operand and thus requires parentheses.
crates/ruff_python_formatter/src/expression/expr_unary_op.rs:105
↓ 2 callers
Function
negate
Negate a condition, i.e., `a` => `not a` and `not a` => `a`.
crates/ruff_linter/src/cst/helpers.rs:21
↓ 2 callers
Method
negate
(&self)
crates/ruff_python_ast/src/nodes.rs:2958
↓ 2 callers
Method
negated
(self)
crates/ty_python_core/src/predicate.rs:92
↓ 2 callers
Method
negated
Reverse the defensive branches for the operand of `not`: a truthy operand makes the containing condition false, and a falsy operand makes it true. Fo
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:296
← previous
next →
6,401–6,500 of 31,562, ranked by callers