MCPcopy Create free account

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

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

↓ 4 callersMethodcommand
Creates a pre-configured ruff command for testing. The command is set up with: - The correct ruff binary path - Working directory set to the test dir
crates/ruff/tests/cli/main.rs:216
↓ 4 callersMethodcommand_executor
(&self)
crates/ty_server/src/system.rs:296
↓ 4 callersMethodcomparators
Returns all operands after the initial operand (`[b, c]` in `a < b <= c`). # Panics Panics if there are no operands. See [`Self::first_operand`].
crates/ruff_python_ast/src/nodes.rs:143
↓ 4 callersMethodcompare
(self, a: &str, b: &str)
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:40
↓ 4 callersMethodcomparison_semantics
( &self, ty: Type<'db>, operator: ComparisonOperator, )
crates/ty_python_semantic/src/types/equality.rs:544
↓ 4 callersMethodcompute_indentation
Return the slice of source code that represents the indentation of the docstring's opening quotes.
crates/ruff_linter/src/docstrings/mod.rs:45
↓ 4 callersMethodcompute_source_row
Returns the [`SourceRow`] for the given offset.
crates/ruff_linter/src/checkers/ast/mod.rs:433
↓ 4 callersMethodconcat_variadic_typevar
Concatenates an unpacked `TypeVarTuple` as the variable-length portion of this tuple.
crates/ty_python_semantic/src/types/tuple.rs:3095
↓ 4 callersMethodconstructed_class_literal
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/call/bind/constructor.rs:732
↓ 4 callersMethodconsume_preformatted_line
Updates internal state to reflect the given line and returns whether or not the given line is contained within a preformatted block.
crates/ty_ide/src/docstring/document/preformatted.rs:81
↓ 4 callersMethodcontains
(&self, version: PythonVersion)
crates/ty_module_resolver/src/typeshed.rs:233
↓ 4 callersFunctioncontains_escaped_quote
Return `true` if the haystack contains an escaped quote.
crates/ruff_linter/src/rules/flake8_quotes/helpers.rs:11
↓ 4 callersMethodcontains_range
Returns `true` if the given range is inside a multiline string.
crates/ruff_python_index/src/multiline_ranges.rs:12
↓ 4 callersMethodcontext_mut
Returns a mutable reference to the context
crates/ruff_formatter/src/lib.rs:964
↓ 4 callersFunctionconvert_to_lsp_item
( db: &ProjectDatabase, item: ty_ide::CallHierarchyItem, encoding: PositionEncoding, )
crates/ty_server/src/server/api/requests/prepare_call_hierarchy.rs:79
↓ 4 callersFunctioncreate_constraint_set_with_bounds
( db: &'db TestDb, env: &ProgramEnvironment<'db>, builder: &'c ConstraintSetBuilder<'d
crates/ty_python_semantic/src/types/constraints.rs:5225
↓ 4 callersFunctioncreate_module_names
(raw_names: &[&str])
crates/ty_module_resolver/src/resolve.rs:2176
↓ 4 callersMethodcurrent_expression
Return the current [`Expr`].
crates/ruff_python_semantic/src/model.rs:1496
↓ 4 callersMethodcurrent_expression_grandparent
Return the grandparent [`Expr`] of the current [`Expr`], if any.
crates/ruff_python_semantic/src/model.rs:1506
↓ 4 callersMethodcurrent_function_definition
If the current scope is a (non-lambda) function, return that function's AST node. If the current scope is not a function (or it is a lambda function)
crates/ty_python_semantic/src/types/infer/builder.rs:2175
↓ 4 callersMethodcurrent_reachability_constraints_mut
(&mut self)
crates/ty_python_core/src/builder.rs:1088
↓ 4 callersMethodcurrent_scope_mut
Returns a mutable reference to the current top-most [`Scope`].
crates/ruff_python_semantic/src/model.rs:1545
↓ 4 callersMethodcut_indicator
Set the string used for when a long line is cut. The default for [`DecorStyle::Ascii`] is `...` (three `U+002E` characters).
crates/ruff_annotate_snippets/src/renderer/mod.rs:284
↓ 4 callersMethodcycle_normalized
Normalize for cycle recovery by combining with the previous value and removing divergent types introduced by the cycle. See [`Type::cycle_normalized`
crates/ty_python_semantic/src/types/typevar.rs:2293
↓ 4 callersMethoddangling_index
(&self)
crates/ruff_python_formatter/src/comments/map.rs:523
↓ 4 callersMethoddangling_range
(&self)
crates/ruff_python_formatter/src/comments/map.rs:480
↓ 4 callersMethoddeclaration
(&self)
crates/ty_python_core/src/use_def/place_state.rs:143
↓ 4 callersMethoddeclarations
( &self, owner: Definition<'db>, )
crates/ty_python_semantic/src/types/infer.rs:1420
↓ 4 callersMethoddeclarations_iterator
( &'map self, declarations: &'map [LiveDeclaration], boundness_analysis: BoundnessAnal
crates/ty_python_core/src/use_def.rs:1479
↓ 4 callersFunctiondeduplicate_nested_paths
Deduplicates identical paths and removes nested paths. # Examples ```rust use ruff_db::system::{SystemPath, deduplicate_nested_paths};/// let paths
crates/ruff_db/src/system/path.rs:953
↓ 4 callersMethoddefault
()
crates/ruff_linter/src/rules/flake8_bandit/settings.rs:22
↓ 4 callersFunctiondefinite_match_pattern_type
Return the values that are guaranteed to match `kind`. Reachability and negative narrowing can only subtract this under-approximation.
crates/ty_python_semantic/src/types/match_pattern.rs:1350
↓ 4 callersMethoddefinitely_has_builtin_binding
Returns whether `name` refers to a standard builtin in the scope containing `node`. This method uses a simplified implementation of name resolution:
crates/ty_python_semantic/src/semantic_model.rs:107
↓ 4 callersMethoddefinition
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/static_literal.rs:626
↓ 4 callersMethoddepth
Returns the depth at which this entry was created relative to the root.
crates/ruff_db/src/system/walk_directory.rs:188
↓ 4 callersFunctiondetect_package_root
Return the package root for the given path to a directory with Python file.
crates/ruff_linter/src/packaging.rs:36
↓ 4 callersMethoddiagnostics_by_source
(self, source: Source)
scripts/conformance.py:328
↓ 4 callersFunctiondict_literal_key_value_types
Recover the key and value types of an immediately consumed dictionary literal, without promoting its elements. The dictionary and its elements must al
crates/ty_python_semantic/src/types/dict.rs:12
↓ 4 callersMethoddigits
Calculate the number of digits in `self`. This is primarily intended for computing the length of the string representation for formatted printing. #
crates/ruff_source_file/src/line_index.rs:659
↓ 4 callersMethoddisplay
Renders the hover to a string using the specified markup kind.
crates/ty_ide/src/hover.rs:336
↓ 4 callersMethoddocumentation_url
(&self)
crates/ty_python_semantic/src/lint.rs:126
↓ 4 callersMethoddunder_class
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types.rs:9612
↓ 4 callersFunctionduplicate_entry_in_dunder_all
RUF068 This routine checks whether `__all__` contains duplicated entries, and emits a violation if it does.
crates/ruff_linter/src/rules/ruff/rules/duplicate_entry_in_dunder_all.rs:122
↓ 4 callersMethoddyn_clone
(&self)
crates/ty_server/src/system.rs:303
↓ 4 callersFunctiondynamic
A dummy type that is used to generate a schema for `DocstringCodeLineWidth::Dynamic`.
crates/ruff_python_formatter/src/options.rs:456
↓ 4 callersFunctiondynamic_class_bases_argument
Returns the `bases` argument for a dynamic class constructor call. Dynamic class constructors accept `bases` either as the second positional argument
crates/ty_python_semantic/src/types/class/dynamic_literal.rs:156
↓ 4 callersFunctiondynamic_class_header_range
Returns the source range of a call that creates a dynamic class. ```python Color = Enum("Color", "RED GREEN") # ^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
crates/ty_python_semantic/src/types/class.rs:107
↓ 4 callersMethodeat_char2
(&mut self, c1: char, c2: char)
crates/ruff_python_parser/src/lexer/cursor.rs:113
↓ 4 callersMethodeat_if
(&mut self, mut predicate: F)
crates/ruff_python_parser/src/lexer/cursor.rs:136
↓ 4 callersMethodeat_span
Consumes the closing run that matches the most recently returned `opening`. Returns `None` without advancing when no matching run exists.
crates/ty_ide/src/docstring/document/syntax.rs:364
↓ 4 callersMethodeat_whitespace
(&mut self)
crates/ruff_linter/src/noqa.rs:684
↓ 4 callersMethodeditor_settings
(&self)
crates/ruff_server/src/session/settings.rs:167
↓ 4 callersMethodeffective_extra_items
Returns the effective extra-items policy. An implicitly open `TypedDict` behaves like it has read-only extra items of type `object` for these purpose
crates/ty_python_semantic/src/types/typed_dict.rs:110
↓ 4 callersMethodeffective_lower
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, source: EvidenceSourc
crates/ty_python_semantic/src/types/constraints.rs:3532
↓ 4 callersFunctionelements
(n)
crates/ruff_linter/resources/test/fixtures/syntax_errors/async_comprehension.py:1
↓ 4 callersMethodenable
Enables `lint` and configures with the given `severity`. Overrides any previous configuration for the lint.
crates/ty_python_semantic/src/lint.rs:670
↓ 4 callersMethodenable_completion_snippets
Enable or disable the completion snippet capability.
crates/ty_server/tests/e2e/main.rs:1495
↓ 4 callersMethodenclosing_node_key
Return the node key of the given AST node, or the key of the outermost enclosing string literal, if the node originates from inside a stringified anno
crates/ty_python_semantic/src/types/infer/builder.rs:1043
↓ 4 callersMethodend_of_scope_imported_final_candidates
Imports that may contribute a `Final` qualifier at the end of the scope.
crates/ty_python_core/src/use_def.rs:1403
↓ 4 callersMethodend_token
(self)
crates/ruff_python_parser/src/string.rs:66
↓ 4 callersMethodentry
(&mut self, node: ast::NodeIndex)
crates/ty_python_core/src/ast_ids.rs:64
↓ 4 callersMethodentry_is_file
Returns whether `name` resolves to a file, following symbolic links.
crates/ruff_db/src/files/directory.rs:34
↓ 4 callersFunctionenum_member_literals
Return the enum's canonical member literals when they exhaust its runtime domain.
crates/ty_python_semantic/src/types/enums.rs:1623
↓ 4 callersMethoderror_priority
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/call/bind.rs:421
↓ 4 callersMethoderrors
(&self)
crates/ty_python_semantic/src/types/call/bind.rs:9733
↓ 4 callersMethodevaluate
Compare all possible values. If no member of an enum can match, exclude it from the other possible values. Return whether the result is certain or w
crates/ty_python_semantic/src/types/equality/enums.rs:204
↓ 4 callersFunctionevaluate_reachability
( db: &dyn Db, use_def: &UseDefMap, reachability: ScopedReachabilityConstraintId, )
crates/ty_python_semantic/src/reachability.rs:2147
↓ 4 callersFunctionevaluate_type_equality
Return a constraint for `left` in a branch where `left == right` has the given truthiness. Returns `None` when the comparison behavior of either oper
crates/ty_python_semantic/src/types/equality.rs:134
↓ 4 callersMethodexact
(&self, module_name: &ModuleName)
crates/ty_module_resolver/src/typeshed.rs:74
↓ 4 callersMethodexceptions
Return the union of all handled exceptions as an [`Exceptions`] bitflag.
crates/ruff_python_semantic/src/model.rs:2045
↓ 4 callersMethodexpand_eagerly
Returns the eagerly expanded type. In the case of recursive type aliases, this will diverge, so that part will be replaced with `Divergent`.
crates/ty_python_semantic/src/types.rs:10753
↓ 4 callersFunctionexpand_parent
IR element that forces the parent group to print in expanded mode. Has no effect if used outside of a group or element that introduce implicit groups
crates/ruff_formatter/src/builders.rs:1783
↓ 4 callersMethodexpression_id
The expression that the reference occurs in.
crates/ruff_python_semantic/src/reference.rs:31
↓ 4 callersMethodexpression_node
(&self, expr: &ast::Expr)
crates/ty_python_core/src/place.rs:642
↓ 4 callersMethodexpression_truthiness
Evaluate an already-inferred expression, preserving the absence of a result.
crates/ty_python_semantic/src/types/infer/builder.rs:9025
↓ 4 callersFunctionextract
(line: &'static str)
crates/ruff_unicode_names2_generator/src/lib.rs:29
↓ 4 callersMethodextract_explicit_bases
Extract base classes from the bases argument of a `type()` or `types.new_class()` call. Emits a diagnostic if `bases_type` is not a valid bases itera
crates/ty_python_semantic/src/types/infer/builder/dynamic_class.rs:82
↓ 4 callersFunctionextract_unpacked_typed_dict_from_value_type
Extracts the declared keys and openness from a `TypedDict`-shaped value.
crates/ty_python_semantic/src/types/typed_dict.rs:1924
↓ 4 callersFunctionf
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/if.py:82
↓ 4 callersMethodfallback_enter_type
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/context_manager.rs:343
↓ 4 callersMethodfallback_type
(&self)
crates/ty_python_semantic/src/types/infer.rs:1169
↓ 4 callersFunctionfetch
( request: Request, env: Env, ctx: ExecutionContext, )
playground/api/src/index.ts:41
↓ 4 callersMethodfile_name
Returns the entry's name without its parent directory.
crates/ty_module_resolver/src/path.rs:475
↓ 4 callersMethodfile_name
(&self)
crates/ruff_workspace/src/resolver.rs:797
↓ 4 callersMethodfile_type_expression_flags
Get metadata for a type expression from any scope in the same file.
crates/ty_python_semantic/src/types/infer/builder.rs:1150
↓ 4 callersMethodfilename
(mut self, filename: &'a str)
crates/ruff/tests/integration_test.rs:59
↓ 4 callersMethodfiles_to_check
(self)
scripts/ty_benchmark/src/benchmark/test_lsp_diagnostics.py:198
↓ 4 callersMethodfinalize
(&mut self, trailer: Option<Trailer>)
crates/ruff_linter/src/rules/isort/block.rs:107
↓ 4 callersFunctionfind_over_type
Recurse into a type and calls the passed-in closure on every nested type encountered, returning the first non-`None` value returned by the closure. F
crates/ty_python_semantic/src/types/visitor.rs:1149
↓ 4 callersFunctionfind_symbol_in_scope
Find definitions for a symbol name in a specific scope.
crates/ty_python_semantic/src/types/definition_resolution.rs:818
↓ 4 callersMethodfind_token_start
Attempts to find the start of the given token in the given range.
crates/ty_ide/src/folding_range.rs:423
↓ 4 callersMethodfinish
Consumes `self` and returns the [`SourceFile`].
crates/ruff_source_file/src/lib.rs:120
↓ 4 callersMethodfinish
Finishes the output and returns any error encountered.
crates/ruff_formatter/src/builders.rs:2504
↓ 4 callersMethodfinish
(&mut self)
crates/ty_python_semantic/src/types/narrow.rs:1711
↓ 4 callersMethodfinish_visit
Finish a [`CycleDetectorVisit::Pending`] visit and cache its result.
crates/ty_python_semantic/src/types/cyclic.rs:990
↓ 4 callersMethodfinite_alternatives
Return the exact finite alternatives represented by this intersection, if available.
crates/ty_python_semantic/src/types/set_theoretic.rs:1056
↓ 4 callersFunctionfirst_nontrivial_statement
Return the first "nontrivial" statement in `suite`, if any. See [`is_trivial_statement`] for the definition of a trivial statement.
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:1649
↓ 4 callersMethodfirst_operand
Returns the first operand in the slice.
crates/ruff_python_formatter/src/expression/binary_like.rs:589
↓ 4 callersMethodfits
(&mut self, queue: &PrintQueue<'a>, stack: &PrintCallStack)
crates/ruff_formatter/src/printer/mod.rs:395
↓ 4 callersMethodflags
(self)
crates/ruff_python_formatter/src/other/interpolated_string.rs:20
← previousnext →3,101–3,200 of 31,562, ranked by callers