MCPcopy Create free account

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

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

↓ 8 callersMethodgenerate
(self)
crates/ruff_python_codegen/src/generator.rs:238
↓ 8 callersMethodget
(&self, item: &T)
crates/ty_python_semantic/src/types/cyclic.rs:1165
↓ 8 callersMethodget
(&self, place: ScopedPlaceId, is_positive: bool)
crates/ty_python_semantic/src/types/narrow.rs:1399
↓ 8 callersFunctionget_function_f
(db: &'db TestDb, file: &'static str)
crates/ty_python_semantic/src/types/signatures.rs:6653
↓ 8 callersMethodget_or_infer_expression
Return an already-inferred type for `expr`, or infer it with `tcx` if needed. This is used in places where an expression may already have been inferr
crates/ty_python_semantic/src/types/infer/builder.rs:1101
↓ 8 callersFunctionget_redirect_target
Returns the redirect target for a rule code, prefix, or name.
crates/ruff_linter/src/rule_redirects.rs:7
↓ 8 callersMethodglobal_scope
Returns a reference to the global [`Scope`].
crates/ruff_python_semantic/src/model.rs:1559
↓ 8 callersMethodhas_default
Returns whether this parameter has a default without inferring its type.
crates/ty_python_semantic/src/types/signatures.rs:6380
↓ 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:438
↓ 8 callersMethodid
(self)
crates/ruff_linter/resources/test/fixtures/flake8_builtins/A001.py:38
↓ 8 callersMethodimport
Create a new `ImportRequest` from a module and member. If not present in the scope, the symbol should be imported using the "import" statement.
crates/ruff_linter/src/importer/mod.rs:634
↓ 8 callersFunctionindentation
Calculates indentation width, advancing tabs to the next multiple of eight columns.
crates/ty_ide/src/docstring/document/syntax.rs:626
↓ 8 callersMethodindex
Returns a reference to the contained index. # Panics Panics if the index is `None`.
crates/ty_server/src/system.rs:119
↓ 8 callersMethodinfer_collection_literal
Infer the type of a collection literal expression.
crates/ty_python_semantic/src/types/infer/builder.rs:8029
↓ 8 callersFunctioninferred_declaration
Infer the type of a declaration, returning `Rejected` if it is not valid.
crates/ty_python_semantic/src/types.rs:393
↓ 8 callersMethodinto_type
(self, db: &'db dyn Db, env: &ProgramEnvironment<'db>)
crates/ty_python_semantic/src/types/set_theoretic/builder.rs:722
↓ 8 callersMethodis_
(self, key: Key, flag: int)
crates/ruff_benchmark/resources/tomllib/_parser.py:175
↓ 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_defined_and
(self, f: impl Fn(Definition<'db>) -> bool)
crates/ty_python_core/src/definition.rs:323
↓ 8 callersMethodis_empty
(&self)
crates/ty_project/src/uv/environments.rs:520
↓ 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_enabled
(&self)
crates/ty_python_semantic/src/types/relation_error.rs:960
↓ 8 callersFunctionis_enum_class_by_inheritance
Checks if a class is an enum class by inheritance (either a subtype of `Enum` or has a metaclass that is a subtype of `EnumType`). This is a lighter-
crates/ty_python_semantic/src/types/enums.rs:1664
↓ 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:1044
↓ 8 callersFunctionis_logger_candidate
Return `true` if the given `Expr` is a potential logging call. Matches `logging.error`, `logger.error`, `self.logger.error`, etc., but not arbitrary `
crates/ruff_python_semantic/src/analyze/logging.rs:19
↓ 8 callersFunctionis_mangled_private
Returns `true` if a string is a private identifier, such that, when the identifier is defined in a class definition, it will be mangled prior to code
crates/ruff_python_stdlib/src/identifiers.rs:50
↓ 8 callersMethodis_match
(&self, path: &Path)
crates/ruff_linter/src/settings/types.rs:987
↓ 8 callersMethodis_parenthesized
(self)
crates/ruff_python_formatter/src/pattern/pattern_match_sequence.rs:151
↓ 8 callersMethodis_protocol
Returns whether this class is a protocol.
crates/ty_python_semantic/src/types/class.rs:845
↓ 8 callersMethodis_read_only
(self)
crates/ty_python_semantic/src/types/typed_dict.rs:185
↓ 8 callersMethodis_statement
(self)
crates/ruff_python_ast/src/generated.rs:7305
↓ 8 callersMethodis_string
(self)
crates/ty_python_semantic/src/types/literal.rs:256
↓ 8 callersMethodis_terminal
(self)
crates/ty_python_semantic/src/types/constraints.rs:2394
↓ 8 callersMethodis_typed_dict
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/class.rs:507
↓ 8 callersMethodis_unclosed
(self)
crates/ruff_python_ast/src/nodes.rs:1334
↓ 8 callersMethodis_user_visible
Returns `true` if this definition is user-visible (i.e., not an internal synthetic definition like a loop header or nested bindings definition).
crates/ty_python_core/src/definition.rs:1021
↓ 8 callersMethodjoinpath
(self)
crates/ruff_python_formatter/resources/test/fixtures/ruff/newlines.py:222
↓ 8 callersMethodkeyword_by_name
Return parameter (with index) for given name, or `None` if no such parameter. Does not return keywords (`**kwargs`) parameter. In an invalid signatu
crates/ty_python_semantic/src/types/signatures.rs:5708
↓ 8 callersMethodkeyword_variadic
Return the keywords parameter (`**kwargs`), if any, and its index, or `None`.
crates/ty_python_semantic/src/types/signatures.rs:5715
↓ 8 callersMethodknown_specialization
If the expected type is a specialized instance of the given `KnownClass`, returns the specialization.
crates/ty_python_semantic/src/types/infer/type_context.rs:114
↓ 8 callersMethodload
Load the current value of the `AtomicNodeIndex`.
crates/ruff_python_ast/src/node_index.rs:169
↓ 8 callersMethodlocation
(&self)
crates/ruff_python_parser/src/error.rs:364
↓ 8 callersMethodmap
Apply a transformation function to all elements of the union, and create a new union from the resulting set of types.
crates/ty_python_semantic/src/types/set_theoretic.rs:408
↓ 8 callersFunctionmatch_statement
(statement_text: &str)
crates/ruff_linter/src/cst/matchers.rs:18
↓ 8 callersMethodmember_by_name
( self, db: &'db dyn Db, name: &'a str, )
crates/ty_python_semantic/src/types/protocol_class.rs:522
↓ 8 callersFunctionmember_lookup_result
( db: &'db dyn Db, member: PlaceAndQualifiers<'db>, error: Option<MemberLookupErrorKind<'db>>,
crates/ty_python_semantic/src/types.rs:1181
↓ 8 callersFunctionmock_typeshed
()
crates/ruff_db/src/vendored.rs:526
↓ 8 callersMethodmro
Iterate over the MRO of this base
crates/ty_python_semantic/src/types/class_base.rs:498
↓ 8 callersMethodname
(&self)
crates/ruff_python_ast/src/nodes.rs:3027
↓ 8 callersMethodname
(&self)
crates/ruff_dev/src/generate_options.rs:81
↓ 8 callersMethodname
(self, python_version: PythonVersion)
crates/ty_python_semantic/src/types/class/known.rs:1096
↓ 8 callersMethodnext
(&mut self)
crates/ruff_linter/src/registry/rule_set.rs:354
↓ 8 callersMethodnode_scope
(&self, node: NodeWithScopeRef)
crates/ty_python_core/src/lib.rs:780
↓ 8 callersFunctionnormalize
()
crates/ty_project/src/metadata/pyproject.rs:311
↓ 8 callersFunctionnotebook_path
Construct a path to a Jupyter notebook in the `resources/test/fixtures/jupyter` directory.
crates/ruff_linter/src/linter.rs:797
↓ 8 callersMethodopen_document_handle
Returns a handle to the open document specified by its URI. Returns an error if the document is not open in the index.
crates/ty_server/src/session/index.rs:49
↓ 8 callersMethodorigin
(&self)
crates/ty_python_semantic/src/types.rs:12165
↓ 8 callersMethodown_class_member
Look up a class-level member defined directly on this `TypedDict` (not inherited).
crates/ty_python_semantic/src/types/class/typed_dict.rs:1009
↓ 8 callersFunctionparenthesize_if_expands
Adds parentheses and indents `content` if it doesn't fit on a line.
crates/ruff_python_formatter/src/builders.rs:9
↓ 8 callersMethodparse
Consumes the [`Parser`] and returns the parsed [`Parsed`].
crates/ruff_python_parser/src/parser/mod.rs:156
↓ 8 callersMethodparse_conditional_expression_or_higher_impl
( &mut self, context: ExpressionContext, )
crates/ruff_python_parser/src/parser/expression.rs:208
↓ 8 callersMethodparse_type_annotation
Parse a stringified type annotation as an AST expression, e.g. `"List[str]"` in `x: "List[str]"` This method is a wrapper around [`ruff_python_parser
crates/ruff_linter/src/checkers/ast/mod.rs:601
↓ 8 callersMethodpath
(&self)
crates/ruff_workspace/src/resolver.rs:774
↓ 8 callersMethodplace
(&self, place_id: impl Into<ScopedPlaceId>)
crates/ty_python_core/src/place.rs:308
↓ 8 callersMethodplace
Returns the type, boundness, and qualifiers of the resolved place.
crates/ty_python_semantic/src/place_load.rs:239
↓ 8 callersMethodpoll_sync
Applies completed background requests to their projects or script environments. Background workers cannot apply their results because updating an exi
crates/ty_project/src/uv/environments.rs:313
↓ 8 callersMethodpositive_elements_or_object
Returns an iterator over the positive elements of the intersection. If there are no positive elements, returns a single `object` type.
crates/ty_python_semantic/src/types/set_theoretic.rs:1248
↓ 8 callersMethodprefix_len
(&self)
crates/ty_python_semantic/src/types/tuple.rs:1268
↓ 8 callersMethodprepare
(&self)
crates/ty_ide/src/type_hierarchy.rs:733
↓ 8 callersMethodprimary_span_ref
Returns a reference to the primary span of this diagnostic.
crates/ruff_db/src/diagnostic/mod.rs:337
↓ 8 callersMethodprogram_file
(&self, file: File)
crates/ty_project/src/db.rs:611
↓ 8 callersMethodprogram_file
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:349
↓ 8 callersFunctionproject
( metadata: &'a DependencyMetadata, path: &str, )
crates/ty_project/src/uv/metadata/dependencies.rs:425
↓ 8 callersMethodproject
(&self)
crates/ruff_benchmark/src/real_world_projects.rs:106
↓ 8 callersFunctionproject_files_in_path
Find all project files in a set of paths, following configured include/exclude settings.
crates/ruff_workspace/src/resolver.rs:462
↓ 8 callersMethodpush_dangling
Pushes a *dangling* part for `key`
crates/ruff_python_formatter/src/comments/map.rs:109
↓ 8 callersMethodpush_marker
Push a new marker to the sourcemap. ## Panics If `offset` is less than previous markers.
crates/ruff_diagnostics/src/source_map.rs:79
↓ 8 callersMethodrange
(&self)
crates/ruff_python_formatter/src/expression/expr_dict.rs:98
↓ 8 callersMethodrange
(&self)
crates/ruff_python_formatter/src/comments/mod.rs:184
↓ 8 callersMethodreachability_cache
(&self)
crates/ty_python_semantic/src/types/infer/builder.rs:594
↓ 8 callersMethodread
Read a JSON failure record, returning `None` if the file does not exist.
python/py-fuzzer/fuzz.py:245
↓ 8 callersMethodread_to_string
(&self, path: &SystemPath)
crates/ty_test/src/db.rs:543
↓ 8 callersMethodregister
Registers a new pending request.
crates/ty_server/src/session/request_queue.rs:62
↓ 8 callersMethodrelative_to
(self, path: &SystemPath)
crates/ruff_graph/src/lib.rs:88
↓ 8 callersFunctionremove_unused_imports
Generate a `Fix` to remove the specified imports from an `import` statement.
crates/ruff_linter/src/fix/edits.rs:112
↓ 8 callersFunctionrename_edit
(server: &mut TestServer, renames: &[(&str, &str)])
crates/ty_server/tests/e2e/will_rename_files.rs:399
↓ 8 callersMethodreport_deprecated_functions
Report the distinct deprecated targets of one operation in a single diagnostic. Deduplicate by source function or overload. Keep a shared deprecation
crates/ty_python_semantic/src/types/infer/builder.rs:10899
↓ 8 callersMethodreport_diagnostic
Return a [`DiagnosticGuard`] for reporting a diagnostic. The guard derefs to a [`Diagnostic`], so it can be used to further modify the diagnostic bef
crates/ruff_linter/src/checkers/ast/mod.rs:460
↓ 8 callersMethodreport_diagnostics
Report diagnostics for all of the errors that occurred when trying to match actual arguments to formal parameters. If the callable is a union, or has
crates/ty_python_semantic/src/types/call/bind.rs:1564
↓ 8 callersFunctionreport_mismatched_type_name
( context: &InferContext<'db, '_>, node: impl Ranged, constructor: &str, expected_name: &str,
crates/ty_python_semantic/src/types/diagnostic.rs:1679
↓ 8 callersMethodrequirement
Resolve the complete write requirement. Type-only queries can omit the receiver; assignment checking supplies one for `Self` substitution.
crates/ty_python_semantic/src/types/protocol_class.rs:1736
↓ 8 callersMethodresolve
Returns the re-mapped position or `position` if no mapping exists.
crates/ruff_linter/src/noqa.rs:1325
↓ 8 callersMethodroot
(&self)
crates/ty_project/src/metadata.rs:387
↓ 8 callersFunctionrun_single_threaded
(bencher: Bencher, benchmark: &Benchmark)
crates/ruff_benchmark/benches/ty_walltime.rs:203
↓ 8 callersMethodruntime_class
(self, db: &'db dyn Db)
crates/ty_python_semantic/src/types/function.rs:2070
↓ 8 callersMethodscope
(&self)
crates/ty_python_semantic/src/types/narrow.rs:3528
↓ 8 callersMethodscoped_use_id
(&self, db: &dyn Db, file: ProgramFile<'_>)
crates/ty_python_core/src/ast_ids.rs:271
↓ 8 callersFunctionscript_environment
Returns the Salsa input representing `file`'s script environment. The CLI and language server normally synchronize the script's virtual environment b
crates/ty_project/src/uv/environments.rs:113
↓ 8 callersMethodset
Set the value of the `AtomicNodeIndex`.
crates/ruff_python_ast/src/node_index.rs:177
← previousnext →1,901–2,000 of 31,766, ranked by callers