Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/astral-sh/ruff
/ functions
Functions
31,562 in github.com/astral-sh/ruff
⨍
Functions
31,562
◇
Types & classes
7,116
↳
Endpoints
82
Method
from_line
Strip trailing comments from a [`Line`], if the line ends with a pragma comment (like `# type: ignore`) or, if necessary, a task comment (like `# TODO
crates/ruff_linter/src/rules/pycodestyle/overlong.rs:117
Method
from_lint
(lint: &'a LintId)
crates/ty/src/rule.rs:21
Method
from_map
(map: &CommentsMap<'_>)
crates/ruff_python_formatter/src/comments/mod.rs:512
Method
from_map
(definitions_by_node: FxHashMap<DefinitionNodeKey, Definitions<'db>>)
crates/ty_python_core/src/lib.rs:251
Method
from_map
(map: FxHashMap<ScopedUseId, Vec<Bindings>>)
crates/ty_python_core/src/use_def.rs:1015
Method
from_member
(name: &'a str, asname: Option<&'a str>, settings: &Settings)
crates/ruff_linter/src/rules/isort/sorting.rs:159
Method
from_memory_fs
(memory_fs: MemoryFileSystem)
crates/ruff_db/src/system/test.rs:378
Method
from_message
( diagnostic: &'a Diagnostic, resolver: &dyn FileResolver, config: &'a DisplayDiagnost
crates/ruff_db/src/diagnostic/render/sarif.rs:384
Method
from_metadata
Create a project from resolved metadata and settings.
crates/ty_project/src/lib.rs:218
Method
from_metadata
( metadata: &[u8], system: &dyn System, )
crates/ty_project/src/uv/metadata.rs:45
Method
from_metadata
(metadata: &ProjectMetadata)
crates/ty_project/src/db/changes.rs:473
Method
from_metadata_result
(metadata: Result<UvMetadata, UvMetadataError>)
crates/ty_project/src/uv/environments.rs:546
Method
from_method
(name: &str, is_staticmethod: bool)
crates/ruff_linter/src/rules/pylint/rules/unexpected_special_method_signature.rs:20
Method
from_method
(dunder_method: &str)
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs:302
Method
from_mixin
Classifies how much member information can be preserved for a functional enum with `type=`. Generated-name forms can keep more information for a smal
crates/ty_python_semantic/src/types/infer/builder/enum_call.rs:73
Method
from_model
Determine the [`AnnotationContext`] for an annotation based on the current scope of the semantic model.
crates/ruff_linter/src/checkers/ast/annotation.rs:39
Method
from_module
Creates a new symbol referencing an entire module.
crates/ty_ide/src/all_symbols.rs:126
Method
from_module
Determines the "kind" of a symbol based on the module it is defined in. Note that this can never return `ModuleDependencyKind::Current`. Callers are
crates/ty_ide/src/completion.rs:2010
Method
from_module
( name: Option<&'a str>, asname: Option<&'a str>, level: u32, first_alias: Opt
crates/ruff_linter/src/rules/isort/sorting.rs:97
Method
from_name
(name: &str)
crates/ty_ide/src/docstring/document/google.rs:491
Method
from_name
Returns the component represented by a `ParamSpec` attribute name.
crates/ty_python_semantic/src/types/typevar.rs:1877
Method
from_name
Returns the frozen-dataclass method for `name`, if it is `__setattr__` or `__delattr__`.
crates/ty_python_semantic/src/types/class/static_literal.rs:168
Method
from_name
(name: &str)
crates/ruff_linter/src/rules/pyupgrade/rules/use_pep604_isinstance.rs:28
Method
from_node
(node: N)
crates/ty_python_core/src/node_key.rs:15
Method
from_node
( builder: &'c ConstraintSetBuilder<'db>, node: NodeId, source_order: Option<SourceOrd
crates/ty_python_semantic/src/types/constraints.rs:418
Method
from_node_and_kind
( db: &'db dyn Db, index: &SemanticIndex<'db>, infer_annotation: &impl Fn(&ast::Expr)
crates/ty_python_semantic/src/types/signatures.rs:6316
Method
from_node_ref
(node: ast::AnyNodeRef<'_>)
crates/ty_python_core/src/definition.rs:1762
Method
from_node_ref
(node_ref: &AstNodeRef<T>)
crates/ty_python_core/src/node_key.rs:22
Method
from_non_module_symbol
( db: &'_ dyn Db, symbol: SymbolInfo<'static>, module: Module<'db>, file: File
crates/ty_ide/src/all_symbols.rs:106
Method
from_normalized
(db: &'db dyn Db, value: Vec<Parameter<'db>>)
crates/ty_python_semantic/src/types/signatures.rs:5132
Method
from_notebook_document
(document: &NotebookDocument)
crates/ty_server/src/session.rs:1937
Method
from_numeric_flags
(numeric_flags: NumericFlags)
crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs:285
Method
from_op
(op: ast::CmpOp, is_positive: bool)
crates/ty_python_semantic/src/types/narrow.rs:1636
Method
from_operation
(operation: NarrowingOperation<'db>)
crates/ty_python_semantic/src/types/narrow.rs:772
Method
from_options
Loads a project from a set of options with an optional pyproject-project table.
crates/ty_project/src/metadata.rs:145
Method
from_options
Convert the [`Options`] read from the given [`Path`] into a [`Configuration`]. If `None` is supplied for `path`, it indicates that the `Options` insta
crates/ruff_workspace/src/configuration.rs:528
Method
from_options
Create a new [`IgnoreNames`] from the given options.
crates/ruff_linter/src/rules/pep8_naming/settings.rs:99
Method
from_overload
( db: &'db dyn Db, function: OverloadLiteral<'db>, )
crates/ty_python_semantic/src/types/call/bind.rs:9865
Method
from_overloads
Creates a new `CallableSignature` from an iterator of [`Signature`]s. Returns a non-callable signature if the iterator is empty.
crates/ty_python_semantic/src/types/signatures.rs:206
Method
from_overloads
( signature_type: Type<'db>, overloads: impl IntoIterator<Item = Signature<'db>>, )
crates/ty_python_semantic/src/types/call/bind.rs:3561
Method
from_owned_parts
( kind: SectionKind, display_name: Option<String>, ty: Option<String>, descrip
crates/ty_ide/src/docstring/markdown/structured.rs:233
Method
from_param
(cls, obj)
crates/ruff_benchmark/resources/numpy/ctypeslib.py:185
Method
from_parameter
Return `foo` in the first metadata `Depends(foo)`, or that of the default value: ```python def _( a: Annotated[str, Depends(foo)], #
crates/ruff_linter/src/rules/fastapi/rules/fastapi_unused_path_parameter.rs:261
Method
from_parameters
( db: &'db dyn Db, index: &SemanticIndex<'db>, parameters: &ast::Parameters, h
crates/ty_python_semantic/src/types/signatures.rs:5538
Method
from_part
( part: StringLikePart, context: &PyFormatContext, preferred_quote: Quote, )
crates/ruff_python_formatter/src/string/normalize.rs:287
Method
from_parts
Builds the error description from whichever methods are at fault, or `None` if both returned awaitables and there is nothing to report.
crates/ty_python_semantic/src/types/context_manager.rs:315
Method
from_parts
( owner: Definition<'db>, bindings: Vec<DefinitionBinding<'db>>, declarations: Vec<Def
crates/ty_python_semantic/src/types/infer.rs:1257
Method
from_patch_items_with_openness
( db: &'db dyn Db, items: TypedDictSchema<'db>, openness: TypedDictOpenness<'db>,
crates/ty_python_semantic/src/types/typed_dict.rs:642
Method
from_path
( path: SystemPathBuf, system: &dyn System, )
crates/ty_project/src/metadata/configuration_file.rs:17
Method
from_path
(path: &Path)
crates/ruff/src/cache.rs:40
Method
from_path
Read the Jupyter Notebook from the given [`Path`].
crates/ruff_notebook/src/notebook.rs:84
Method
from_path
Read the [`SourceKind`] from the given path. Returns `None` if the source is a TOML file.
crates/ruff_linter/src/source_kind.rs:113
Method
from_path
(path: &SystemPath, system: &dyn System)
crates/ty_site_packages/src/lib.rs:580
Method
from_path_buf
( path: std::path::PathBuf, )
crates/ruff_db/src/system/path.rs:535
Method
from_path_buf_lossy
Try to convert from `path` directly, falling back to the lossy string representation on error.
crates/ruff_db/src/system/path.rs:543
Method
from_pattern
(pattern: &PatternMatchSequence, source: &str)
crates/ruff_python_formatter/src/pattern/pattern_match_sequence.rs:85
Method
from_patterns
Creates a new [`ModuleGlobSet`] from an iterator of patterns. This is a convenience method that creates a builder, adds all patterns, and builds the
crates/ty_module_resolver/src/module_glob.rs:78
Method
from_patterns
Create a new [`IgnoreNames`] from the given patterns.
crates/ruff_linter/src/rules/pep8_naming/settings.rs:162
Function
from_pkg
()
crates/ruff_linter/resources/test/fixtures/flake8_type_checking/TC001-3_future_strict.py:16
Method
from_positive_and_negative
Create `positive & ~negative` directly so the positive operand can prune branches while distributing the complement.
crates/ty_python_semantic/src/types/set_theoretic.rs:1168
Method
from_possibly_ambiguous_types
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, types: I, )
crates/ty_python_semantic/src/types/display.rs:266
Method
from_prefix_path
Compute the kind of `CONDA_PREFIX` we have. The base environment is typically stored in a location matching the `_CONDA_ROOT` path. Additionally, wh
crates/ty_site_packages/src/lib.rs:1018
Method
from_program
Creates an environment with an already-established program.
crates/ty_python_semantic/src/types/context.rs:67
Method
from_project
(db: &'a dyn Db, project: Project)
crates/ty_project/src/walk.rs:31
Method
from_prose
Creates an unambiguous body containing the description as a single prose fragment.
crates/ty_ide/src/docstring/document.rs:104
Method
from_protocol
Construct the meta-type of a class-backed protocol.
crates/ty_python_semantic/src/types/subclass_of.rs:68
Method
from_pyproject
Loads a project from a `pyproject.toml` file.
crates/ty_project/src/metadata.rs:125
Method
from_qualified_name
(qualified_name: &QualifiedName)
crates/ruff_linter/src/rules/ruff/rules/legacy_form_pytest_raises.rs:98
Method
from_raw
(raw: Vec<T>)
crates/ruff_index/src/vec.rs:34
Method
from_raw
(raw: &[T])
crates/ruff_index/src/slice.rs:22
Method
from_raw
(raw: Box<[T]>)
crates/ruff_index/src/frozen.rs:15
Method
from_raw_mut
(raw: &mut [T])
crates/ruff_index/src/slice.rs:33
Method
from_raw_notebook
( mut raw_notebook: RawNotebook, trailing_newline: bool, )
crates/ruff_notebook/src/notebook.rs:124
Method
from_raw_parts
(kind: RootNodeKind, pointer: std::ptr::NonNull<()>)
crates/ruff_python_ast/src/generated.rs:8956
Method
from_raw_str
(text: &'a str)
crates/ruff_python_literal/src/format.rs:734
Method
from_reader
Read a Jupyter Notebook from a [`Read`] implementer. See also the black implementation <https://github.com/psf/black/blob/69ca0a4c7a365c5f5eea519a909
crates/ruff_notebook/src/notebook.rs:97
Method
from_ref
Creates a key for a node reference.
crates/ruff_python_formatter/src/comments/node_key.rs:17
Method
from_references
Determine the kind of [`TypingReference`] for all references to a binding.
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:45
Method
from_registry
Creates a new rule selection from all known lints in the registry that are enabled according to their default severity.
crates/ty_python_semantic/src/lint.rs:613
Method
from_registry_with_default
( registry: &LintRegistry, default_severity: Option<Severity>, )
crates/ty_python_semantic/src/lint.rs:623
Function
from_relative_import_missing_alias_suggests_as
()
crates/ty_ide/src/completion.rs:8878
Method
from_requirement
Inspect a resolved requirement without inferring or validating the assigned value. Composite requirements need further attribute lookups.
crates/ty_python_semantic/src/types/infer/builder/attribute_assignment.rs:111
Method
from_resolver
(db: &'db dyn Db, resolver: PlaceLoadResolver<'db, '_>)
crates/ty_python_semantic/src/place/definitions.rs:51
Method
from_rule
(rule: &'a Rule)
crates/ruff/src/commands/rule.rs:33
Method
from_rule
(rule: Rule)
crates/ruff_linter/src/registry/rule_set.rs:28
Method
from_rule_selectors
( extend_safe_fixes: &[UnresolvedRuleSelector], extend_unsafe_fixes: &[UnresolvedRuleSelector]
crates/ruff_linter/src/settings/fix_safety_table.rs:44
Method
from_rules
(rules: &[Rule])
crates/ruff_linter/src/registry/rule_set.rs:50
Method
from_schema_items
(db: &'db dyn Db, items: TypedDictSchema<'db>)
crates/ty_python_semantic/src/types/typed_dict.rs:629
Method
from_schema_items_with_openness
Creates a synthesized schema while preserving its undeclared-item policy.
crates/ty_python_semantic/src/types/typed_dict.rs:634
Method
from_scope
Creates an environment that lazily obtains its program from `scope`.
crates/ty_python_semantic/src/types/context.rs:59
Method
from_search_paths
Indexes search paths that may contain a stub package, preserving their position relative to the standard library.
crates/ty_module_resolver/src/resolve.rs:485
Method
from_section
(section: &SectionContext)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:493
Method
from_sections
(sections: &'a SectionContexts, style: Option<SectionStyle>)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:574
Method
from_selector
(unresolved: &UnresolvedRuleSelector, kind: RuleResolutionErrorKind)
crates/ruff_linter/src/rule_selector.rs:87
Method
from_semantic_completion
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, semantic: SemanticCompletion<'db>,
crates/ty_ide/src/completion.rs:450
Method
from_settings
Validate and normalize the raw settings given by the user into settings we can use for module resolution This method also implements the typing spec'
crates/ty_module_resolver/src/resolve.rs:743
Method
from_settings
Creates a program from settings whose search roots have already been registered.
crates/ty_python_core/src/program.rs:30
Method
from_settings
(settings: &LinterSettings)
crates/ruff_linter/src/directives.rs:29
Method
from_signatures
( source: &Signature<'db>, target: &Signature<'db>, relation: TypeRelation, ty
crates/ty_python_semantic/src/types/signatures.rs:866
Method
from_slice
(slice: &'slice [OperandOrOperator<'a>])
crates/ruff_python_formatter/src/expression/binary_like.rs:535
← previous
next →
21,101–21,200 of 31,562, ranked by callers