MCPcopy Create free account

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

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

↓ 9 callersMethodsecondary_code_or_id
Returns the secondary code for the diagnostic if it exists, or the lint name otherwise. This is a common pattern for Ruff diagnostics, which want to
crates/ruff_db/src/diagnostic/mod.rs:427
↓ 9 callersFunctionsequence_pattern_type_builder
(db: &dyn Db)
crates/ty_python_semantic/src/types/match_pattern.rs:89
↓ 9 callersMethodshow_error_message
Sends a request to display an error to the client with a formatted message. The error is sent in a `window/showMessage` notification. Logs an error i
crates/ty_server/src/session/client.rs:195
↓ 9 callersMethodshow_fix_status
(&self)
crates/ruff_db/src/diagnostic/mod.rs:1564
↓ 9 callersMethodsite_packages_paths
( &self, system: &dyn System, )
crates/ty_site_packages/src/lib.rs:378
↓ 9 callersMethodskip_bytes
Skips the next `count` bytes. ## Panics - If `count` is larger than the remaining bytes in the input stream. - If `count` indexes into a multi-byte c
crates/ruff_python_trivia/src/cursor.rs:169
↓ 9 callersFunctionskip_chars
(src: str, pos: Pos, chars: Iterable[str])
crates/ruff_benchmark/resources/tomllib/_parser.py:232
↓ 9 callersFunctionsoft_line_break_or_space
()
crates/ruff_formatter/src/builders.rs:190
↓ 9 callersMethodsource_location
( &self, offset: TextSize, position_encoding: PositionEncoding, )
crates/ruff_source_file/src/lib.rs:44
↓ 9 callersMethodsplit_around_star
Return the patterns before and after the starred element.
crates/ty_python_core/src/predicate.rs:166
↓ 9 callersMethodsystem
(&self)
crates/ty_project/src/db.rs:575
↓ 9 callersFunctiontest_helper
(source: &str, expected: usize)
crates/ruff_linter/src/rules/pylint/rules/too_many_return_statements.rs:105
↓ 9 callersFunctiontext
Creates a text from a dynamic string. This is done by allocating a new string internally.
crates/ruff_formatter/src/builders.rs:343
↓ 9 callersMethodtext_len
Returns the length of the indentation in bytes. # Panics If the indentation is longer than 4GB.
crates/ruff_python_formatter/src/string/docstring.rs:1734
↓ 9 callersMethodtext_len
(&self)
crates/ruff_python_trivia/src/cursor.rs:64
↓ 9 callersMethodtext_len
(self)
crates/ruff_python_ast/src/str_prefix.rs:39
↓ 9 callersMethodto_module_path
(&self)
crates/ty_module_resolver/src/path.rs:580
↓ 9 callersMethodtruncated_display
Return a truncated snippet for user-facing display.
crates/ruff_linter/src/fix/snippet.rs:27
↓ 9 callersMethodtry_map
A fallible version of [`UnionType::map`]. For each element in `self`, `transform_fn` is called on that element. If `transform_fn` returns `Some()` fo
crates/ty_python_semantic/src/types/set_theoretic.rs:189
↓ 9 callersMethodtry_set_optional_fix
( &mut self, func: impl FnOnce() -> anyhow::Result<Option<Fix>>, )
crates/ruff_linter/src/checkers/ast/mod.rs:3730
↓ 9 callersMethodtuple_instance_spec
If this type is an instance type where the class has a tuple spec, returns the tuple spec. I.e., for the type `tuple[int, str]`, this will return the
crates/ty_python_semantic/src/types.rs:1483
↓ 9 callersMethodtyping_importer
Create a [`TypingImporter`] that will import `member` from either `typing` or `typing_extensions`. On Python <`version_added_to_typing`, `member` is
crates/ruff_linter/src/checkers/ast/mod.rs:640
↓ 9 callersMethodunion
Return a new tuple-spec builder that reflects the union of this tuple and another tuple. For example, if `self` is a tuple-spec builder for `tuple[Li
crates/ty_python_semantic/src/types/tuple.rs:2535
↓ 9 callersFunctionupdate_file
Updates the content of a file and ensures that the last modified file time is updated.
crates/ty/tests/file_watching.rs:506
↓ 9 callersFunctionvendored_path_to_file
( db: &dyn Db, path: impl AsRef<VendoredPath>, )
crates/ruff_db/src/files.rs:53
↓ 9 callersMethodwhen_assignable_to
( self, db: &'db dyn Db, target: Type<'db>, constraints: &'c ConstraintSetBuil
crates/ty_python_semantic/src/types/relation.rs:410
↓ 9 callersMethodwhen_false
(self)
crates/ty_python_semantic/src/types/constraints.rs:1702
↓ 9 callersMethodwith_file
Write a file to the test directory
crates/ruff_server/tests/e2e/main.rs:1112
↓ 9 callersMethodwrite
Write the notebook back to the given [`Write`] implementer.
crates/ruff_notebook/src/notebook.rs:466
↓ 8 callersMethod__init__
(self, foo)
crates/ruff_linter/resources/test/fixtures/pyupgrade/UP008.py:332
↓ 8 callersMethodabsolute
Makes a path absolute and normalizes it without accessing the file system. Adapted from [cargo](https://github.com/rust-lang/cargo/blob/fede83ccf9734
crates/ruff_db/src/system/path.rs:447
↓ 8 callersMethodadd
Attempts to adds the given completion to this collection. When added, `true` is returned. This might not add the completion for a variety of reasons
crates/ty_ide/src/completion.rs:218
↓ 8 callersMethodadd
(x, y)
crates/ruff_linter/resources/test/fixtures/refurb/FURB118.py:47
↓ 8 callersFunctionadd_argument
Generic function to add arguments or keyword arguments to function calls. The new argument will be inserted before the first existing keyword argumen
crates/ruff_linter/src/fix/edits.rs:274
↓ 8 callersMethodadd_symbol
Add a symbol to the place table and the use-def map. Return the [`ScopedPlaceId`] that uniquely identifies the symbol in both.
crates/ty_python_core/src/builder.rs:1345
↓ 8 callersMethodafter
Returns a slice of tokens after the given [`TextSize`] offset. If the given offset is between two tokens, the returned slice will start from the foll
crates/ruff_python_ast/src/token/tokens.rs:174
↓ 8 callersMethodapplies
Return [`true`] if this [`Fix`] should be applied with at a given [`Applicability`].
crates/ruff_diagnostics/src/fix.rs:174
↓ 8 callersMethodapply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:428
↓ 8 callersMethodas_path
(&self)
crates/ty_module_resolver/src/path.rs:693
↓ 8 callersMethodas_slice
(&self)
crates/ty_python_semantic/src/types/signatures.rs:3346
↓ 8 callersMethodas_string
(self)
crates/ty_python_semantic/src/types/literal.rs:202
↓ 8 callersMethodbindings
Returns a tuple of the name and ID of all bindings defined in this scope.
crates/ruff_python_semantic/src/scope.rs:103
↓ 8 callersMethodblock_comments
Given a [`CommentRanges`], determine which comments are grouped together in "comment blocks". A "comment block" is a sequence of consecutive own-line
crates/ruff_python_trivia/src/comment_ranges.rs:157
↓ 8 callersMethodbool
Resolves the boolean value of the type and falls back to [`Truthiness::Ambiguous`] if the type doesn't implement `__bool__` correctly. This method sh
crates/ty_python_semantic/src/types/bool.rs:21
↓ 8 callersMethodbuild
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:3088
↓ 8 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:692
↓ 8 callersFunctioncheck_display_graph
( db: &'db dyn Db, builder: &'c ConstraintSetBuilder<'db>, set: ConstraintSet<'db, 'c>
crates/ty_python_semantic/src/types/constraints.rs:7244
↓ 8 callersFunctioncheck_file
(db: &dyn Db, file: File)
crates/ty_python_semantic/src/lib.rs:176
↓ 8 callersMethodclear
(&mut self)
crates/ruff_linter/src/registry/rule_set.rs:27
↓ 8 callersMethodclear_salsa_events
Clears the salsa events.
crates/ty_module_resolver/src/db.rs:81
↓ 8 callersMethodcurrent_directory
(&self)
crates/ty_test/src/db.rs:433
↓ 8 callersMethodcurrent_statement_id
Return the [`NodeId`] of the current [`Stmt`], if any.
crates/ruff_python_semantic/src/model.rs:1519
↓ 8 callersMethoddefault_string_flags
Return the default string flags a generated `StringLiteral` node should use, given where we are in the AST.
crates/ruff_linter/src/checkers/ast/mod.rs:373
↓ 8 callersFunctiondeserialize_fixture
(content: &str)
crates/ruff_server/src/session/options.rs:516
↓ 8 callersMethodeat_char
(&mut self, c: char)
crates/ruff_python_parser/src/lexer/cursor.rs:104
↓ 8 callersFunctionempty_line
()
crates/ruff_formatter/src/builders.rs:133
↓ 8 callersMethodenabled
(&self, rule: Rule)
crates/ruff_linter/src/settings/rule_table.rs:27
↓ 8 callersMethoderror
()
crates/ruff_linter/resources/test/fixtures/flake8_raise/RSE102.py:58
↓ 8 callersMethoderror
Return the underlying [`ParseError`].
crates/ruff_linter/src/logging.rs:228
↓ 8 callersFunctionexactly_one_argument_with_matching_function
( name: &str, func: &Expr, args: &'a [Expr], keywords: &[Keyword], )
crates/ruff_linter/src/rules/flake8_comprehensions/helpers.rs:3
↓ 8 callersMethodexecution_context
Return the [`ExecutionContext`] of the current scope.
crates/ruff_python_semantic/src/model.rs:2080
↓ 8 callersMethodexpression_scope_id
(&self, expression: &E)
crates/ty_python_core/src/lib.rs:400
↓ 8 callersMethodextend
(&mut self, other: Self)
crates/ty_site_packages/src/lib.rs:105
↓ 8 callersMethodextend_back
(&mut self, elements: &'a [FormatElement])
crates/ruff_formatter/src/printer/queue.rs:105
↓ 8 callersFunctionf
(*args, **kwargs)
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/call.py:4
↓ 8 callersFunctionf
()
crates/ruff_python_parser/resources/valid/other/decorator.py:12
↓ 8 callersMethodfallback_element_type
(&self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/iteration.rs:491
↓ 8 callersMethodfile_expression_type
Get the type of an expression from any scope in the same file. If the expression is in the current scope, and we are inferring the entire scope, just
crates/ty_python_semantic/src/types/infer/builder.rs:833
↓ 8 callersMethodfinish
Finish the code example by generating any final actions if applicable. This typically adds an action when the end of a code example coincides with th
crates/ruff_python_formatter/src/string/docstring.rs:743
↓ 8 callersMethodfinite_alternative_union
Return the exact finite alternative union represented by this intersection, if available.
crates/ty_python_semantic/src/types/set_theoretic.rs:729
↓ 8 callersMethodflags
(self)
crates/ty_python_semantic/src/types/literal.rs:104
↓ 8 callersMethodflush_pending_line
Flushes content buffered for the current line.
crates/ty_ide/src/docstring/markdown/general.rs:306
↓ 8 callersMethodfmt
(&self, item: &Identifier, f: &mut PyFormatter)
crates/ruff_python_formatter/src/other/identifier.rs:11
↓ 8 callersFunctionformat
( document: &TextDocument, source_type: SourceType, formatter_settings: &FormatterSettings, pa
crates/ruff_server/src/format.rs:48
↓ 8 callersMethodformat
(&self)
crates/ruff_python_formatter/src/statement/mod.rs:74
↓ 8 callersMethodformatted
Converts every item to an object that knows how to format it.
crates/ruff_python_formatter/src/shared_traits.rs:70
↓ 8 callersMethodfreshness
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:887
↓ 8 callersMethodfull_lines_range
Computes the range of all lines that this `range` covers. The range starts at the beginning of the line at `range.start()` and goes up to, and includ
crates/ruff_source_file/src/line_ranges.rs:193
↓ 8 callersFunctionfull_range
(input: &str)
crates/ty_server/tests/e2e/code_actions.rs:35
↓ 8 callersMethodget
Return parameter at given index, or `None` if index is out-of-range.
crates/ty_python_semantic/src/types/signatures.rs:3804
↓ 8 callersMethodglobal_scope
Returns a reference to the global [`Scope`].
crates/ruff_python_semantic/src/model.rs:1529
↓ 8 callersMethodhas_typevar_or_typevar_instance
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:69
↓ 8 callersMethodhas_valid_syntax
Returns `true` if the parsed source code is valid i.e., it has no [`ParseError`]s. Note that this does not include version-related [`UnsupportedSynta
crates/ruff_python_parser/src/lib.rs:430
↓ 8 callersMethodheader_range
Returns the range of the `TypedDict` call expression.
crates/ty_python_semantic/src/types/class/typed_dict.rs:872
↓ 8 callersMethodin_string_type_definition
Return `true` if the model is visiting a "string type definition" that was previously deferred when initially traversing the AST
crates/ruff_python_semantic/src/model.rs:2118
↓ 8 callersMethodindex
(&self)
crates/ruff_source_file/src/lib.rs:200
↓ 8 callersFunctioninfer_deferred_types
( db: &'db dyn Db, definition: Definition<'db>, )
crates/ty_python_semantic/src/types/infer.rs:265
↓ 8 callersMethodinferable_typevars
Returns the typevars that are inferable in this generic context. This set might include more typevars than the ones directly bound by the generic cont
crates/ty_python_semantic/src/types/generics.rs:462
↓ 8 callersMethodinto_protocol_class
Returns the protocol class if this is a protocol.
crates/ty_python_semantic/src/types/class.rs:861
↓ 8 callersMethodinto_settings
(self, client: Client)
crates/ruff_server/src/session/options.rs:70
↓ 8 callersMethodinto_type_var
(self)
crates/ty_python_semantic/src/types/subclass_of.rs:134
↓ 8 callersMethodis_
(self, key: Key, flag: int)
crates/ruff_benchmark/resources/tomllib/_parser.py:175
↓ 8 callersMethodis_bound
(self)
crates/ty_python_core/src/place.rs:133
↓ 8 callersFunctionis_cased_uppercase
Return `true` if a string is _cased_ as uppercase. A string is cased as uppercase if it contains at least one uppercase character and no lowercase ch
crates/ruff_python_stdlib/src/str.rs:129
↓ 8 callersMethodis_classmethod
Returns true if this overload is decorated with `@classmethod`, or if it is implicitly a classmethod.
crates/ty_python_semantic/src/types/function.rs:342
↓ 8 callersMethodis_empty
(self)
crates/ruff_formatter/src/printer/mod.rs:958
↓ 8 callersMethodis_empty
(&self)
crates/ruff_server/src/edit.rs:172
↓ 8 callersMethodis_empty
(&self)
crates/ty_python_semantic/src/types/constraints.rs:1318
↓ 8 callersMethodis_empty
(&self)
crates/ruff_linter/src/settings/types.rs:830
↓ 8 callersFunctionis_list
Test whether the given binding can be considered a list. For this, we check what value might be associated with it through it's initialization and wh
crates/ruff_python_semantic/src/analyze/typing.rs:1026
← previousnext →1,401–1,500 of 27,349, ranked by callers