MCPcopy Create free account

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

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

↓ 2 callersMethodfinish_section
(&mut self, section: SectionBuilder<'a>)
crates/ty_ide/src/docstring/document/google.rs:317
↓ 2 callersMethodfinish_uncompacted
(mut self)
crates/ty_python_semantic/src/types/context.rs:427
↓ 2 callersMethodfirst_binding_at_use
(&self, use_id: ScopedUseId)
crates/ty_python_core/src/lib.rs:1210
↓ 2 callersMethodfirst_element
(&self)
crates/ty_python_semantic/src/types/mro.rs:637
↓ 2 callersMethodfirst_keyword_range
Returns the range of the first keyword that marks the start of the clause header.
crates/ruff_python_formatter/src/statement/clause.rs:247
↓ 2 callersMethodfirst_name
(&self)
crates/ty_python_semantic/src/types/abstract_methods.rs:234
↓ 2 callersFunctionfirst_non_trivia_token
Searches for the first non-trivia character after `offset`. The search skips over any whitespace and comments. Returns `Some` if the source code aft
crates/ruff_python_trivia/src/tokenizer.rs:13
↓ 2 callersMethodfirst_non_type_parent_scope_id
Returns the first parent of the given [`ScopeId`] that is not of [`ScopeKind::Type`] or [`ScopeKind::DunderClassCell`], if any.
crates/ruff_python_semantic/src/model.rs:1585
↓ 2 callersMethodfirst_overload_or_implementation
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:1748
↓ 2 callersMethodfirst_public_declaration
(&self, symbol: ScopedSymbolId)
crates/ty_python_core/src/lib.rs:1203
↓ 2 callersFunctionfix_all_diagnostics
Applies the safe fixes for all diagnostics and writes the changed files back to disk. Returns how many diagnostics were fixed along with the remainin
crates/ty_python_semantic/src/fixes.rs:60
↓ 2 callersFunctionfix_all_edit
( query: &DocumentQuery, encoding: PositionEncoding, )
crates/ruff_server/src/server/api/requests/code_action_resolve.rs:126
↓ 2 callersFunctionfixed_membership_truthiness
Evaluate membership using the supplied element types and identity-or-equality semantics. An ambiguous comparison does not prevent a later element from
crates/ty_python_semantic/src/types/infer/comparisons.rs:772
↓ 2 callersMethodfixed_prefix_slice
( &self, start: Option<usize>, stop: Option<usize>, step: NonZeroUsize, )
crates/ty_python_semantic/src/types/tuple.rs:1571
↓ 2 callersMethodfixed_suffix_slice
( &self, start: Option<usize>, stop: Option<usize>, step: NonZeroUsize, )
crates/ty_python_semantic/src/types/tuple.rs:1580
↓ 2 callersMethodfixes
( self, db: &dyn Db, file: PythonFile<'_>, file_diagnostics: &[Diagnostic],
crates/ty_python_semantic/src/fixes.rs:390
↓ 2 callersFunctionfixture_exposures_from_symbol_definitions
Returns fixture exposures reachable from the resolved definitions for one symbol.
crates/ty_python_semantic/src/types/dedicated/pytest/fixtures.rs:906
↓ 2 callersFunctionfixture_path
(path: &str)
crates/ruff_server/tests/e2e/notebook.rs:402
↓ 2 callersFunctionfixture_reference_resolution_for_definition
( db: &'db dyn SemanticDb, definition: Definition<'db>, name: &str, )
crates/ty_ide/src/references.rs:477
↓ 2 callersMethodfloor_char_boundary
Finds the closest [`TextSize`] not exceeding the offset for which `is_char_boundary` is `true`. ## Examples ``` # use ruff_text_size::{Ranged, TextR
crates/ruff_linter/src/locator.rs:95
↓ 2 callersMethodflush_line_suffixes
( &mut self, queue: &mut PrintQueue<'a>, stack: &mut PrintCallStack, line_brea
crates/ruff_formatter/src/printer/mod.rs:513
↓ 2 callersMethodflush_pending
(&mut self)
crates/ty_python_semantic/src/types/constraints/sequents.rs:267
↓ 2 callersMethodflush_pending_link
Flushes a wrapped hyperlink candidate.
crates/ty_ide/src/docstring/markdown/general.rs:314
↓ 2 callersMethodfmt
(&self, f: &mut Formatter<PyFormatContext<'ast>>)
crates/ruff_python_formatter/src/builders.rs:32
↓ 2 callersMethodfmt
(&self, f: &mut Formatter<PyFormatContext<'_>>)
crates/ruff_python_formatter/src/verbatim.rs:660
↓ 2 callersMethodfmt
(&self, item: &Mod, f: &mut PyFormatter)
crates/ruff_python_formatter/src/module/mod.rs:13
↓ 2 callersMethodfmt
(&self, item: &TypeParam, f: &mut PyFormatter)
crates/ruff_python_formatter/src/type_param/mod.rs:15
↓ 2 callersMethodfmt
(&self, f: &mut PyFormatter)
crates/ruff_python_formatter/src/string/mod.rs:20
↓ 2 callersMethodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
crates/ty_python_semantic/src/types/constraints.rs:1032
↓ 2 callersFunctionfmt_styled
( content: T, style: anstyle::Style, )
crates/ruff_db/src/diagnostic/stylesheet.rs:6
↓ 2 callersFunctionfolding_ranges
Returns a list of folding ranges for the given file.
crates/ty_ide/src/folding_range.rs:57
↓ 2 callersMethodfollowing_range
Returns the absolute range of the following lines.
crates/ruff_linter/src/docstrings/sections.rs:420
↓ 2 callersMethodfollowing_range_relative
Returns the range to the following lines relative to [`Docstring::body`].
crates/ruff_linter/src/docstrings/sections.rs:415
↓ 2 callersFunctionfoo
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/unary.py:185
↓ 2 callersFunctionfoo
()
crates/ruff_linter/resources/test/fixtures/flake8_pie/PIE804.py:29
↓ 2 callersFunctionfoo
()
crates/ruff_linter/resources/test/fixtures/pycodestyle/E27.py:84
↓ 2 callersFunctionfoo
()
crates/ruff_linter/resources/test/fixtures/flake8_async/ASYNC119.py:48
↓ 2 callersFunctionfoo
()
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP050.py:63
↓ 2 callersMethodfoo
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/lambda.py:326
↓ 2 callersMethodfoo
(self)
crates/ruff_linter/resources/test/fixtures/pylint/no_self_use.py:68
↓ 2 callersMethodfor_each_member_candidate
Visits protocol member candidates in MRO order after applying declaration precedence. Consumers discard shadowed names before applying the accompanyi
crates/ty_python_semantic/src/types/protocol_class.rs:146
↓ 2 callersMethodfor_each_unique_constraint
Invokes a closure for each unique BDD node that appears anywhere in a BDD. This treats the BDD as a DAG and does not revisit shared subgraphs. Use th
crates/ty_python_semantic/src/types/constraints.rs:2914
↓ 2 callersFunctionfor_loop_writes
FURB122
crates/ruff_linter/src/rules/refurb/rules/for_loop_writes.rs:139
↓ 2 callersMethodforce_exclude
(&self)
crates/ty_project/src/walk.rs:39
↓ 2 callersFunctionforeign_key_id_type
Return a relation field's stored ID type, used by both `<field>_id` and `pk`.
crates/ty_python_semantic/src/types/dedicated/django.rs:344
↓ 2 callersFunctionformat
Run the given ruff binary against the specified path.
python/ruff-ecosystem/ruff_ecosystem/format.py:248
↓ 2 callersMethodformat
(&self)
crates/ruff_python_formatter/src/module/mod.rs:24
↓ 2 callersMethodformat
(&self)
crates/ruff_python_formatter/src/statement/suite.rs:782
↓ 2 callersMethodformat
(&self)
crates/ruff_python_formatter/src/type_param/mod.rs:27
↓ 2 callersMethodformat
Given a code example, format them and return the formatted code as a sequence of owned docstring lines. This may mutate the code example in place if
crates/ruff_python_formatter/src/string/docstring.rs:491
↓ 2 callersMethodformat
Execute the format command on the given source.
crates/ruff_server/src/format.rs:304
↓ 2 callersFunctionformatSubDiagnosticAnnotation
( subDiagnostic: SubDiagnostic, annotation: DiagnosticAnnotation, includeSubDiagnosticMessage = annotati
playground/ty/src/Editor/Diagnostics.tsx:287
↓ 2 callersFunctionformatSubDiagnosticSeverity
(severity: SubDiagnosticSeverity)
playground/ty/src/Editor/Diagnostics.tsx:301
↓ 2 callersFunctionformat_bytes
Format bytes as a human-readable size.
scripts/memory_report.py:106
↓ 2 callersFunctionformat_code_blocks
( source: &str, path: Option<&Path>, settings: &FormatterSettings, )
crates/ruff_markdown/src/lib.rs:64
↓ 2 callersFunctionformat_dev_project
( files: &[PathBuf], stability_check: bool, write: bool, preview: bool, )
crates/ruff_dev/src/format_dev.rs:450
↓ 2 callersFunctionformat_elif_else_clause
Extracted so we can implement `FormatElifElseClause` but also pass in `last_node` from `FormatStmtIf`
crates/ruff_python_formatter/src/statement/stmt_if.rs:59
↓ 2 callersFunctionformat_mocks
( aliases: Vec<Option<AsName>>, is_lazy: bool, indent: &str, stylist: &Stylist, )
crates/ruff_linter/src/rules/pyupgrade/rules/deprecated_mock_import.rs:131
↓ 2 callersFunctionformat_origin
(origin: &Origin<'_>, anonymized_line_numbers: bool)
crates/ruff_annotate_snippets/src/renderer/render.rs:536
↓ 2 callersFunctionformat_path
( path: &Path, settings: &FormatterSettings, source_type: SourceType, mode: FormatMode, ra
crates/ruff/src/commands/format.rs:252
↓ 2 callersMethodformat_request
Send a `textDocument/formatting` request for the document at the given path.
crates/ruff_server/tests/e2e/main.rs:829
↓ 2 callersFunctionformat_source
Format a [`SourceKind`], returning the transformed [`SourceKind`], or `None` if the source was unchanged.
crates/ruff/src/commands/format.rs:348
↓ 2 callersFunctionformat_suite
(level: SuiteKind)
crates/ruff_python_formatter/src/statement/suite.rs:994
↓ 2 callersFunctionformat_text_document
( text_document: &TextDocument, query: &DocumentQuery, encoding: PositionEncoding, is_notebook
crates/ruff_server/src/server/api/requests/format.rs:94
↓ 2 callersMethodforwarded_assignment_owner
Returns the owner of an assignment redirected by `global` or `nonlocal`. `global` assignments target the module symbol, while `nonlocal` assignments
crates/ty_python_semantic/src/types/infer/builder.rs:1775
↓ 2 callersFunctionforwarding_alias_definition
Find the definition referenced by `A` in a forwarding assignment such as `B = A` or `B = module.A`. For `B = A`, use the semantic index's bindings an
crates/ty_python_semantic/src/types/infer/legacy_type_alias.rs:275
↓ 2 callersMethodfreeze
Permanently freezes the most heavily read inputs that are immutable during a one-shot check. This is intentionally not exhaustive. It includes the pr
crates/ty_project/src/db.rs:143
↓ 2 callersFunctionfresh_binding_name
Return a fresh binding name derived from `base` that does not shadow an existing non-builtin symbol in the current semantic scope.
crates/ruff_linter/src/fix/edits.rs:408
↓ 2 callersMethodfreshen_bound_typevars
( &self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, delta: u32, )
crates/ty_python_semantic/src/types/signatures.rs:1255
↓ 2 callersFunctionfreshening_delta
Returns a freshening delta if a binder would collide with an occurrence in `types`.
crates/ty_python_semantic/src/types/typevar.rs:974
↓ 2 callersMethodfrom_json
Load a memory report from a JSON file.
scripts/memory_report.py:78
↓ 2 callersFunctionfrom_negative_i32
(index: i32)
crates/ty_python_semantic/src/subscript.rs:32
↓ 2 callersMethodfrom_pair
Construct a diff from before and after.
python/ruff-ecosystem/ruff_ecosystem/types.py:61
↓ 2 callersMethodfull_block_range
Returns a folding range for a full block, preserving the first line of the block header.
crates/ty_ide/src/folding_range.rs:508
↓ 2 callersMethodfull_module_name
Appends a component name to this search's module name prefix.
crates/ty_module_resolver/src/resolve/search.rs:384
↓ 2 callersFunctionfull_object_ty_annotation
(ty: Type<'_>)
crates/ty_python_semantic/src/types/typed_dict.rs:2344
↓ 2 callersMethodfull_path
Returns the full path using unix file-path convention.
crates/mdtest/src/parser.rs:420
↓ 2 callersMethodfull_range
(&self)
crates/ruff_source_file/src/newlines.rs:229
↓ 2 callersFunctionfunc
()
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/import.py:40
↓ 2 callersFunctionfunc
Do something. Args: x: the value with a hanging indent Returns: the value
crates/ruff_linter/resources/test/fixtures/pydocstyle/D413.py:12
↓ 2 callersFunctionfunc
(pos, password)
crates/ruff_linter/resources/test/fixtures/flake8_bandit/S106.py:1
↓ 2 callersFunctionfunc2
()
crates/ruff_linter/resources/test/fixtures/ruff/RUF036.py:8
↓ 2 callersMethodfunc2
()
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:66
↓ 2 callersMethodfunc3
()
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:96
↓ 2 callersMethodfunc_arg
(self)
crates/ruff_linter/src/rules/ruff/rules/legacy_form_pytest_raises.rs:115
↓ 2 callersMethodfunction
Returns the underlying Python function, when the bound callable has a function definition.
crates/ty_python_semantic/src/types/method.rs:184
↓ 2 callersMethodfunction
(&'db self, selector: &str)
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:1209
↓ 2 callersFunctionfunction_body_kind
Classify the body of this function: - [`FunctionBodyKind::Stub`] if it is a stub function (i.e., only contains `pass` or `...` - [`FunctionBodyKind::A
crates/ty_python_semantic/src/types/function.rs:2209
↓ 2 callersFunctionfunction_context
(db: &'db TestDb, name: &str)
crates/ty_python_semantic/src/types/generics.rs:5599
↓ 2 callersMethodfunction_name
(self)
crates/ty_python_semantic/src/types/infer/builder/dynamic_class.rs:30
↓ 2 callersFunctionfunction_returning_generator
(r)
crates/ruff_linter/resources/test/fixtures/pylint/len_as_condition.py:161
↓ 2 callersMethodfunction_scope
Finds and returns the [`Scope`] corresponding to a given [`ast::StmtFunctionDef`]. This method searches all scopes created by a function definition,
crates/ruff_python_semantic/src/model.rs:2383
↓ 2 callersFunctionfunction_uses_loop_variable
B023
crates/ruff_linter/src/rules/flake8_bugbear/rules/function_uses_loop_variable.rs:285
↓ 2 callersFunctionfunctional_typed_dict_field
( declared_ty: Type<'_>, qualifiers: TypeQualifiers, total: bool, )
crates/ty_python_semantic/src/types/typed_dict.rs:189
↓ 2 callersMethodg
(self)
crates/ruff_linter/resources/test/fixtures/pycodestyle/E30.py:276
↓ 2 callersFunctiongenerateMonacoTokens
( semantic: SemanticToken[], model: editor.ITextModel, )
playground/ty/src/Editor/Editor.tsx:1086
↓ 2 callersMethodgenerate_constraint
Generate a constraint from the type of a `classinfo` argument to `isinstance` or `issubclass`. The `classinfo` argument can be a class literal, a tup
crates/ty_python_semantic/src/types/narrow.rs:524
↓ 2 callersFunctiongenerate_diagnostics
(snapshot: &DocumentSnapshot)
crates/ruff_server/src/server/api/diagnostics.rs:8
↓ 2 callersFunctiongenerate_method_call
Format a code snippet to call `name.method()`.
crates/ruff_linter/src/rules/refurb/helpers.rs:15
↓ 2 callersFunctiongenerate_semantic_tokens
Common logic for generating semantic tokens, either for full document or a specific range. If no range is provided, the entire file is processed.
crates/ty_server/src/server/api/semantic_tokens.rs:12
← previousnext →5,601–5,700 of 31,562, ranked by callers