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
↓ 3 callers
Function
key_in_dict
SIM118
crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs:60
↓ 3 callers
Method
key_membership_truthiness
Returns whether a literal string key must, cannot, or might be present. An undeclared key can still exist in an implicitly open `TypedDict` or one wi
crates/ty_python_semantic/src/types/typed_dict.rs:400
↓ 3 callers
Method
kind
(&self)
crates/ruff_source_file/src/line_index.rs:69
↓ 3 callers
Method
kind
Determine whether this module is a single-file module or a package
crates/ty_module_resolver/src/module.rs:135
↓ 3 callers
Method
kind
(&self)
crates/ruff_diagnostics/src/edit.rs:69
↓ 3 callers
Method
kind
(&self)
crates/ruff_python_trivia/src/tokenizer.rs:198
↓ 3 callers
Method
kind
(self)
crates/ty_python_core/src/member.rs:738
↓ 3 callers
Method
kind
(self)
crates/ty_python_semantic/src/types/call/bind/constructor.rs:778
↓ 3 callers
Method
known_function_decorators
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/class/static_literal.rs:848
↓ 3 callers
Method
language_id
(&self)
crates/ty_server/src/session/index.rs:254
↓ 3 callers
Method
language_id
(&self)
crates/ruff_server/src/edit/text_document.rs:80
↓ 3 callers
Method
last_definition
Returns the [`Definition`] for the last overload or implementation in this function.
crates/ty_python_semantic/src/types/function.rs:1650
↓ 3 callers
Method
last_definition_raw_signature
Typed externally-visible "raw" signature of the last overload or implementation of this function. The `return_callable_typevar_scope` controls whether
crates/ty_python_semantic/src/types/function.rs:1044
↓ 3 callers
Method
lazy_import_context
(&self)
crates/ruff_linter/src/checkers/ast/mod.rs:342
↓ 3 callers
Function
leading_comments
Formats the passed comments as leading comments
crates/ruff_python_formatter/src/comments/format.rs:25
↓ 3 callers
Method
leading_trailing
Returns an iterator over the [leading](self#leading-comments) and [trailing comments](self#trailing-comments) of `node`.
crates/ruff_python_formatter/src/comments/mod.rs:355
↓ 3 callers
Method
leading_whitespace
Returns the whitespace and whitespace byte-length *before* the `token`
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:200
↓ 3 callers
Method
len
(&self)
crates/ty_python_semantic/src/suppression.rs:967
↓ 3 callers
Method
len
(&self)
crates/ruff_linter/src/docstrings/sections.rs:238
↓ 3 callers
Method
len
(&self)
crates/ruff_index/src/slice.rs:59
↓ 3 callers
Method
level
Returns the verbosity level based on the number of `-v` and `-q` flags. Returns `None` if the user did not specify any verbosity flags.
crates/ty/src/logging.rs:46
↓ 3 callers
Function
lex_invalid
(source: &str, mode: Mode)
crates/ruff_python_parser/src/lexer.rs:1788
↓ 3 callers
Function
lex_valid
(source: &str, mode: Mode, start_offset: TextSize)
crates/ruff_python_parser/src/lexer.rs:1772
↓ 3 callers
Method
line_count
(&self)
crates/ruff_source_file/src/lib.rs:89
↓ 3 callers
Method
line_end
(&self, offset: TextSize)
crates/ruff_source_file/src/line_ranges.rs:368
↓ 3 callers
Method
line_index
(&self)
crates/ty_python_semantic/src/semantic_model.rs:94
↓ 3 callers
Method
line_text
(&self, index: OneIndexed)
crates/ruff_source_file/src/lib.rs:77
↓ 3 callers
Function
lines_before
Returns the number of newlines between `offset` and the first non whitespace character in the source code.
crates/ruff_python_trivia/src/tokenizer.rs:41
↓ 3 callers
Method
lines_range
Computes the range of all lines that this `range` covers. The range starts at the beginning of the line at `range.start()` and goes up to, but exclud
crates/ruff_source_file/src/line_ranges.rs:225
↓ 3 callers
Method
lines_str
Returns the text of all lines that include `range`. See [`LineRanges::lines_str`].
crates/ruff_linter/src/locator.rs:139
↓ 3 callers
Function
lint_fix
Generate `Diagnostic`s from source code content, iteratively fixing until stable.
crates/ruff_linter/src/linter.rs:519
↓ 3 callers
Function
lint_fix_toml
Generate [`Diagnostic`]s for a TOML configuration file, iteratively fixing until stable.
crates/ruff_linter/src/toml.rs:50
↓ 3 callers
Method
lint_suppressions
Returns applicable suppressions for `id`, with inline suppressions in reverse source order.
crates/ty_python_semantic/src/suppression.rs:410
↓ 3 callers
Function
list_submodules
(db: &'db dyn Db, module: Module<'db>)
crates/ty_module_resolver/src/resolve/search.rs:77
↓ 3 callers
Method
loaded_symbol_name
Returns the loaded symbol's name, or `None` when the loaded place is a member. For example, this returns a name for `value`, but not for `value.attr`
crates/ty_python_semantic/src/place_load.rs:863
↓ 3 callers
Method
log_warning
(&self)
crates/ruff_linter/src/rule_selector.rs:103
↓ 3 callers
Method
loop_header
(&self, id: LoopHeaderId)
crates/ty_python_core/src/use_def.rs:1051
↓ 3 callers
Method
loop_header_id
(&self)
crates/ty_python_core/src/definition.rs:1651
↓ 3 callers
Function
make_cell_uri
(path: &Path, index: usize)
crates/ruff_server/tests/e2e/notebook.rs:442
↓ 3 callers
Method
map_leave_aliases
A version of [`UnionType::map`] that does not unpack type aliases.
crates/ty_python_semantic/src/types/set_theoretic.rs:403
↓ 3 callers
Method
map_range
Maps a metadata range to its corresponding range in the Python source.
crates/ruff_python_ast/src/script.rs:180
↓ 3 callers
Method
map_receiver_constraints
( &self, db: &'db dyn Db, type_mapping: &TypeMapping<'_, 'db>, tcx: TypeContex
crates/ty_python_semantic/src/types/signatures.rs:2132
↓ 3 callers
Function
map_targets_to_links
( db: &dyn Db, targets: RangedValue<NavigationTargets>, source: &SourceText, index: &LineIndex
crates/ty_wasm/src/lib.rs:828
↓ 3 callers
Method
map_types
Maps the specialization's types, returning [`Cow::Borrowed`] without allocating if every type is unchanged and [`Cow::Owned`] otherwise.
crates/ty_python_semantic/src/types/generics.rs:1266
↓ 3 callers
Method
margin
(&self)
crates/ruff_annotate_snippets/src/renderer/mod.rs:343
↓ 3 callers
Method
mark_definition_ids_used
( &mut self, definition_ids: impl IntoIterator<Item = ScopedDefinitionId>, )
crates/ty_python_core/src/use_def.rs:3145
↓ 3 callers
Method
mark_global
(&mut self)
crates/ty_python_core/src/symbol.rs:135
↓ 3 callers
Method
mark_invalid_type_form
Records an invalid type form even when its diagnostic is suppressed or inferred separately.
crates/ty_python_semantic/src/types/context.rs:277
↓ 3 callers
Method
mark_nonlocal
(&mut self)
crates/ty_python_core/src/symbol.rs:139
↓ 3 callers
Method
mark_place_bound
(&mut self, id: ScopedPlaceId)
crates/ty_python_core/src/builder.rs:1393
↓ 3 callers
Method
mark_place_declared
(&mut self, id: ScopedPlaceId)
crates/ty_python_core/src/builder.rs:1398
↓ 3 callers
Method
mark_support_used
(&mut self, _storage: &mut ConstraintSetStorage<'_>, support: SupportId)
crates/ty_python_semantic/src/types/constraints/owned.rs:79
↓ 3 callers
Function
mask
(kind: TokenKind)
crates/ruff_python_parser/src/token_set.rs:33
↓ 3 callers
Function
match_function_def
( statement: &'a mut Statement<'b>, )
crates/ruff_linter/src/cst/matchers.rs:179
↓ 3 callers
Function
match_head
Return the [`ast::ExprName`] at the head of the expression, if any.
crates/ruff_linter/src/rules/airflow/helpers.rs:207
↓ 3 callers
Function
match_open_mode
Match open mode to see if it is supported.
crates/ruff_linter/src/rules/refurb/helpers.rs:408
↓ 3 callers
Method
matches
(&self, candidate: &str)
crates/ruff_linter/src/settings/types.rs:684
↓ 3 callers
Function
matches_password_name
(string: &str)
crates/ruff_linter/src/rules/flake8_bandit/helpers.rs:18
↓ 3 callers
Method
matching_overloads_mut
Returns an iterator over all the mutable overloads that matched for this call binding.
crates/ty_python_semantic/src/types/call/bind.rs:4711
↓ 3 callers
Method
materialize
Apply a generator's materialization with the variance of each operation.
crates/ty_python_semantic/src/types.rs:2419
↓ 3 callers
Method
materialize_reachability
( &self, pending: &'a mut PendingPlaceState, target: PendingReachabilityId, re
crates/ty_python_core/src/use_def.rs:1863
↓ 3 callers
Method
materialized
(self, kind: MaterializationKind)
crates/ty_python_semantic/src/types.rs:11915
↓ 3 callers
Method
may_be_data_descriptor
Returns whether this type should be considered a possible data descriptor. If this type is a union, returns true if _any_ element is a data descriptor
crates/ty_python_semantic/src/types.rs:5556
↓ 3 callers
Method
may_be_false
(self)
crates/ty_python_core/src/lib.rs:1009
↓ 3 callers
Method
may_have_unbounded_specialization
Whether revisiting this constructor can keep changing its type arguments.
crates/ty_python_semantic/src/types/cyclic.rs:128
↓ 3 callers
Function
maybe_anonymized
(renderer: &Renderer, line_num: usize, max_line_num_len: usize)
crates/ruff_annotate_snippets/src/renderer/render.rs:2289
↓ 3 callers
Function
mdtest_rule_selection
(rules: Option<&Rules>, required_rule: Option<&str>)
crates/ty_test/src/db.rs:375
↓ 3 callers
Method
measure_mode
(self)
crates/ruff_formatter/src/printer/call_stack.rs:46
↓ 3 callers
Method
member
(&self, id: ScopedMemberId)
crates/ty_python_core/src/place.rs:282
↓ 3 callers
Function
member_contract
Resolve an owner's declaration as seen through the receiver being checked. Keep the owner's generic specialization, but bind `Self` and descriptor ac
crates/ty_python_semantic/src/types/overrides/attributes.rs:135
↓ 3 callers
Method
member_count
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/protocol_class.rs:490
↓ 3 callers
Method
member_name
For example, given `import foo`, returns `"foo"`.
crates/ruff_python_semantic/src/binding.rs:763
↓ 3 callers
Method
merge
Merges the quotes metadata of different literals. ## Raw and triple quoted strings Merging raw and triple quoted strings is only correct if all liter
crates/ruff_python_formatter/src/string/normalize.rs:370
↓ 3 callers
Method
merge
(&mut self, other: Self)
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/exemptions.rs:484
↓ 3 callers
Function
merge_constraints_and
Merge constraints with AND semantics (intersection/conjunction). When we have `constraint1 & constraint2`, we need to distribute AND over the OR in t
crates/ty_python_semantic/src/types/narrow.rs:1430
↓ 3 callers
Function
method_override_types
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, subclass_type: Type<'db>, superclass_type: T
crates/ty_python_semantic/src/types/overrides.rs:1609
↓ 3 callers
Method
method_shadowing_contract
Return a type that represents the "contract" that a callable must satisfy when attempting to shadow a method on an instance. For example: ```python c
crates/ty_python_semantic/src/types/callable.rs:128
↓ 3 callers
Method
middle_token
(self)
crates/ruff_python_parser/src/string.rs:58
↓ 3 callers
Method
modify_with_manual_index
A private function for overriding how we update the line index by default.
crates/ruff_server/src/edit/text_document.rs:149
↓ 3 callers
Method
module
(&self, module: &'ast ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1437
↓ 3 callers
Method
module_dependency_kind
(mut self, kind: ModuleDependencyKind)
crates/ty_ide/src/completion.rs:638
↓ 3 callers
Method
module_type_from_name
(&self, module_name: &ModuleName)
crates/ty_python_semantic/src/types/infer/builder.rs:5636
↓ 3 callers
Method
multiline_ranges
Returns the byte offset ranges of multiline strings.
crates/ruff_python_index/src/indexer.rs:116
↓ 3 callers
Method
name
(&self)
crates/ruff_dev/src/generate_ty_options.rs:125
↓ 3 callers
Method
name
(&self)
crates/mdtest/src/parser.rs:143
↓ 3 callers
Method
name_matches
(&self, expr: &Expr)
crates/ruff_linter/src/rules/flake8_bugbear/rules/reuse_of_groupby_generator.rs:88
↓ 3 callers
Method
narrow_targets
If the declared type is a union, returns the target elements that it can be narrowed to.
crates/ty_python_semantic/src/types/infer/type_context.rs:110
↓ 3 callers
Method
narrowing_constraints
(&self)
crates/ty_python_core/src/use_def.rs:1616
↓ 3 callers
Function
necessary_match_pattern_type
Return a type that contains every value that can match `pattern`. For example, given: ```python def f(x: list[object]): match x: case [int(real=0)]:
crates/ty_python_semantic/src/types/narrow.rs:1572
↓ 3 callers
Method
needs_self_mapping
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, parameters: &[Paramet
crates/ty_python_semantic/src/types/signatures.rs:2325
↓ 3 callers
Method
negate
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types.rs:3454
↓ 3 callers
Function
nested_workspace_server
Creates a test server for the following temporary workspace: ```text <temp_dir>/ ├── .ruff.toml # exclude or extend-exclude = ["sub"] ├─
crates/ruff_server/tests/e2e/workspace.rs:247
↓ 3 callers
Method
new
(file: File, range: TextRange)
crates/ruff_db/src/files.rs:679
↓ 3 callers
Method
next
(&mut self)
crates/ruff_annotate_snippets/src/renderer/source_map.rs:726
↓ 3 callers
Method
next
(&mut self)
crates/ruff_python_formatter/src/verbatim.rs:576
↓ 3 callers
Method
next
(&mut self)
crates/ty_python_core/src/member.rs:807
↓ 3 callers
Method
next
(&mut self)
crates/ruff_unicode_names2/src/lib.rs:138
↓ 3 callers
Method
next
(&mut self)
crates/ruff_linter/src/docstrings/sections.rs:273
↓ 3 callers
Function
next_auto_value
Compute the next auto-assigned value based on the previous member's value. Used for dict-form and tuple/list-form functional enums where `auto()` val
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:192
↓ 3 callers
Method
next_back
(&mut self)
crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/mod.rs:256
← previous
next →
4,301–4,400 of 31,562, ranked by callers