Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,349 in github.com/astral-sh/ruff
⨍
Functions
27,349
◇
Types & classes
6,530
↳
Endpoints
82
↓ 8 callers
Method
is_local
Is the symbol defined in this scope, vs referring to some enclosing scope? There are three common cases where a name refers to an enclosing scope: 1
crates/ty_python_core/src/symbol.rs:117
↓ 8 callers
Function
is_logger_candidate
Return `true` if the given `Expr` is a potential logging call. Matches `logging.error`, `logger.error`, `self.logger.error`, etc., but not arbitrary `
crates/ruff_python_semantic/src/analyze/logging.rs:19
↓ 8 callers
Method
is_method
(&self)
crates/ty_python_semantic/src/types/protocol_class.rs:966
↓ 8 callers
Method
is_parenthesized
(self)
crates/ruff_python_formatter/src/pattern/pattern_match_sequence.rs:151
↓ 8 callers
Function
is_pathlib_path_call
(checker: &Checker, expr: &Expr)
crates/ruff_linter/src/rules/flake8_use_pathlib/helpers.rs:15
↓ 8 callers
Method
is_preview
Returns `true` if preview mode is enabled.
crates/ruff_python_formatter/src/context.rs:126
↓ 8 callers
Method
is_read_only
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:177
↓ 8 callers
Method
is_subclass_of
Return `true` if `other` is present in this class's MRO.
crates/ty_python_semantic/src/types/class.rs:1361
↓ 8 callers
Method
is_subscript_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2577
↓ 8 callers
Method
is_tuple_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2725
↓ 8 callers
Method
is_unclosed
(self)
crates/ruff_python_ast/src/nodes.rs:1147
↓ 8 callers
Method
items
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/typed_dict.rs:912
↓ 8 callers
Method
iterate
Returns a tuple spec describing the elements that are produced when iterating over `self`. This method should only be used outside of type checking b
crates/ty_python_semantic/src/types/iteration.rs:73
↓ 8 callers
Method
join_root_path
(&self, relative: impl AsRef<SystemPath>)
crates/ty/tests/file_watching.rs:303
↓ 8 callers
Method
joinpath
(self)
crates/ruff_python_formatter/resources/test/fixtures/ruff/newlines.py:222
↓ 8 callers
Method
line_end
(&self, offset: TextSize)
crates/ruff_linter/src/locator.rs:196
↓ 8 callers
Method
load
Load the current value of the `AtomicNodeIndex`.
crates/ruff_python_ast/src/node_index.rs:169
↓ 8 callers
Method
location
(&self)
crates/ruff_python_parser/src/error.rs:374
↓ 8 callers
Method
lookup_attribute
Lookup a qualified attribute in the current scope. For example, given `["Class", "method"`], resolve the `BindingKind::ClassDefinition` associated wi
crates/ruff_python_semantic/src/model.rs:1059
↓ 8 callers
Function
match_statement
(statement_text: &str)
crates/ruff_linter/src/cst/matchers.rs:18
↓ 8 callers
Function
mock_typeshed
()
crates/ruff_db/src/vendored.rs:518
↓ 8 callers
Method
mro
Iterate over the MRO of this base
crates/ty_python_semantic/src/types/class_base.rs:439
↓ 8 callers
Method
name
(&self)
crates/ruff_python_ast/src/nodes.rs:2819
↓ 8 callers
Method
next
(&mut self)
crates/ruff_linter/src/registry/rule_set.rs:359
↓ 8 callers
Method
next_back
(&mut self)
crates/ruff_python_ast/src/nodes.rs:258
↓ 8 callers
Function
notebook_path
Construct a path to a Jupyter notebook in the `resources/test/fixtures/jupyter` directory.
crates/ruff_linter/src/linter.rs:820
↓ 8 callers
Method
offset
(self)
crates/ty_python_core/src/member.rs:682
↓ 8 callers
Method
open_file
(&mut self, path: &str, contents: &str)
crates/ty_wasm/src/lib.rs:189
↓ 8 callers
Method
own_class_member
Returns the inferred type of the class member named `name`. Only bound members or those marked as `ClassVars` are considered. You must provide the `i
crates/ty_python_semantic/src/types/class.rs:1641
↓ 8 callers
Function
parenthesize_if_expands
Adds parentheses and indents `content` if it doesn't fit on a line.
crates/ruff_python_formatter/src/builders.rs:9
↓ 8 callers
Method
parse
Consumes the [`Parser`] and returns the parsed [`Parsed`].
crates/ruff_python_parser/src/parser/mod.rs:135
↓ 8 callers
Method
parse_conditional_expression_or_higher_impl
( &mut self, context: ExpressionContext, )
crates/ruff_python_parser/src/parser/expression.rs:209
↓ 8 callers
Method
prepare
(&self)
crates/ty_ide/src/type_hierarchy.rs:711
↓ 8 callers
Method
preview
Whether to enable preview behavior or not.
crates/ruff_db/src/diagnostic/mod.rs:1516
↓ 8 callers
Function
project_files_in_path
Find all project files in a set of paths, following configured include/exclude settings.
crates/ruff_workspace/src/resolver.rs:434
↓ 8 callers
Method
promote
Promote (possibly nested) literals to types that these literals are instances of. Note that this function tries to promote literals to a more user-fr
crates/ty_python_semantic/src/types.rs:2073
↓ 8 callers
Method
push_dangling
Pushes a *dangling* part for `key`
crates/ruff_python_formatter/src/comments/map.rs:109
↓ 8 callers
Method
range
(&self)
crates/ruff_python_formatter/src/comments/mod.rs:184
↓ 8 callers
Method
range
(&self)
crates/ruff_python_ast/src/nodes.rs:165
↓ 8 callers
Method
reachability_cache
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:406
↓ 8 callers
Function
remove_unused_imports
Generate a `Fix` to remove the specified imports from an `import` statement.
crates/ruff_linter/src/fix/edits.rs:112
↓ 8 callers
Method
report_recursion_limit_exceeded
(&mut self, ranged: R)
crates/ruff_python_parser/src/parser/mod.rs:124
↓ 8 callers
Function
resolve_assignment
Return the [`QualifiedName`] of the value to which the given [`Expr`] is assigned, if any. For example, given: ```python import asyncio loop = async
crates/ruff_python_semantic/src/analyze/typing.rs:1168
↓ 8 callers
Function
run_single_threaded
(bencher: Bencher, benchmark: &Benchmark)
crates/ruff_benchmark/benches/ty_walltime.rs:234
↓ 8 callers
Method
set_options
(&mut self, options: Options)
crates/ty/tests/file_watching.rs:343
↓ 8 callers
Method
source
(&self)
crates/ty_project/src/metadata/value.rs:57
↓ 8 callers
Method
spans
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:697
↓ 8 callers
Method
specialize
Creates a specialization of this generic context. Panics if the length of `types` does not match the number of typevars in the generic context. You m
crates/ty_python_semantic/src/types/generics.rs:929
↓ 8 callers
Method
start_token
(&mut self)
crates/ruff_python_trivia/src/cursor.rs:72
↓ 8 callers
Method
supertypes
(&self)
crates/ty_ide/src/type_hierarchy.rs:715
↓ 8 callers
Method
symbol_mut
(&mut self, id: ScopedSymbolId)
crates/ty_python_core/src/place.rs:309
↓ 8 callers
Method
take_salsa_events
Takes the salsa events.
crates/ty_python_semantic/src/db.rs:82
↓ 8 callers
Method
to_format_options
( &self, source_type: PySourceType, source: &str, path: Option<&Path>, )
crates/ruff_workspace/src/settings.rs:204
↓ 8 callers
Method
to_meta_type
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types.rs:6160
↓ 8 callers
Method
token
Creates a new token that uses this source.
crates/ruff_db/src/cancellation.rs:29
↓ 8 callers
Method
tokens
(&self)
crates/ruff_python_trivia_integration_tests/tests/simple_tokenizer.rs:30
↓ 8 callers
Method
try_call_dunder_with_policy
Same as `try_call_dunder`, but allows specifying a policy for the member lookup. In particular, this allows to specify `MemberLookupPolicy::MRO_NO_OBJ
crates/ty_python_semantic/src/types.rs:5474
↓ 8 callers
Method
visit_body
(&mut self, body: &'a [Stmt])
crates/ruff_linter/src/checkers/ast/mod.rs:2389
↓ 8 callers
Method
visit_body
(&mut self, body: &[Stmt])
crates/ruff_linter/src/rules/flake8_bugbear/rules/loop_iterator_mutation.rs:134
↓ 8 callers
Function
walk_pattern
(visitor: &mut V, pattern: &'a Pattern)
crates/ruff_python_ast/src/visitor.rs:763
↓ 8 callers
Method
when_constraint_set_assignable_to_owned
Returns an _owned_ (i.e. salsa-cached) constraint set that describes when `self` is constraint-set assignable to `target`.
crates/ty_python_semantic/src/types/relation.rs:456
↓ 8 callers
Method
with_auto_import
(mut self, enabled: bool)
crates/ty_server/src/session/options.rs:123
↓ 8 callers
Method
with_failure_code
(self, code: server::ErrorCode)
crates/ty_server/src/server/api.rs:559
↓ 8 callers
Method
with_optional_range
Returns a new `Span` with the given optional `range` attached to it.
crates/ruff_db/src/diagnostic/mod.rs:1263
↓ 8 callers
Method
with_range
Returns a new `Span` with the given `range` attached to it.
crates/ruff_db/src/diagnostic/mod.rs:1258
↓ 8 callers
Method
with_recursion
(&mut self, f: impl FnOnce(&mut Self) -> T)
crates/ruff_python_parser/src/parser/mod.rs:111
↓ 8 callers
Method
without_paramspec_attr
Returns a new bound typevar instance without any `ParamSpec` attribute set. This method will also remove any upper bound that was set by `with_params
crates/ty_python_semantic/src/types/typevar.rs:969
↓ 8 callers
Method
write
(&self, formatter: &mut impl std::fmt::Write)
crates/ruff_python_literal/src/escape.rs:80
↓ 7 callers
Method
all_rules
Return all matching rules, regardless of rule group filters like preview and deprecated.
crates/ruff_linter/src/rule_selector.rs:255
↓ 7 callers
Function
apply_fixes
Apply a series of fixes.
crates/ruff_linter/src/fix/mod.rs:54
↓ 7 callers
Method
apply_options
Combine the project options with the CLI options where the CLI options take precedence.
crates/ty_project/src/metadata.rs:316
↓ 7 callers
Method
as_any_string_flags
(self)
crates/ruff_python_ast/src/nodes.rs:855
↓ 7 callers
Method
as_assign_stmt
(&self)
crates/ruff_python_ast/src/generated.rs:584
↓ 7 callers
Method
as_enum_literal
(self)
crates/ty_python_semantic/src/types.rs:1749
↓ 7 callers
Method
as_fixed_length
Returns the inner fixed-length tuple if this is a `Tuple::Fixed` variant.
crates/ty_python_semantic/src/types/tuple.rs:1955
↓ 7 callers
Method
as_int
(self)
crates/ty_python_semantic/src/types/literal.rs:218
↓ 7 callers
Method
as_int_literal
(self)
crates/ty_python_semantic/src/types.rs:1734
↓ 7 callers
Method
as_paramspec_with_prefix
Returns the prefix parameters and bound `ParamSpec` if this parameter list is either `P` or `Concatenate[<prefix-params>, P]`. For the narrower bare-
crates/ty_python_semantic/src/types/signatures.rs:3500
↓ 7 callers
Method
as_single_part_string
Return `Some(literal)` if the string only consists of a single `StringLiteral` part (indicating that it is not implicitly concatenated). Otherwise, re
crates/ruff_python_ast/src/nodes.rs:1323
↓ 7 callers
Method
as_slice
(&self)
crates/ruff_formatter/src/format_element.rs:371
↓ 7 callers
Method
as_str
(&self)
crates/ruff_python_ast/src/name.rs:43
↓ 7 callers
Method
as_str
(&self)
crates/mdtest/src/parser.rs:349
↓ 7 callers
Method
as_utf8_path
(&self)
crates/ruff_db/src/system/path.rs:388
↓ 7 callers
Function
assert_eq_slice
( db: &dyn Db, input: &[char; N], start: Option<i32>, stop: Option<i32>,
crates/ty_python_semantic/src/subscript.rs:287
↓ 7 callers
Method
at_offset
Searches the token(s) at `offset`. Returns [`TokenAt::Between`] if `offset` points directly inbetween two tokens (the left token ends at `offset` and
crates/ruff_python_ast/src/token/tokens.rs:92
↓ 7 callers
Method
at_top_level
Return `true` if the model is at the top level of the module (i.e., in the module scope, and not nested within any statements).
crates/ruff_python_semantic/src/model.rs:1808
↓ 7 callers
Function
attribute_scopes
Returns all attribute assignments as scope IDs for a specific class body scope. Only call this when doing type inference on the same file as `class_b
crates/ty_python_core/src/lib.rs:171
↓ 7 callers
Function
before_main
()
crates/ty_wasm/src/lib.rs:44
↓ 7 callers
Method
binary_search
(&self, value: &T)
crates/ruff_index/src/slice.rs:121
↓ 7 callers
Method
bool
Determine whether instances of this class are always truthy, always falsy, or have an ambiguous truthiness. Returns `None` for `KnownClass::Tuple`, s
crates/ty_python_semantic/src/types/class/known.rs:177
↓ 7 callers
Method
bump_any
Bumps the current token regardless of its kind and advances to the next token. # Panics If the parser is at end of file.
crates/ruff_python_parser/src/parser/mod.rs:551
↓ 7 callers
Function
callable
(x)
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B004.py:21
↓ 7 callers
Method
callable_type
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:288
↓ 7 callers
Method
cell_row
Returns the row number (1-based) in the cell (1-based) for the given row (1-based).
crates/ruff_notebook/src/index.rs:35
↓ 7 callers
Method
check_types
Check types for this constructor method, and then decide (based on the resolved return types) whether we should continue considering downstream constr
crates/ty_python_semantic/src/types/call/bind/constructor.rs:81
↓ 7 callers
Method
clear_salsa_events
Clears the salsa events. ## Panics If there are any pending salsa snapshots.
crates/ty_python_semantic/src/db.rs:92
↓ 7 callers
Method
client_capabilities
(&self)
crates/ty_server/src/session.rs:1314
↓ 7 callers
Method
code
(&self)
crates/ruff_benchmark/src/lib.rs:75
↓ 7 callers
Method
columns
Returns the indentation's visual width in columns/spaces. For docstring indentation, black counts spaces as 1 and tabs by increasing the indentation
crates/ruff_python_formatter/src/string/docstring.rs:1716
↓ 7 callers
Function
compute_replacement
(source: &str, modified: &str)
crates/ruff_server/src/edit/replacement.rs:70
← previous
next →
1,501–1,600 of 27,349, ranked by callers