Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
27,349 in github.com/astral-sh/ruff
⨍
Functions
27,349
◇
Types & classes
6,530
↳
Endpoints
82
↓ 97 callers
Method
info
Adds an "info" sub-diagnostic with the given message. If callers want to add an "info" sub-diagnostic with annotations, then create a [`SubDiagnostic
crates/ruff_db/src/diagnostic/mod.rs:168
↓ 97 callers
Method
iter
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:11013
↓ 97 callers
Method
range
(&self)
crates/ruff_linter/src/rules/flake8_pyi/rules/custom_type_var_for_self.rs:497
↓ 95 callers
Method
take
Return the full tree, replacing it with an empty tree.
crates/ty_python_semantic/src/types/relation_error.rs:528
↓ 95 callers
Method
to_path_buf
Converts the path to an owned [`SystemPathBuf`].
crates/ruff_db/src/system/path.rs:370
↓ 93 callers
Method
as_std_path
(&self)
crates/ruff_db/src/system/path.rs:382
↓ 93 callers
Method
contains
(&self, rule: Rule)
crates/ruff_linter/src/registry/rule_set.rs:249
↓ 93 callers
Method
or_else
(self, other: impl Fn() -> Self)
crates/ty_python_core/src/lib.rs:989
↓ 93 callers
Method
starts_with
(&self, base: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:121
↓ 93 callers
Method
typevar
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/bound_super.rs:31
↓ 92 callers
Method
build
(self)
crates/ty_module_resolver/src/testing.rs:209
↓ 92 callers
Function
once
()
crates/ruff_linter/src/rules/pyupgrade/fixes.rs:92
↓ 92 callers
Function
setup_db
()
crates/ty_python_semantic/src/db.rs:238
↓ 92 callers
Method
strip_prefix
( &self, base: impl AsRef<SystemPath>, )
crates/ruff_db/src/system/path.rs:323
↓ 91 callers
Method
highlight_file
Get semantic tokens for the entire file
crates/ty_ide/src/semantic_tokens.rs:4710
↓ 90 callers
Function
system_path_to_file
(db: &dyn Db, path: impl AsRef<SystemPath>)
crates/ruff_db/src/files.rs:37
↓ 89 callers
Method
args
(mut self, args: impl IntoIterator<Item = &'a str>)
crates/ruff/tests/integration_test.rs:66
↓ 89 callers
Method
len
(&self)
crates/ruff_linter/src/rules/pydocstyle/settings.rs:157
↓ 89 callers
Method
open_text_document
Send a `textDocument/didOpen` notification
crates/ty_server/tests/e2e/main.rs:808
↓ 89 callers
Method
seen_module
Return `true` if the [`Module`] was "seen" anywhere in the semantic model. This is used as a fast path to avoid unnecessary work when resolving symbol
crates/ruff_python_semantic/src/model.rs:1712
↓ 89 callers
Method
set_primary_message
Set the message on the primary annotation for this diagnostic. If a message already exists on the primary annotation, then this overwrites the existi
crates/ty_python_semantic/src/types/context.rs:285
↓ 88 callers
Method
all
Creates a new rule selection from all known lints in the registry, including lints that are default by default. Lints that are disabled by default use
crates/ty_python_semantic/src/lint.rs:559
↓ 87 callers
Method
build
Generate a [`Command`] for the `ruff check` command.
crates/ruff/tests/integration_test.rs:72
↓ 87 callers
Method
first
(self)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:1135
↓ 87 callers
Function
semantic_index
(db: &dyn Db, file: File)
crates/ty_python_core/src/lib.rs:70
↓ 86 callers
Method
as_str
Returns a human-readable name for this variance, matching the keyword argument names used in `TypeVar(covariant=True)` / `TypeVar(contravariant=True)`
crates/ty_python_semantic/src/types/variance.rs:105
↓ 86 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/flake8_pyi/rules/mod.rs:107
↓ 86 callers
Method
len
(&self)
crates/ruff_python_ast/src/nodes.rs:206
↓ 86 callers
Method
range
(&self)
crates/ruff_linter/src/rules/pylint/rules/non_slot_assignment.rs:96
↓ 85 callers
Method
expr
Returns the expression contained in this parsed output.
crates/ruff_python_parser/src/lib.rs:540
↓ 85 callers
Method
to_instance
(self, db: &dyn Db)
crates/ty_python_semantic/src/types/class/known.rs:1009
↓ 84 callers
Method
is_enabled
(self)
crates/ruff_linter/src/settings/flags.rs:15
↓ 84 callers
Method
is_rule_enabled
(&self, rule: Rule)
crates/ruff_linter/src/checkers/ast/mod.rs:552
↓ 83 callers
Method
clone
(this: &Self)
crates/ty_server/src/session/request_queue.rs:153
↓ 83 callers
Method
range
(&self)
crates/ruff_linter/src/rules/ruff/rules/sequence_sorting.rs:533
↓ 83 callers
Method
to_str
Returns the concatenated string value as a [`str`]. Note that this will perform an allocation on the first invocation if the string value is implicit
crates/ruff_python_ast/src/nodes.rs:1448
↓ 82 callers
Method
ends_with
(&self, child: impl AsRef<SystemPath>)
crates/ruff_db/src/system/path.rs:145
↓ 82 callers
Method
kind
(self)
crates/ty_python_semantic/src/types/literal.rs:175
↓ 82 callers
Method
node_range
(&self, start: TextSize)
crates/ruff_python_parser/src/parser/mod.rs:264
↓ 82 callers
Method
start
(&self)
crates/ty_ide/src/importer.rs:503
↓ 82 callers
Method
value
(self)
crates/ty_python_semantic/src/types/typevar.rs:697
↓ 81 callers
Method
infer_expression
(&mut self, expression: &ast::Expr, tcx: TypeContext<'db>)
crates/ty_python_semantic/src/types/infer/builder.rs:5256
↓ 81 callers
Method
is_empty
(&self)
crates/ty_python_semantic/src/types/diagnostic.rs:1323
↓ 80 callers
Method
find
Recognizes the beginning of a fenced code block if one is present on the given line.
crates/ty_ide/src/docstring/document/preformatted.rs:19
↓ 80 callers
Method
flatten
Flattens the hierarchical binary expression into a flat operand, operator, operand... sequence. See [`FlatBinaryExpressionSlice`] for an in depth exp
crates/ruff_python_formatter/src/expression/binary_like.rs:34
↓ 80 callers
Method
match_builtin_expr
Return `true` if `expr` is a reference to `builtins.$target`, i.e. either `object` (where `object` is not overridden in the global scope), or `builtin
crates/ruff_python_semantic/src/model.rs:405
↓ 79 callers
Method
as_name_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2680
↓ 78 callers
Method
get
Returns the type that a typevar is mapped to, or None if the typevar isn't part of this mapping.
crates/ty_python_semantic/src/types/generics.rs:1215
↓ 78 callers
Method
title
(self, title: &str)
crates/ruff_annotate_snippets/src/snippet.rs:190
↓ 77 callers
Method
find_keyword
Return the [`Keyword`] with the given name, or `None` if no such [`Keyword`] exists.
crates/ruff_python_ast/src/nodes.rs:3556
↓ 76 callers
Method
message
(&self)
crates/ty_wasm/src/lib.rs:897
↓ 76 callers
Function
open
()
crates/ruff_linter/resources/test/fixtures/flake8_async/ASYNC230.py:75
↓ 75 callers
Method
generator
Create a [`Generator`] to generate source code based on the current AST state.
crates/ruff_linter/src/checkers/ast/mod.rs:337
↓ 75 callers
Method
intersects
Returns `true` if the given range intersects with any comment range.
crates/ruff_python_trivia/src/comment_ranges.rs:79
↓ 75 callers
Function
parse_suite
(source: &str)
crates/ruff_python_parser/src/string.rs:544
↓ 75 callers
Function
plain
(a: T, b: T)
crates/ruff_python_formatter/resources/test/fixtures/black/cases/generics_wrapping.py:1
↓ 75 callers
Function
write
( output: &mut dyn Buffer<Context = Context>, args: Arguments<Context>, )
crates/ruff_formatter/src/lib.rs:859
↓ 74 callers
Method
memory_file_system
Returns the memory file system. ## Panics If the underlying test system isn't the [`InMemorySystem`].
crates/ruff_db/src/system/test.rs:79
↓ 74 callers
Function
str
(s)
crates/ruff_linter/resources/test/fixtures/ruff/RUF065_0.py:37
↓ 73 callers
Method
class_literal
Returns the underlying class literal for this class, ignoring any specialization. For a non-generic class, this returns the class literal directly. F
crates/ty_python_semantic/src/types/class.rs:1050
↓ 73 callers
Method
fold
Hide lines without [`Annotation`]s
crates/ruff_annotate_snippets/src/snippet.rs:139
↓ 73 callers
Method
saturating_sub
(self, rhs: TextSize)
crates/ruff_text_size/src/size.rs:123
↓ 73 callers
Function
source_text
(db: &dyn Db, file: File)
crates/ruff_db/src/source.rs:16
↓ 72 callers
Method
iter
(&self)
crates/ty_python_core/src/place.rs:333
↓ 71 callers
Method
bump
Bumps the current token assuming it is of the given kind. # Panics If the current token is not of the given kind.
crates/ruff_python_parser/src/parser/mod.rs:389
↓ 71 callers
Method
find
(&self, policy: &NameMatchPolicy)
crates/ruff_linter/src/rules/flake8_tidy_imports/settings.rs:152
↓ 71 callers
Method
snippet
(mut self, slice: Snippet<'a>)
crates/ruff_annotate_snippets/src/snippet.rs:46
↓ 71 callers
Method
write_file
Writes a file to the test directory. Parent directories are created automatically if they don't exist. Content is dedented to remove common leading w
crates/ruff/tests/cli/main.rs:148
↓ 70 callers
Method
contents
The contents of the docstring, including the opening and closing quotes.
crates/ruff_linter/src/docstrings/mod.rs:30
↓ 70 callers
Method
find_argument_value
Return the value for the argument with the given name or at the given position, or `None` if no such argument exists. Used to retrieve argument values
crates/ruff_python_ast/src/nodes.rs:3574
↓ 70 callers
Method
join
(&self, component: &str)
crates/ty_module_resolver/src/path.rs:904
↓ 69 callers
Method
add_error
(&mut self, error: ParseErrorType, ranged: T)
crates/ruff_python_parser/src/parser/mod.rs:597
↓ 68 callers
Function
assert_lexed_ranges_match_slices
( directive: Result<Option<NoqaLexerOutput>, LexicalError>, source: &str, )
crates/ruff_linter/src/noqa.rs:1471
↓ 68 callers
Method
find
Returns the [`ParameterWithDefault`] with the given name, or `None` if no such [`ParameterWithDefault`] exists.
crates/ruff_python_ast/src/nodes.rs:3140
↓ 68 callers
Method
has_builtin_binding
Return `true` if `member` is bound as a builtin *in the scope we are currently visiting*. Note that a "builtin binding" does *not* include explicit l
crates/ruff_python_semantic/src/model.rs:357
↓ 68 callers
Method
is_assignable_to
Return true if this type is assignable to type `target`. See `TypeRelation::Assignability` for more details.
crates/ty_python_semantic/src/types/relation.rs:361
↓ 68 callers
Method
is_stub
Returns `true` if the file should be analyzed as a type stub.
crates/ruff_db/src/files.rs:544
↓ 68 callers
Function
list
(*args, **kwargs)
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C400.py:31
↓ 68 callers
Method
read
(system: &dyn System, root: &SystemPath)
crates/ty_project/src/db/ignore.rs:118
↓ 67 callers
Method
as_str
(self)
crates/ruff_linter/src/rules/pylint/rules/if_stmt_min_max.rs:206
↓ 67 callers
Method
current_scope
Returns the current top-most [`Scope`].
crates/ruff_python_semantic/src/model.rs:1539
↓ 67 callers
Method
target_version
Return the [`PythonVersion`] to use for version-related lint rules. If the user did not provide a target version, this defaults to the lowest support
crates/ruff_linter/src/checkers/ast/mod.rs:622
↓ 67 callers
Method
value_type
(self, db: &'db dyn Db, name: &Name)
crates/ty_python_semantic/src/types/enums.rs:390
↓ 66 callers
Method
build
(self)
crates/ty_python_semantic/src/types/tuple.rs:2636
↓ 66 callers
Method
insert
(&mut self, key: K, value: V)
crates/ty_python_semantic/src/types/infer/builder.rs:11034
↓ 66 callers
Function
set
(*args, **kwargs)
crates/ruff_linter/resources/test/fixtures/flake8_comprehensions/C401.py:49
↓ 66 callers
Method
symbol_id
Returns the [`ScopedSymbolId`] of the place named `name`.
crates/ty_python_core/src/place.rs:242
↓ 65 callers
Method
name
(self, db: &dyn Db)
crates/ty_python_semantic/src/types/class/known.rs:859
↓ 65 callers
Method
starts_with
(&self, other: &ModuleName)
crates/ty_module_resolver/src/module_name.rs:154
↓ 64 callers
Method
as_call_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2236
↓ 64 callers
Method
as_str
(self)
crates/ty_ide/src/completion.rs:684
↓ 64 callers
Method
is_empty
(&self)
crates/ruff_python_formatter/src/statement/stmt_assign.rs:1191
↓ 64 callers
Method
match_typing_expr
Return `true` if the `Expr` is a reference to `typing.${target}`.
crates/ruff_python_semantic/src/model.rs:241
↓ 64 callers
Method
span
Create a [`Annotation`] with the given span for a [`Snippet`]
crates/ruff_annotate_snippets/src/snippet.rs:203
↓ 64 callers
Method
stylist
The [`Stylist`] for the current file, which detects the current line ending, quote, and indentation style.
crates/ruff_linter/src/checkers/ast/mod.rs:509
↓ 63 callers
Method
annotation
(mut self, annotation: Annotation<'a>)
crates/ruff_annotate_snippets/src/snippet.rs:128
↓ 63 callers
Method
completion_test_builder
(&self)
crates/ty_ide/src/completion.rs:10959
↓ 63 callers
Method
node_start
Returns the start position for a node that starts at the current token.
crates/ruff_python_parser/src/parser/mod.rs:260
↓ 63 callers
Method
not_contains
(&self, unexpected: &str)
crates/ty_ide/src/completion.rs:10941
↓ 63 callers
Function
parenthesized_range
Returns the [`TextRange`] of a given expression including parentheses, if the expression is parenthesized; or `None`, if the expression is not parenth
crates/ruff_python_ast/src/parenthesize.rs:64
← previous
next →
101–200 of 27,349, ranked by callers