MCPcopy Create free account

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

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

↓ 3 callersMethodpeek
Returns the next non-trivia token without consuming it. Use [`peek2`] to get the next two tokens. [`peek2`]: TokenSource::peek2
crates/ruff_python_parser/src/token_source.rs:142
↓ 3 callersFunctionplace_from_declarations_impl
Implementation of [`place_from_declarations`]. ## Implementation Note This function gets called cross-module. It, therefore, shouldn't access any AST
crates/ty_python_semantic/src/place.rs:2196
↓ 3 callersFunctionplace_value_type
Uses surviving bindings' assigned values when lookup returns a declared or widened type.
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:285
↓ 3 callersMethodpop
(&mut self)
crates/ty_python_semantic/src/types/constraints.rs:5171
↓ 3 callersMethodpop_assignment
(&mut self)
crates/ty_python_core/src/builder.rs:2637
↓ 3 callersMethodpop_scope
Pop the current [`Scope`] off the stack.
crates/ruff_python_semantic/src/model.rs:1444
↓ 3 callersMethodpositional
Create a [`CallArguments`] from an iterator over non-variadic positional argument types.
crates/ty_python_semantic/src/types/call/arguments.rs:697
↓ 3 callersMethodpreceding_import
Return the import statement that precedes the given position, if any.
crates/ruff_linter/src/importer/mod.rs:538
↓ 3 callersFunctionpredicate_scope
(db: &'db dyn Db, predicate: &Predicate<'db>)
crates/ty_python_semantic/src/reachability.rs:598
↓ 3 callersFunctionprefer_collection_literal_peer_context
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, tcx: TypeContext<'db>, )
crates/ty_python_semantic/src/types/infer/builder.rs:13324
↓ 3 callersMethodpreferred_quote
Return the preferred quote for a generated `StringLiteral` node, given where we are in the AST.
crates/ruff_linter/src/checkers/ast/mod.rs:390
↓ 3 callersMethodprefix_and_code
(&self)
crates/ruff_linter/src/rule_selector.rs:227
↓ 3 callersMethodpretty
(self)
scripts/publish-crates.py:50
↓ 3 callersMethodprint
Prints the passed in element as well as all its content
crates/ruff_formatter/src/printer/mod.rs:51
↓ 3 callersMethodprint_entry
Fully print an element (print the element itself and all its descendants) Unlike [`print_element`], this function ensures the entire element has been
crates/ruff_formatter/src/printer/mod.rs:785
↓ 3 callersMethodprogram_settings
(&self)
crates/ty_test/src/db.rs:200
↓ 3 callersMethodprogram_settings
(&self)
crates/ty_python_semantic/src/db.rs:168
↓ 3 callersFunctionprogram_version
Returns the version of the executing program if set.
crates/ruff_db/src/lib.rs:55
↓ 3 callersMethodproject
Projects one constraint node into the graph for this place.
crates/ty_python_semantic/src/reachability.rs:1473
↓ 3 callersMethodproject_db
Returns a reference to the project's [`ProjectDatabase`] in which the given `path` belongs. If the path is a system path, it will return the project
crates/ty_server/src/session.rs:477
↓ 3 callersFunctionproject_root
()
crates/ruff_python_parser/tests/generate_inline_tests.rs:16
↓ 3 callersMethodproject_state_for_document
Selects a project to use for analysis of the given document (identified by path). When the given document path is a system path, we select the projec
crates/ty_server/src/session.rs:529
↓ 3 callersMethodproject_sync_path
The directory whose uv project metadata needs refreshing, if any. This may be an ancestor of the previous project root if that directory was deleted.
crates/ty_project/src/db/changes.rs:32
↓ 3 callersMethodpromote_singletons
Promote a top-level singleton type (like `None`, `EllipsisType`) to `T | Unknown`.
crates/ty_python_semantic/src/types.rs:3766
↓ 3 callersFunctionprotocol_member_read_type
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, ty: Type<'db>, receiver_ty: Type<'db>, m
crates/ty_python_semantic/src/types/protocol_class.rs:2650
↓ 3 callersMethodprovides_candidate_bound
Whether this constraint provides a useful bound to the solver.
crates/ty_python_semantic/src/types/constraints/variables.rs:496
↓ 3 callersFunctionpublish_diagnostics
Publishes the diagnostics for the given document snapshot using the [publish diagnostics notification].
crates/ty_server/src/server/api/diagnostics.rs:228
↓ 3 callersFunctionpublish_settings_diagnostics
Publishes settings diagnostics for all the project at the given path using the [publish diagnostics notification]. [publish diagnostics notification]
crates/ty_server/src/server/api/diagnostics.rs:291
↓ 3 callersMethodpure_redundancy_error_context
Re-run the pure redundancy check with error context collection enabled. This should normally be called when `is_pure_redundant_with` has returned `fa
crates/ty_python_semantic/src/types/relation.rs:523
↓ 3 callersMethodpush_assignment
(&mut self, assignment: CurrentAssignment<'ast, 'db>)
crates/ty_python_core/src/builder.rs:2633
↓ 3 callersMethodpush_marker
(&mut self)
crates/ruff_formatter/src/printer/mod.rs:498
↓ 3 callersMethodpush_tag
Attaches an additional tag to this annotation.
crates/ruff_db/src/diagnostic/mod.rs:863
↓ 3 callersFunctionpy39_typeshed_test_case
(typeshed: MockedTypeshed)
crates/ty_module_resolver/src/path.rs:1267
↓ 3 callersMethodpy_source_type
(&self)
crates/ruff_linter/src/source_kind.rs:79
↓ 3 callersFunctionpytest_db_with_files
(files: &[(&'static str, &'static str)])
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:1245
↓ 3 callersFunctionpytest_test_for_binding
( db: &'db dyn Db, binding: Definition<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:173
↓ 3 callersFunctionpytest_tests_in_file
( db: &'db dyn Db, file: ProgramFile<'db>, )
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:83
↓ 3 callersMethodpython_version
(&self)
crates/ty_python_core/src/builder.rs:5884
↓ 3 callersMethodpython_version
(&mut self, version: PythonVersion)
crates/ty_ide/src/lib.rs:614
↓ 3 callersMethodqueue_action
(&self, action: Action)
crates/ty_server/src/session/client.rs:238
↓ 3 callersFunctionquote_annotation
Wrap a type annotation in quotes. This requires more than just wrapping the reference itself in quotes. For example: - When quoting `Series` in `Seri
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:355
↓ 3 callersFunctionquote_type_expression
Wrap a type expression in quotes. This function assumes that the callee already expanded expression components to the minimum acceptable range for qu
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:404
↓ 3 callersMethodrange
(&self)
crates/ruff_python_semantic/src/model.rs:3233
↓ 3 callersMethodrange
(&self)
crates/ruff_python_formatter/src/verbatim.rs:891
↓ 3 callersMethodrange
(&self)
crates/ruff_python_formatter/src/comments/map.rs:501
↓ 3 callersMethodrange
(&self)
crates/ruff_text_size/src/traits.rs:57
↓ 3 callersMethodrange
(&self, module: &ParsedModuleRef)
crates/ty_python_core/src/definition.rs:1659
↓ 3 callersMethodrange
(&self)
crates/mdtest/src/parser.rs:234
↓ 3 callersMethodrange
(&self)
crates/ty_ide/src/goto.rs:1337
↓ 3 callersMethodrange
Returns the section's source range.
crates/ty_ide/src/docstring/document.rs:73
↓ 3 callersMethodrange
(&self)
crates/ty_ide/src/docstring/markdown/structured.rs:203
↓ 3 callersMethodrange
(&self)
crates/ruff_linter/src/docstrings/mod.rs:88
↓ 3 callersMethodrange
(&self)
crates/ruff_linter/src/rules/ruff/rules/sort_dunder_slots.rs:198
↓ 3 callersMethodrange
(&self)
crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs:338
↓ 3 callersMethodranges
Returns an iterator over [`TextRange`]s covered by each cell.
crates/ruff_notebook/src/cell.rs:325
↓ 3 callersFunctionraw_contents
Returns the raw contents of the string given the string's contents and flags. This is a string without the prefix and quotes.
crates/ruff_linter/src/rules/flake8_quotes/helpers.rs:6
↓ 3 callersFunctionreachable_class_literals_in_file
Enumerates the reachable class definitions in `file`.
crates/ty_python_semantic/src/types/ide_support.rs:2012
↓ 3 callersMethodreachable_member_bindings
( &self, member: ScopedMemberId, )
crates/ty_python_core/src/use_def.rs:1266
↓ 3 callersMethodreaching_definitions
Returns the definitions that may supply the value read by this use of a name. An unbound name and a name supplied by a builtin can both have an empty
crates/ty_python_semantic/src/semantic_model.rs:467
↓ 3 callersMethodread_directory
( &self, path: &SystemPath, )
crates/ruff_db/src/system/os.rs:207
↓ 3 callersMethodread_to_string
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/memory_fs.rs:123
↓ 3 callersMethodreal_stdlib_directory
Return the real stdlib path (containing actual .py files, and not some variation of typeshed). See the documentation for [`real_stdlib_directory_from
crates/ty_site_packages/src/lib.rs:954
↓ 3 callersMethodreason
Return an [`StaticMroErrorKind`] variant describing why we could not resolve the MRO for this class.
crates/ty_python_semantic/src/types/mro.rs:792
↓ 3 callersMethodrecord
Records an item for ambiguity tracking. This updates the ambiguity state for items with the same name: - First occurrence: `Unambiguous` - Different
crates/ty_python_semantic/src/types/display.rs:609
↓ 3 callersMethodrecord_call_gate
(&mut self)
crates/ty_python_core/src/use_def/exception_checkpoint.rs:49
↓ 3 callersMethodrecord_definition
Records an already-created definition in the current scope. `previous_definitions` controls whether a new binding replaces earlier bindings. By defau
crates/ty_python_core/src/builder.rs:1618
↓ 3 callersMethodrecord_expression
(&mut self, expr: &impl HasTrackedScope, scope: FileScopeId)
crates/ty_python_core/src/ast_ids.rs:68
↓ 3 callersMethodrecord_expression_narrowing_constraint
( &mut self, predicate_node: &'ast ast::Expr, )
crates/ty_python_core/src/builder.rs:2191
↓ 3 callersMethodrecord_imported_qualifier
Record an import that may contribute qualifiers without declaring a type. Imports replace earlier imported qualifiers, but keep real declarations and
crates/ty_python_core/src/use_def/place_state.rs:228
↓ 3 callersMethodrecord_negated_narrowing_constraint
Negates the given predicate and then adds it as a narrowing constraint to the places that could possibly be narrowed. Takes the `ScopedPredicateId` f
crates/ty_python_core/src/builder.rs:2409
↓ 3 callersMethodrecord_range_reachability
( &mut self, range: TextRange, is_type_checking_block: bool, )
crates/ty_python_core/src/use_def.rs:3036
↓ 3 callersMethodrecv
(self, *, length=65536)
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:981
↓ 3 callersMethodrediscover
Rediscovers the project from `path`, while preserving applied options.
crates/ty_project/src/metadata.rs:362
↓ 3 callersMethodredundant_conditions
( &self, test: BooleanTest<'ast, 'db>, condition_context: RedundantConditionContext,
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:966
↓ 3 callersFunctionreferences
Find all references to a symbol at the given position. Search for references across all files in the project.
crates/ty_ide/src/references.rs:94
↓ 3 callersMethodreferences_typevar
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, typevar_id: TypeVarIde
crates/ty_python_semantic/src/types/typevar.rs:70
↓ 3 callersMethodregister_lint
(&mut self, lint: &'static LintMetadata)
crates/ty_python_semantic/src/lint.rs:372
↓ 3 callersMethodreject_non_alias_reference
( &mut self, ty: Type<'db>, definition: Option<Definition<'db>>, reference: &a
crates/ty_python_semantic/src/types/infer/builder/type_expression.rs:359
↓ 3 callersMethodrelative_path
Returns the relative path based on `path` and the package root. Returns `None` if `path` is not within the package.
crates/ruff/src/cache.rs:250
↓ 3 callersMethodrelativize_system_path
(&self, path: &SystemPath)
crates/ty_module_resolver/src/path.rs:753
↓ 3 callersMethodrelativize_system_path_only
( &self, path: &'a SystemPath, )
crates/ty_module_resolver/src/path.rs:762
↓ 3 callersMethodreload_files
(self, db: &mut dyn Db)
crates/ty_project/src/lib.rs:850
↓ 3 callersMethodremaining_literal_types_for_display
Expand this complement for display only if the resulting `Literal[...]` remains concise. This keeps small enum complements readable as literal groups
crates/ty_python_semantic/src/types/enums.rs:839
↓ 3 callersMethodremove
(&mut self, path: &SystemPath)
crates/ty_project/src/watch/watcher.rs:174
↓ 3 callersMethodremove_file
(&self, path: impl AsRef<SystemPath>)
crates/ruff_db/src/system/memory_fs.rs:276
↓ 3 callersFunctionrender
Render Markdown for a source docstring. `source` must have already undergone PEP-257 trimming and universal newline normalization (typically via `doc
crates/ty_ide/src/docstring/markdown.rs:10
↓ 3 callersFunctionrender_diagnostics
( writer: &mut dyn Write, format: OutputFormat, config: &DisplayDiagnosticConfig, context: &Re
crates/ruff_linter/src/message/mod.rs:211
↓ 3 callersFunctionrender_fragment_into
Renders a normalized, extracted docstring fragment as Markdown. Outside recognized code blocks, leading indentation remains ordinary spaces, allowing
crates/ty_ide/src/docstring/markdown/general.rs:36
↓ 3 callersFunctionrender_origin
( renderer: &Renderer, buffer: &mut StyledBuffer, max_line_num_len: usize, origin: &Origin<'_>
crates/ruff_annotate_snippets/src/renderer/render.rs:482
↓ 3 callersMethodreplacement
(self)
crates/ruff_linter/src/rules/refurb/rules/slice_to_remove_prefix_or_suffix.rs:490
↓ 3 callersMethodreplaces_meaningful_content
(&self, sm: &SourceMap<'_>)
crates/ruff_annotate_snippets/src/renderer/source_map.rs:803
↓ 3 callersMethodreport_diagnostic
(&self, context: &InferContext, condition: impl Ranged)
crates/ty_python_semantic/src/types/bool.rs:448
↓ 3 callersMethodreport_diagnostics_impl
( &self, context: &CallDiagnosticContext<'_, '_, 'db, '_>, node: ast::AnyNodeRef,
crates/ty_python_semantic/src/types/call/bind.rs:1595
↓ 3 callersFunctionreport_dynamic_mro_errors
Report MRO errors for a dynamic class. Returns `true` if the MRO is valid, `false` if there were errors.
crates/ty_python_semantic/src/types/infer/builder/dynamic_class.rs:256
↓ 3 callersFunctionreport_inconsistent_dynamic_generic_bases
Report conflicting specializations of the same generic base in a dynamic class's MRO. For example, `type("C", (A, B), {})` is invalid if `A` inherits
crates/ty_python_semantic/src/types/infer/builder/dynamic_class.rs:288
↓ 3 callersMethodreport_invalid
(&mut self, diagnostic: Diagnostic)
crates/ty_project/src/script.rs:410
↓ 3 callersFunctionreport_invalid_key_on_typed_dict
( context: &InferContext<'db, '_>, typed_dict_node: AnyNodeRef, key_node: AnyNodeRef, typed_di
crates/ty_python_semantic/src/types/diagnostic.rs:4657
↓ 3 callersMethodreport_lint
( &'ctx self, lint: &'static LintMetadata, range: TextRange, )
crates/ty_python_semantic/src/suppression.rs:294
↓ 3 callersMethodreport_redundant_condition
( &'ctx self, condition: &RedundantCondition<'_, 'db>, )
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/diagnostic.rs:61
↓ 3 callersMethodreport_unchecked
Reports a diagnostic without checking if the lint at the given range is suppressed or marking the suppression as used.
crates/ty_python_semantic/src/suppression.rs:309
← previousnext →4,501–4,600 of 31,766, ranked by callers