MCPcopy Create free account

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

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

↓ 1 callersFunctiontodos
( context: &LintContext, todo_comments: &[TodoComment], locator: &Locator, comment_ranges: &Co
crates/ruff_linter/src/rules/flake8_todos/rules/todos.rs:259
↓ 1 callersMethodtoken_kind
(self)
crates/ty_ide/src/completion.rs:781
↓ 1 callersMethodtoken_len
Returns the length of the current token length. This is to be used after setting the start position of the token using [`Cursor::start_token`].
crates/ruff_python_parser/src/lexer/cursor.rs:74
↓ 1 callersFunctiontoken_suffix_by_kinds
Returns a suffix of `tokens` corresponding to the `kinds` given. If a suffix of `tokens` with the given `kinds` could not be found, then `None` is re
crates/ty_ide/src/completion.rs:3268
↓ 1 callersMethodtokenize_reverse
(&self)
crates/ruff_python_trivia_integration_tests/tests/simple_tokenizer.rs:24
↓ 1 callersFunctiontokens_start_before
Returns a slice of tokens that all start before the given [`TextSize`] offset. If the given offset is between two tokens, the returned slice will end
crates/ty_ide/src/completion.rs:3255
↓ 1 callersFunctiontomllib_path
(file: &TestFile)
crates/ruff_benchmark/benches/ty.rs:75
↓ 1 callersFunctiontoo_many_arguments
PLR0913
crates/ruff_linter/src/rules/pylint/rules/too_many_arguments.rs:76
↓ 1 callersFunctiontoo_many_boolean_expressions
PLR0916
crates/ruff_linter/src/rules/pylint/rules/too_many_boolean_expressions.rs:48
↓ 1 callersFunctiontoo_many_branches
PLR0912
crates/ruff_linter/src/rules/pylint/rules/too_many_branches.rs:239
↓ 1 callersFunctiontoo_many_locals
PLR0914
crates/ruff_linter/src/rules/pylint/rules/too_many_locals.rs:42
↓ 1 callersFunctiontoo_many_nested_blocks
PLR1702
crates/ruff_linter/src/rules/pylint/rules/too_many_nested_blocks.rs:41
↓ 1 callersFunctiontoo_many_newlines_at_end_of_file
W391
crates/ruff_linter/src/rules/pycodestyle/rules/too_many_newlines_at_end_of_file.rs:62
↓ 1 callersFunctiontoo_many_positional_arguments
PLR0917
crates/ruff_linter/src/rules/pylint/rules/too_many_positional_arguments.rs:74
↓ 1 callersFunctiontoo_many_public_methods
PLR0904
crates/ruff_linter/src/rules/pylint/rules/too_many_public_methods.rs:105
↓ 1 callersFunctiontoo_many_return_statements
PLR0911
crates/ruff_linter/src/rules/pylint/rules/too_many_return_statements.rs:81
↓ 1 callersFunctiontoo_many_statements
PLR0915
crates/ruff_linter/src/rules/pylint/rules/too_many_statements.rs:71
↓ 1 callersFunctiontoo_many_try_statements
W0717
crates/ruff_linter/src/rules/pylint/rules/too_many_try_statements.rs:91
↓ 1 callersMethodtop
Returns the [`PrintElementArgs`] for the current stack frame.
crates/ruff_formatter/src/printer/call_stack.rs:162
↓ 1 callersFunctiontop_level_imports
(db: &dyn Db, file: PythonFile<'_>)
crates/ty_python_semantic/src/importer.rs:514
↓ 1 callersMethodtop_with_interned
(&self)
crates/ruff_formatter/src/printer/queue.rs:91
↓ 1 callersMethodtotal_added_fixes
(self)
python/ruff-ecosystem/ruff_ecosystem/check.py:327
↓ 1 callersMethodtotal_added_violations
(self)
python/ruff-ecosystem/ruff_ecosystem/check.py:321
↓ 1 callersMethodtotal_changes_by_rule
Yields the sum of changes for each rule
python/ruff-ecosystem/ruff_ecosystem/check.py:333
↓ 1 callersMethodtotal_removed_fixes
(self)
python/ruff-ecosystem/ruff_ecosystem/check.py:330
↓ 1 callersMethodtotal_removed_violations
(self)
python/ruff-ecosystem/ruff_ecosystem/check.py:324
↓ 1 callersMethodtrack_import
(&mut self, stmt: &'a Stmt)
crates/ruff_linter/src/rules/isort/block.rs:58
↓ 1 callersMethodtrailer_for
(&self, stmt: &'a Stmt)
crates/ruff_linter/src/rules/isort/block.rs:64
↓ 1 callersFunctiontrailing_comma
Return `true` if a `Stmt::ImportFrom` statement ends with a magic trailing comma.
crates/ruff_linter/src/rules/isort/helpers.rs:12
↓ 1 callersFunctiontrailing_comma
Given an element in a list, return the comma that follows it: ```python @pytest.mark.parametrize( "x", [.., (elt), ..], ^^^^^ Tokenize this range to l
crates/ruff_linter/src/rules/flake8_pytest_style/rules/parametrize.rs:649
↓ 1 callersFunctiontrailing_commas
COM812, COM818, COM819
crates/ruff_linter/src/rules/flake8_commas/rules/trailing_commas.rs:254
↓ 1 callersMethodtrailing_comment_range
Find the relevant range to cover for trailing end-of-line suppression comments When placed on a single line statement, or "inside" of a logical line,
crates/ruff_linter/src/suppression.rs:1150
↓ 1 callersFunctiontrailing_end_of_line_comment
A helper that constructs a formattable element using a reserved-width line-suffix for normalized comments. Black normalization of `SourceComment`. Li
crates/ruff_python_formatter/src/comments/format.rs:363
↓ 1 callersFunctiontrailing_lines_end
Return the end offset at which the empty lines following a statement.
crates/ruff_python_ast/src/whitespace.rs:17
↓ 1 callersFunctiontrailing_semicolon
Return the location of a trailing semicolon following a `Stmt`, if it's part of a multi-statement line.
crates/ruff_linter/src/fix/edits.rs:543
↓ 1 callersFunctiontrailing_whitespace
W291, W293
crates/ruff_linter/src/rules/pycodestyle/rules/trailing_whitespace.rs:89
↓ 1 callersFunctiontrain_ruff
( binary: Path, corpus_arguments: Path, profile_directory: Path, *, corpus_size: int,
scripts/build_ruff_pgo.py:271
↓ 1 callersMethodtransform
(&self, mut configuration: Configuration)
crates/ruff/src/resolve.rs:89
↓ 1 callersMethodtransform
(&self, config: Configuration)
crates/ruff_workspace/src/resolver.rs:1021
↓ 1 callersFunctiontransform_expression_text
Like [`transform_expression`], but operates on the source code of the expression, rather than the parsed [`Expression`]. This _shouldn't_ exist, but d
crates/ruff_linter/src/cst/matchers.rs:267
↓ 1 callersMethodtransition_after_attribute
(self)
crates/ruff_python_formatter/src/expression/mod.rs:947
↓ 1 callersFunctiontraverse_body
(checker: &Checker, body: &[Stmt])
crates/ruff_linter/src/rules/pylint/rules/continue_in_finally.rs:51
↓ 1 callersFunctiontraverse_op
Collect all string members in possibly-nested binary `|` expressions.
crates/ruff_linter/src/rules/flake8_type_checking/rules/runtime_string_union.rs:87
↓ 1 callersMethodtreats_fields_as_instance_attributes
Return `true` if field declarations should be treated as instance attributes. For example, a bare annotation in a dataclass body is seen as evidence
crates/ty_python_semantic/src/types/class.rs:352
↓ 1 callersMethodtrim_indent
(self, ranged: impl Ranged, source: &str)
crates/ruff_python_formatter/src/verbatim.rs:699
↓ 1 callersFunctiontrim_lines
(s: &str)
crates/ruff_dev/src/generate_cli_help.rs:29
↓ 1 callersFunctiontrim_trailing_none
Trim trailing `None` literals from the given elements. For example, given `[int, None, None]`, return `[int]`.
crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs:149
↓ 1 callersMethodtrim_trivial_replacements
Try to turn a replacement into an addition when the span that is being overwritten matches either the prefix or suffix of the replacement.
crates/ruff_annotate_snippets/src/snippet.rs:486
↓ 1 callersMethodtrim_unnecessary_defaults
Trim any unnecessary default type arguments from the given elements.
crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs:191
↓ 1 callersFunctiontriple_quotes
D300
crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs:77
↓ 1 callersMethodtruthiness
Return `None` only when comparison behavior is custom or otherwise unmodeled.
crates/ty_python_semantic/src/types/equality/enums.rs:294
↓ 1 callersMethodtruthiness_implied_by
Determine whether a redundant-condition diagnostic can also explain why some code is unreachable. The expression we warn about can be just one subexp
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:283
↓ 1 callersMethodtruthiness_test_of_callable_candidate
( &self, expanded_type: ExpandedType<'db>, )
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:833
↓ 1 callersMethodtruthiness_test_of_none_union_candidate
Return the union corresponding to `expanded_type` if this test is eligible for `truthiness-test-of-none-union`.
crates/ty_python_semantic/src/types/infer/builder/suspicious_conditions/mod.rs:757
↓ 1 callersMethodtry_add
Tries to add a new root for `path` and returns the root. The root isn't added nor is the file root's kind updated if a root for `path` already exists
crates/ruff_db/src/files/file_root.rs:58
↓ 1 callersFunctiontry_apply_markdown_edits
( absolute_fixture_path: &Utf8Path, source: &str, mut edits: Vec<MarkdownEdit>, )
crates/mdtest/src/lib.rs:508
↓ 1 callersFunctiontry_block_contains_undeprecated_attribute
Given an [`ast::StmtTry`] node, does the `try` branch of that node contain any [`ast::ExprAttribute`] nodes that indicate the airflow member is being
crates/ruff_linter/src/rules/airflow/helpers.rs:136
↓ 1 callersFunctiontry_block_contains_undeprecated_attribute
Given an [`ast::StmtTry`] node, does the `try` branch of that node contain any [`ast::ExprAttribute`] nodes that indicate the numpy member is being ac
crates/ruff_linter/src/rules/numpy/rules/numpy_2_0_deprecation.rs:809
↓ 1 callersFunctiontry_block_contains_undeprecated_import
Given an [`ast::StmtTry`] node, does the `try` branch of that node contain any [`ast::StmtImportFrom`] nodes that indicate the airflow member is being
crates/ruff_linter/src/rules/airflow/helpers.rs:158
↓ 1 callersFunctiontry_block_contains_undeprecated_import
Given an [`ast::StmtTry`] node, does the `try` branch of that node contain any [`ast::StmtImportFrom`] nodes that indicate the numpy member is being i
crates/ruff_linter/src/rules/numpy/rules/numpy_2_0_deprecation.rs:838
↓ 1 callersMethodtry_call_dunder_get_on_attribute
Look up `__get__` on the meta-type of `attribute`, and call it with `attribute`, `instance`, and `owner` as arguments. This method exists as a separat
crates/ty_python_semantic/src/types.rs:5344
↓ 1 callersMethodtry_call_dunder_on_class
Attempt to call a dunder method defined on a class itself. This is used for methods like `__class_getitem__` which are implicitly called when subscri
crates/ty_python_semantic/src/types.rs:8525
↓ 1 callersMethodtry_call_unary_dunder
Call a unary operator's dunder, retaining the original receiver when evaluating a bound.
crates/ty_python_semantic/src/types.rs:8372
↓ 1 callersMethodtry_check_nominal_protocol_cycle
Try a nominal proof when a materialized recursive protocol changes specialization. A recursive child can stabilize at a specialization that relates n
crates/ty_python_semantic/src/types/instance.rs:1039
↓ 1 callersMethodtry_check_nominal_recursive_protocol_members
Avoid recursive requirements that cannot add solutions beyond explicit inheritance.
crates/ty_python_semantic/src/types/instance.rs:1074
↓ 1 callersMethodtry_check_non_recursive_protocol_members
Tries to relate specializations of the same protocol using only non-recursive members. In this example, `value` can be checked without comparing anot
crates/ty_python_semantic/src/types/instance.rs:1193
↓ 1 callersFunctiontry_consider_else
TRY300
crates/ruff_linter/src/rules/tryceratops/rules/try_consider_else.rs:66
↓ 1 callersFunctiontry_construct_call
Try constructing the call to `itertools.starmap` and wrapping it with the given builtin.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs:284
↓ 1 callersFunctiontry_create_replacement
Generate a replacement, if possible.
crates/ruff_linter/src/rules/refurb/rules/fstring_number_format.rs:170
↓ 1 callersMethodtry_definition
( &self, definition_key: impl Into<DefinitionNodeKey>, )
crates/ty_python_core/src/lib.rs:731
↓ 1 callersMethodtry_definitions
Returns the [`definition::Definition`] salsa ingredient(s) for `definition_node`, if any.
crates/ty_python_core/src/lib.rs:697
↓ 1 callersMethodtry_double_char_prefix
Try lexing the double character string prefix, updating the token flags accordingly. Returns `true` if it matches.
crates/ruff_python_parser/src/lexer.rs:697
↓ 1 callersMethodtry_dunder_class
Compute the `__class__` type for class-backed protocols and `TypedDict` instances, whose runtime classes differ from their internal meta-types. Negat
crates/ty_python_semantic/src/types/set_theoretic.rs:1334
↓ 1 callersMethodtry_end_format_spec
Decrements the format spec depth if the current f-string is in a format spec.
crates/ruff_python_parser/src/lexer/interpolated_string.rs:116
↓ 1 callersFunctiontry_except_continue
S112
crates/ruff_linter/src/rules/flake8_bandit/rules/try_except_continue.rs:60
↓ 1 callersFunctiontry_except_in_loop
PERF203
crates/ruff_linter/src/rules/perflint/rules/try_except_in_loop.rs:92
↓ 1 callersFunctiontry_except_pass
S110
crates/ruff_linter/src/rules/flake8_bandit/rules/try_except_pass.rs:56
↓ 1 callersMethodtry_expression_type
(&self, expr: impl Into<ExpressionNodeKey>)
crates/ty_python_semantic/src/types/unpacker.rs:394
↓ 1 callersMethodtry_fix
Attempt to fix the function-like node by replacing it with a call to the corresponding function from `operator` module.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_operator.rs:199
↓ 1 callersFunctiontry_fix_legacy_call
( context_type: PytestContextType, stmt: &Stmt, semantic: &SemanticModel, )
crates/ruff_linter/src/rules/ruff/rules/legacy_form_pytest_raises.rs:182
↓ 1 callersMethodtry_fold_with
( &self, mut choose: impl FnMut( TypeVarVariance, &CandidateTypeVarSol
crates/ty_python_semantic/src/types/constraints/projection.rs:226
↓ 1 callersMethodtry_for_each_element_pair
Calls a closure for each pair of elements that could potentially be compared at runtime between `self` and `other`. For two fixed-length tuples, this
crates/ty_python_semantic/src/types/tuple.rs:2738
↓ 1 callersMethodtry_get_user_config_directory_override
Returns [`Ok`] if any override is set and [`Err`] otherwise.
crates/ruff_db/src/system/os.rs:497
↓ 1 callersMethodtry_infer_typed_dict_pep_584_augmented_assignment
Handle `TypedDict |= value` before the normal `__ior__` path runs. The normal path's bidirectional inference would report missing or unknown construc
crates/ty_python_semantic/src/types/infer/builder/binary_expressions.rs:351
↓ 1 callersMethodtry_make_suggestion
Try to produce a fix suggestion transforming this node into a call to `starmap`.
crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs:234
↓ 1 callersMethodtry_map
( self, db: &'db dyn Db, mut f: impl FnMut(Type<'db>) -> Option<Type<'db>>, )
crates/ty_python_semantic/src/types/method.rs:97
↓ 1 callersMethodtry_map_base_class_type
Create a new `NewType` by mapping the underlying `ClassType`. This descends through any number of nested `NewType` layers and rebuilds the whole chain
crates/ty_python_semantic/src/types/newtype.rs:134
↓ 1 callersMethodtry_metaclass
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/class/dynamic_literal.rs:287
↓ 1 callersMethodtry_module_getattr
Resolves a missing member through the module's `__getattr__` function. Invalid calls retain their declared return type for recovery while deferring t
crates/ty_python_semantic/src/types.rs:12655
↓ 1 callersMethodtry_mro
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class/dynamic_literal.rs:489
↓ 1 callersMethodtry_mro_ancestors_unspecialized
( self, db: &'db dyn Db, )
crates/ty_python_semantic/src/types/class/static_literal.rs:975
↓ 1 callersMethodtry_narrow_dict_kwargs
Attempt to narrow a splatted dictionary argument based on the narrowed types of individual keys, if any. Returns the intersection between the diction
crates/ty_python_semantic/src/types/infer/builder.rs:9256
↓ 1 callersMethodtry_parse_match_statement
Try parsing a `match` statement. This uses speculative parsing to remove the ambiguity of whether the `match` token is used as a keyword or an identi
crates/ruff_python_parser/src/parser/statement.rs:2587
↓ 1 callersMethodtry_parse_parenthesized_with_items
Try parsing with-items coming after an ambiguous `(` token. To understand the ambiguity, consider the following example: ```python with (item1, item
crates/ruff_python_parser/src/parser/statement.rs:2357
↓ 1 callersFunctiontry_phf_table
( values: &[(char, &str)], lambda: usize, seed: u64, rng: &mut StdRng, )
crates/ruff_unicode_names2_generator/src/phf.rs:41
↓ 1 callersMethodtry_reduce
Try reducing this `UnionElement` given the presence in the same union of `other_type`.
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:478
↓ 1 callersFunctiontry_register_alias
If `value_ty` has a supported literal value, record it as canonical or as an alias of an existing value. Returns `None` when the value is not precise
crates/ty_python_semantic/src/types/enums.rs:979
↓ 1 callersMethodtry_register_narrowing_alias
Try to register a narrowing alias for a simple name assignment. Any pre-existing alias entry for the `target` name has already been removed by [`Self
crates/ty_python_core/src/builder.rs:1138
↓ 1 callersMethodtry_replace
( &'a self, candidates: &[&str], target: &'a str, )
crates/ruff_linter/src/rules/pyupgrade/rules/deprecated_import.rs:641
↓ 1 callersFunctiontry_sequence_pattern_binding_fallthrough_type
Apply sequence-pattern binding fallthrough, expanding immutable exact tuples within `budget`. The budget is shared by unions, intersections, and nest
crates/ty_python_semantic/src/types/match_pattern.rs:1104
← previousnext →13,601–13,700 of 31,562, ranked by callers