MCPcopy Create free account

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

Functions27,807 in github.com/astral-sh/ruff

↓ 12 callersFunctionmatch_expression
Given the source code for an expression, return the parsed [`Expression`]. If the expression is not guaranteed to be valid as a standalone expression
crates/ruff_linter/src/cst/matchers.rs:223
↓ 12 callersMethodmatch_parameters
Match parameters for this constructor method and downstream constructors.
crates/ty_python_semantic/src/types/call/bind/constructor.rs:68
↓ 12 callersMethodminimum
Returns the minimum length of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:68
↓ 12 callersMethodname
The absolute name of the module (e.g. `foo.bar`)
crates/ty_module_resolver/src/module.rs:44
↓ 12 callersMethodopen_text_document
Send a `textDocument/didOpen` notification
crates/ruff_server/tests/e2e/main.rs:685
↓ 12 callersMethodor_fall_back_to
Fallback (wholly or partially) to `fallback` to create a new [`LookupResult`].
crates/ty_python_semantic/src/place.rs:414
↓ 12 callersMethodoverloads_and_implementation
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/function.rs:779
↓ 12 callersMethodparent
(&'a self)
crates/ty_module_resolver/src/path.rs:845
↓ 12 callersMethodpop
(&mut self)
crates/ruff_python_parser/src/lexer/interpolated_string.rs:135
↓ 12 callersMethodprefix
(self)
crates/ruff_python_ast/src/nodes.rs:994
↓ 12 callersMethodprimary_annotation
Returns a shared borrow of the "primary" annotation of this diagnostic if one exists. When there are multiple primary annotations, then the first one
crates/ruff_db/src/diagnostic/mod.rs:263
↓ 12 callersMethodpush
(&mut self, line_number: OneIndexed, messages: Vec<Failure>)
crates/mdtest/src/matcher.rs:41
↓ 12 callersMethodrange
(&self)
crates/ruff_python_formatter/src/lib.rs:109
↓ 12 callersMethodreport_context
If error context collection is enabled, returns the current error context tree. You will typically use [`push`][ErrorContextTree::push] to add additio
crates/ty_python_semantic/src/types/relation.rs:941
↓ 12 callersFunctionresolve
Resolve the relevant settings strategy and defaults for the current invocation.
crates/ruff/src/resolve.rs:20
↓ 12 callersMethodresolved_client_capabilities
Returns the resolved client capabilities that were captured during initialization.
crates/ty_server/src/session.rs:1375
↓ 12 callersMethodresolved_client_capabilities
(&self)
crates/ruff_server/src/session.rs:188
↓ 12 callersMethodrules
Returns rules matching the selector, taking into account rule groups like preview and deprecated.
crates/ruff_linter/src/rule_selector.rs:280
↓ 12 callersMethodrun
(self)
crates/ty_site_packages/src/lib.rs:2406
↓ 12 callersMethodscope_id
The scope in which the reference is defined.
crates/ruff_python_semantic/src/reference.rs:36
↓ 12 callersMethodsend
(&mut self, message: Message)
crates/ruff_server/tests/e2e/main.rs:313
↓ 12 callersMethodset_parent
Set the offset of the diagnostic's parent statement.
crates/ruff_db/src/diagnostic/mod.rs:398
↓ 12 callersMethodseverity
Returns the severity of this diagnostic. Note that this may be different than the severity of sub-diagnostics.
crates/ruff_db/src/diagnostic/mod.rs:254
↓ 12 callersMethodsite_packages
Add a file to site-packages (simulating a third-party dependency). The path should be relative to site-packages root (e.g., "numpy/__init__.py").
crates/ty_ide/src/lib.rs:750
↓ 12 callersMethodstart
(&self)
crates/ruff_source_file/src/newlines.rs:211
↓ 12 callersMethodtake
Takes a snapshot of the current state of the matched overload bindings. # Panics Panics if the indexes of the matched overloads are not valid for th
crates/ty_python_semantic/src/types/call/bind.rs:7186
↓ 12 callersFunctiontest_helper
(source: &str, members_to_remove: &[&str])
crates/ruff_linter/src/rules/pyupgrade/fixes.rs:75
↓ 12 callersMethodto_file_path
Returns the corresponding [`AnySystemPath`] for this document key. Note, calling this method on a `DocumentKey::Opaque` representing a cell document
crates/ty_server/src/document.rs:94
↓ 12 callersMethodtokens
(&self)
crates/ruff_python_formatter/src/context.rs:85
↓ 12 callersMethodtry_bool
Resolves the boolean value of a type. This is used to determine the value that would be returned when `bool(x)` is called on an object `x`. Returns
crates/ty_python_semantic/src/types/bool.rs:32
↓ 12 callersMethodunion
(self, other: TokenSet)
crates/ruff_python_parser/src/token_set.rs:20
↓ 12 callersMethodwhen_constraint_set_assignable_to_owned
Returns an _owned_ (i.e. salsa-cached) constraint set that describes when `self` is constraint-set assignable to `target`. Recursive relations are ev
crates/ty_python_semantic/src/types/relation.rs:462
↓ 12 callersMethodwith_default_type
(mut self, default: Type<'db>)
crates/ty_python_semantic/src/types/signatures.rs:4682
↓ 12 callersMethodwith_extension
(&self, extension: &str)
crates/ruff_db/src/system/path.rs:365
↓ 12 callersMethodwith_site_packages
Convert to a builder that supports site-packages (third-party dependencies).
crates/ty_ide/src/lib.rs:616
↓ 12 callersMethodwrite
(&self, f: &mut std::fmt::Formatter, start_range: bool)
crates/ruff/src/args.rs:1326
↓ 12 callersMethodwrite_element
(&mut self, element: FormatElement)
crates/ruff_formatter/src/buffer.rs:139
↓ 11 callersMethodadd_and_constraint
( &mut self, a: ScopedNarrowingConstraint, b: ScopedNarrowingConstraint, )
crates/ty_python_core/src/narrowing_constraints.rs:332
↓ 11 callersMethodadd_token
( &mut self, ranged: impl Ranged, token_type: SemanticTokenType, modifiers: Se
crates/ty_ide/src/semantic_tokens.rs:224
↓ 11 callersMethodapply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:445
↓ 11 callersMethodas_bytes
(self)
crates/ty_python_semantic/src/types/literal.rs:186
↓ 11 callersMethodas_char
(self)
crates/ruff_python_ast/src/str.rs:20
↓ 11 callersMethodas_char
Get the character used to represent this quote.
crates/ruff_linter/src/rules/flake8_quotes/settings.rs:75
↓ 11 callersMethodas_notebook
(&self)
crates/ty_server/src/session/index.rs:262
↓ 11 callersMethodas_ref
(&self)
crates/ruff_db/src/files/path.rs:106
↓ 11 callersMethodas_typed_dict
(self)
crates/ty_python_semantic/src/types.rs:1727
↓ 11 callersFunctionassert_no_match
(set: &ModuleGlobSet, name: &str)
crates/ty_module_resolver/src/module_glob.rs:380
↓ 11 callersMethodattach_to
Render the error context tree as info sub-diagnostics on `diag`.
crates/ty_python_semantic/src/types/relation_error.rs:541
↓ 11 callersMethodbind_self_typevars
Bind `Self` type variables in this type to a concrete self type. Uses MRO-based matching: a `Self` typevar is only bound if its owner class is in the
crates/ty_python_semantic/src/types.rs:1238
↓ 11 callersMethodbindings
(&self)
crates/ty_python_core/src/use_def/place_state.rs:588
↓ 11 callersMethodbuild
(self)
crates/ruff_db/src/testing.rs:196
↓ 11 callersMethodcache_key
(&self, state: &mut CacheKeyHasher)
crates/ruff_cache/src/globset.rs:6
↓ 11 callersMethodcapabilities
Derives the instance/class read/write capabilities exposed by this member. These are views of the canonical method, property, or attribute representa
crates/ty_python_semantic/src/types/protocol_class.rs:1130
↓ 11 callersMethodcell
Returns the (raw) cell number (1-based) for the given row (1-based).
crates/ruff_notebook/src/index.rs:29
↓ 11 callersMethodchange_text_document
Send a `textDocument/didChange` notification with the given content changes
crates/ty_server/tests/e2e/main.rs:812
↓ 11 callersMethodclass_origin
Return the class that defines this protocol, if it is class-backed.
crates/ty_python_semantic/src/types/instance.rs:995
↓ 11 callersMethodcloser_len
The total length of the string's closer. This is always equal to `self.quote_len()`, except when the string is unclosed, in which case the length is z
crates/ruff_python_ast/src/nodes.rs:847
↓ 11 callersMethodcontext
Return the [`LintContext`] for the current analysis. Note that you should always prefer calling methods like `settings`, `report_diagnostic`, or `is_
crates/ruff_linter/src/checkers/ast/mod.rs:665
↓ 11 callersMethodcover
(self, other: TextRange)
crates/ruff_text_size/src/range.rs:249
↓ 11 callersMethodcreate_directory_all
Creates a directory at `path`. All enclosing directories are created if they don't exist.
crates/ruff_db/src/system/memory_fs.rs:324
↓ 11 callersFunctionenum_metadata
( db: &'db dyn Db, class: ClassLiteral<'db>, )
crates/ty_python_semantic/src/types/enums.rs:924
↓ 11 callersMethodfile
Returns the `UnifiedFile` attached to this `Span`.
crates/ruff_db/src/diagnostic/mod.rs:1244
↓ 11 callersMethodfile
(self, db: &'db dyn Db)
crates/ty_python_core/src/expression.rs:73
↓ 11 callersMethodfile_path
(&self, path: impl AsRef<SystemPath>)
crates/ty_server/tests/e2e/main.rs:774
↓ 11 callersFunctionfile_system
()
crates/ty_vendored/src/lib.rs:18
↓ 11 callersMethodfiles
(&self)
crates/ruff_db/src/lib.rs:182
↓ 11 callersMethodfilter_union
If the type is a union (or a type alias that resolves to a union), filters union elements based on the provided predicate. Otherwise, returns the typ
crates/ty_python_semantic/src/types.rs:2105
↓ 11 callersMethodfirst
(&self)
crates/ruff_linter/src/suppression.rs:187
↓ 11 callersMethodhide_severity
Whether to hide a diagnostic's severity or not.
crates/ruff_db/src/diagnostic/mod.rs:1523
↓ 11 callersMethodincludes
Returns `true` if the string list of `codes` includes `code` (or an alias thereof).
crates/ruff_linter/src/noqa.rs:134
↓ 11 callersMethodinfer_definition
(&mut self, node: impl Into<DefinitionNodeKey> + std::fmt::Debug + Copy)
crates/ty_python_semantic/src/types/infer/builder.rs:2012
↓ 11 callersMethodinto_inner
(self)
crates/ty_python_semantic/src/types/callable.rs:709
↓ 11 callersMethodinto_suite
Consumes the [`Parsed`] output and returns the module body as a [`Suite`].
crates/ruff_python_parser/src/lib.rs:533
↓ 11 callersMethodis_always_true
(self)
crates/ty_python_core/src/lib.rs:957
↓ 11 callersMethodis_assignment
(&self, expr: &Expr)
crates/ruff_linter/src/rules/pylint/helpers.rs:91
↓ 11 callersFunctionis_const_true
Return `true` if an [`Expr`] is a literal `True`.
crates/ruff_python_ast/src/helpers.rs:831
↓ 11 callersMethodis_empty
(&self)
crates/mdtest/src/matcher.rs:50
↓ 11 callersMethodis_implicitly_open
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:117
↓ 11 callersMethodis_keyword
(self)
crates/ruff_python_ast/src/token.rs:344
↓ 11 callersMethodis_positional
Returns `true` if this is either a positional-only or standard (positional or keyword) parameter.
crates/ty_python_semantic/src/types/signatures.rs:4889
↓ 11 callersMethodis_protocol
Return `true` if this class is a protocol class. In an ideal world, perhaps we wouldn't hardcode this knowledge here; instead, we'd just look at the
crates/ty_python_semantic/src/types/class/known.rs:652
↓ 11 callersMethodis_required
(&self)
crates/ty_python_semantic/src/types/class.rs:2499
↓ 11 callersMethoditem
Returns the field exposed by a literal key. Undeclared keys synthesize a field only for explicit extra items. Hidden items on an implicitly open `Typ
crates/ty_python_semantic/src/types/typed_dict.rs:361
↓ 11 callersMethoditer_flat
Returns an iterator over all `CallableBinding`s, flattening the two-level structure. Note: This loses the union/intersection distinction. The returne
crates/ty_python_semantic/src/types/call/bind.rs:839
↓ 11 callersMethoditer_mut
(&mut self)
crates/ruff_index/src/slice.rs:89
↓ 11 callersMethodjoin_comma_separated
( &'fmt mut self, sequence_end: TextSize, )
crates/ruff_python_formatter/src/builders.rs:73
↓ 11 callersMethodjoin_with
Joins the objects by placing the specified separator between every two items. ## Examples Joining different tokens by separating them with a comma a
crates/ruff_formatter/src/formatter.rs:101
↓ 11 callersFunctionknown_module_symbol
Lookup the type of `symbol` in a given known module. Returns `Place::Undefined` if the given known module cannot be resolved for some reason.
crates/ty_python_semantic/src/place.rs:618
↓ 11 callersMethodleading_dangling_trailing
Returns an iterator over the [leading](self#leading-comments), [dangling](self#dangling-comments), and [trailing](self#trailing) comments of `node`.
crates/ruff_python_formatter/src/comments/mod.rs:349
↓ 11 callersFunctionleading_indentation
Extract the leading indentation from a line.
crates/ruff_python_trivia/src/whitespace.rs:93
↓ 11 callersMethodlen
(&self)
crates/ty_server/src/server/schedule/thread/pool.rs:133
↓ 11 callersMethodlen
(&self)
crates/ruff_server/src/server/schedule/thread/pool.rs:130
↓ 11 callersMethodmark_formatted
Marks the comment as formatted
crates/ruff_python_formatter/src/comments/mod.rs:146
↓ 11 callersMethodmaterialize
Applies both constraint kinds between the place's last materialized nodes and `target`. The place's node must be an ancestor of `target`. After mater
crates/ty_python_core/src/use_def.rs:1432
↓ 11 callersMethodnext
(&mut self)
crates/ruff_python_semantic/src/analyze/class.rs:99
↓ 11 callersMethodoffset
(self)
crates/ty_python_core/src/member.rs:747
↓ 11 callersMethodparameter_documentation
Extract parameter documentation from popular docstring formats. Returns a map of parameter names to their documentation.
crates/ty_ide/src/docstring.rs:60
↓ 11 callersMethodparent_statement_id
Given a [`NodeId`], return the [`NodeId`] of the parent statement, if any.
crates/ruff_python_semantic/src/model.rs:1647
↓ 11 callersFunctionparenthesized
Formats `content` enclosed by the `left` and `right` parentheses. The implementation also ensures that expanding the parenthesized expression (or any
crates/ruff_python_formatter/src/expression/parentheses.rs:109
↓ 11 callersMethodpermissions
(&self)
crates/ruff_db/src/system.rs:288
← previousnext →1,101–1,200 of 27,807, ranked by callers