Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,766 in github.com/astral-sh/ruff
⨍
Functions
31,766
◇
Types & classes
7,128
↳
Endpoints
82
↓ 24 callers
Method
contains
Return `true` if the given version is required.
crates/ruff_linter/src/settings/types.rs:643
↓ 24 callers
Function
create_dir
Helper function to create a directory and all parent directories
crates/ruff_linter/src/rules/isort/categorize.rs:448
↓ 24 callers
Method
default_type
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/typevar.rs:411
↓ 24 callers
Method
eat_while
(&mut self, mut predicate: impl FnMut(char) -> bool)
crates/ruff_python_trivia/src/cursor.rs:163
↓ 24 callers
Method
extend
(&mut self, it: T)
crates/ty_ide/src/completion.rs:296
↓ 24 callers
Method
files
(&self)
crates/mdtest/src/parser.rs:147
↓ 24 callers
Method
interior_node_data
(&self, node: NodeId)
crates/ty_python_semantic/src/types/constraints.rs:1439
↓ 24 callers
Method
into_iter
(self)
crates/ruff_linter/src/rules/flake8_tidy_imports/rules/banned_module_level_imports.rs:117
↓ 24 callers
Method
is_end_of_line
(self)
crates/ruff_python_trivia/src/comments.rs:101
↓ 24 callers
Method
is_file
(self)
crates/ruff_db/src/system.rs:334
↓ 24 callers
Method
is_unknown
(&self)
crates/ty_python_semantic/src/types.rs:2555
↓ 24 callers
Method
isolate
(mut self, isolation: IsolationLevel)
crates/ruff_diagnostics/src/fix.rs:169
↓ 24 callers
Method
known
Create a [`NamedTupleSpec`] with the given fields.
crates/ty_python_semantic/src/types/class/named_tuple.rs:587
↓ 24 callers
Method
line_start
(&self, line: OneIndexed)
crates/ruff_source_file/src/lib.rs:63
↓ 24 callers
Method
matching_overloads
Returns an iterator over all the overloads that matched for this call binding.
crates/ty_python_semantic/src/types/call/bind.rs:4661
↓ 24 callers
Method
name
(&self)
crates/ty_python_semantic/src/lint.rs:94
↓ 24 callers
Method
openness
Returns whether this `TypedDict` is implicitly open, closed, or has explicit extra items. A class-based `TypedDict` inherits the first explicit polic
crates/ty_python_semantic/src/types/typed_dict.rs:272
↓ 24 callers
Method
options
(&self)
crates/ruff_python_formatter/src/context.rs:134
↓ 24 callers
Method
paramspec_attr
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:1088
↓ 24 callers
Method
path
(&self)
crates/ruff_db/src/system.rs:362
↓ 24 callers
Method
prefix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1225
↓ 24 callers
Method
program_environment
(&self)
crates/ty_python_semantic/src/types/generics.rs:782
↓ 24 callers
Method
program_file
(&self)
crates/ty_python_semantic/src/types/dedicated/pytest/collection.rs:1204
↓ 24 callers
Method
push
(&mut self, bindings: &Bindings)
crates/ty_python_core/src/use_def.rs:503
↓ 24 callers
Method
range
(&self)
crates/ruff_python_parser/src/parser/expression.rs:3075
↓ 24 callers
Method
references
( self, semantic: &'a SemanticModel<'a>, )
crates/ruff_linter/src/rules/flake8_pyi/rules/custom_type_var_for_self.rs:487
↓ 24 callers
Function
resolve_module
Resolves a module name to a module.
crates/ty_module_resolver/src/resolve.rs:65
↓ 24 callers
Method
scope
Returns the scope in which this dynamic `TypedDict` was created.
crates/ty_python_semantic/src/types/class/typed_dict.rs:941
↓ 24 callers
Method
skip_keywords
When set, keywords from completions are skipped. This is useful in tests to reduce noise for scope based completions. Not enabled by default. Note t
crates/ty_ide/src/completion.rs:11724
↓ 24 callers
Method
source
(&self)
crates/ruff_linter/src/rules/flake8_pytest_style/settings.rs:110
↓ 24 callers
Method
take_salsa_events
Takes the salsa events.
crates/ty_python_semantic/src/db.rs:119
↓ 24 callers
Function
test_contents
A convenient wrapper around [`check_path`], that additionally asserts that fixes converge after a fixed number of iterations.
crates/ruff_linter/src/test.rs:244
↓ 24 callers
Method
to_type
(&self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/callable.rs:1154
↓ 24 callers
Method
uv_environments
(&self)
crates/ty_project/src/db.rs:709
↓ 24 callers
Method
write_files_all
Writes the files to the file system. The operation overrides existing files with the same normalized path. Enclosing directories are automatically c
crates/ruff_db/src/system/memory_fs.rs:212
↓ 23 callers
Function
absolute
(path: &str)
crates/ty_project/src/uv/metadata/dependencies.rs:350
↓ 23 callers
Method
add_python_cell
(&mut self, content: &str)
crates/ty_server/tests/e2e/notebook.rs:809
↓ 23 callers
Method
apply_optional_specialization
( self, db: &'db dyn Db, specialization: Option<Specialization<'db>>, )
crates/ty_python_semantic/src/types/class/static_literal.rs:646
↓ 23 callers
Method
as_function
(&self)
crates/ty_python_core/src/scope.rs:426
↓ 23 callers
Method
as_tuple_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2754
↓ 23 callers
Function
bool
()
crates/ruff_linter/resources/test/fixtures/flake8_simplify/SIM210.py:12
↓ 23 callers
Method
build
(self)
crates/ty_python_semantic/src/db.rs:290
↓ 23 callers
Method
context
Returns the context used during formatting.
crates/ruff_formatter/src/lib.rs:305
↓ 23 callers
Method
db
Returns the underlying test DB.
crates/ty_ide/src/completion.rs:11672
↓ 23 callers
Method
file_name
(&self)
crates/ruff_db/src/system/path.rs:279
↓ 23 callers
Function
foo
()
crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B031.py:188
↓ 23 callers
Method
func
(self)
crates/ruff_linter/resources/test/fixtures/pyflakes/F811_26.py:2
↓ 23 callers
Method
get
(&self, name: &str)
crates/ruff_db/src/system/command.rs:122
↓ 23 callers
Method
info
(self, message)
crates/ruff_linter/resources/test/fixtures/mccabe/C901.py:132
↓ 23 callers
Method
is_disjoint_from
Returns whether these literal types are known to have no value in common.
crates/ty_python_semantic/src/types/literal.rs:190
↓ 23 callers
Method
is_lint_enabled
(&self, lint: &'static LintMetadata)
crates/ty_python_semantic/src/types/context.rs:319
↓ 23 callers
Method
is_match
(&self, banned_module: &str)
crates/ruff_linter/src/rules/flake8_tidy_imports/matchers.rs:10
↓ 23 callers
Function
is_python_whitespace
Returns `true` for [whitespace](https://docs.python.org/3/reference/lexical_analysis.html#whitespace-between-tokens) characters.
crates/ruff_python_trivia/src/whitespace.rs:84
↓ 23 callers
Method
is_self
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/typevar.rs:332
↓ 23 callers
Method
is_string_literal_expr
(&self)
crates/ruff_python_ast/src/generated.rs:2318
↓ 23 callers
Method
iter_positive
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/set_theoretic.rs:1496
↓ 23 callers
Method
leading
(&self, node: T)
crates/ruff_python_formatter/src/comments/mod.rs:299
↓ 23 callers
Method
load
Loads a reference to the parsed module. Note that holding on to the reference will prevent garbage collection of the AST. This method will reparse th
crates/ruff_db/src/parsed.rs:139
↓ 23 callers
Method
match_typing_qualified_name
Return `true` if the call path is a reference to `typing.${target}`.
crates/ruff_python_semantic/src/model.rs:281
↓ 23 callers
Method
member_lookup_with_policy
Similar to [`Type::member`], but allows the caller to specify what policy should be used when looking up attributes. See [`MemberLookupPolicy`] for mo
crates/ty_python_semantic/src/types.rs:6032
↓ 23 callers
Method
skip_auto_import
When set, symbols that aren't in scope but available in the environment will NOT be included. Auto-import is enabled by default. So one must opt into
crates/ty_ide/src/completion.rs:11687
↓ 23 callers
Method
source
(&self)
crates/ruff_linter/src/rules/isort/settings.rs:204
↓ 23 callers
Method
sub
Adds a "sub" diagnostic to this diagnostic. This is useful when a sub diagnostic has its own annotations attached to it. For the simpler case of a su
crates/ruff_db/src/diagnostic/mod.rs:202
↓ 23 callers
Method
suffix_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1236
↓ 23 callers
Method
uri
(&self)
crates/ty_server/src/document/notebook.rs:65
↓ 23 callers
Method
write_file
( &self, path: impl AsRef<SystemPath>, content: impl AsRef<str>, )
crates/ty_server/tests/e2e/main.rs:860
↓ 22 callers
Method
add_primary_tag
Adds a tag on the primary annotation for this diagnostic. This tag is associated with the primary annotation created for every `Diagnostic` that uses
crates/ruff_linter/src/checkers/ast/mod.rs:3883
↓ 22 callers
Method
annotation
( self, db: &'db dyn Db, env: &ProgramEnvironment<'db>, )
crates/ty_python_semantic/src/types/protocol_class.rs:1394
↓ 22 callers
Method
as_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/typevar.rs:2318
↓ 22 callers
Method
bases
Return an iterator over the bases of the class.
crates/ruff_python_ast/src/nodes.rs:34
↓ 22 callers
Method
class_specialization
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:1306
↓ 22 callers
Method
contains
(self, offset: TextSize)
crates/ruff_text_size/src/range.rs:165
↓ 22 callers
Method
encoding
Returns the position encoding that was negotiated during initialization.
crates/ty_server/src/session.rs:1581
↓ 22 callers
Method
get
(&self, index: usize)
crates/ty_python_core/src/frozen.rs:29
↓ 22 callers
Method
is_ascii
Returns `true` if the text only consists of ASCII characters
crates/ruff_source_file/src/line_index.rs:227
↓ 22 callers
Method
is_file
(self)
crates/ty_project/src/watch.rs:191
↓ 22 callers
Function
is_identifier
Returns `true` if a string is a valid Python identifier (e.g., variable name).
crates/ruff_python_stdlib/src/identifiers.rs:7
↓ 22 callers
Method
is_known
Returns whether this is a known class.
crates/ty_python_semantic/src/types/class.rs:804
↓ 22 callers
Method
iter_all_elements
(&self)
crates/ty_python_semantic/src/types/tuple.rs:999
↓ 22 callers
Method
len
Length of this annotation as displayed in the stderr output
crates/ruff_annotate_snippets/src/renderer/render.rs:2503
↓ 22 callers
Method
len
(&self)
crates/ruff_db/src/parsed.rs:541
↓ 22 callers
Method
next
(&mut self)
crates/ruff_python_formatter/src/comments/map.rs:575
↓ 22 callers
Method
or
(self, other: Self)
crates/ty_python_core/src/lib.rs:1082
↓ 22 callers
Function
pad
Add leading or trailing whitespace to a snippet, if it's immediately preceded or followed by an identifier or keyword.
crates/ruff_linter/src/fix/edits.rs:628
↓ 22 callers
Function
parse_unchecked
Parse the given Python source code using the specified [`ParseOptions`]. This is same as the [`parse`] function except that it doesn't check for any
crates/ruff_python_parser/src/lib.rs:289
↓ 22 callers
Function
predicate
(index: usize)
crates/ty_python_core/src/narrowing_constraints.rs:457
↓ 22 callers
Method
python_file
(&self)
crates/ty_python_semantic/src/semantic_model.rs:74
↓ 22 callers
Method
query
(&self)
crates/ruff_server/src/session.rs:249
↓ 22 callers
Method
report_context
If error context collection is enabled, returns the current error context tree. You will typically use [`push`][ErrorContextTree::push] to add additio
crates/ty_python_semantic/src/types/relation.rs:1887
↓ 22 callers
Method
source
(&self)
crates/ruff_linter/src/rules/pep8_naming/settings.rs:63
↓ 22 callers
Method
to_lsp_range
( &self, db: &dyn Db, file: File, encoding: PositionEncoding, )
crates/ty_server/src/document/range.rs:306
↓ 22 callers
Method
try_call_dunder
Look up a dunder method on the meta-type of `self` and call it. Returns an `Err` if the dunder method can't be called, or the given arguments are not
crates/ty_python_semantic/src/types.rs:8477
↓ 22 callers
Method
try_to_class_literal
Look up a [`KnownClass`] in its canonical module and return a [`Type`] representing that class literal. If the class cannot be found, a debug-level l
crates/ty_python_semantic/src/types/class/known.rs:1449
↓ 22 callers
Method
with_preview_mode
(mut self)
crates/ruff_linter/src/settings/mod.rs:862
↓ 21 callers
Method
as_symbol
Returns `Some` if the reference is a `Symbol`, otherwise `None`.
crates/ty_python_core/src/place.rs:112
↓ 21 callers
Function
assert_function_query_was_not_run
( db: &Db, query: Q, input: I, events: &[salsa::Event], )
crates/ruff_db/src/testing.rs:6
↓ 21 callers
Method
change_text_document
Send a `textDocument/didChange` notification with the given content changes
crates/ty_server/tests/e2e/main.rs:909
↓ 21 callers
Method
codegen_stylist
(&self, stylist: &'a Stylist)
crates/ruff_linter/src/fix/codemods.rs:28
↓ 21 callers
Function
create_diagnostics
Create Ruff-style diagnostics for testing the various output formats.
crates/ruff_db/src/diagnostic/render.rs:2968
↓ 21 callers
Method
default_specialization
Returns the default specialization for this class. For static classes, this applies default type arguments. For dynamic classes, this returns a non-g
crates/ty_python_semantic/src/types/class.rs:812
← previous
next →
701–800 of 31,766, ranked by callers