MCPcopy Create free account

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

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

Methodfrom_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
Methodfrom_lint
(lint: &'a LintId)
crates/ty/src/rule.rs:21
Methodfrom_map
(map: &CommentsMap<'_>)
crates/ruff_python_formatter/src/comments/mod.rs:512
Methodfrom_map
(definitions_by_node: FxHashMap<DefinitionNodeKey, Definitions<'db>>)
crates/ty_python_core/src/lib.rs:251
Methodfrom_map
(map: FxHashMap<ScopedUseId, Vec<Bindings>>)
crates/ty_python_core/src/use_def.rs:1015
Methodfrom_member
(name: &'a str, asname: Option<&'a str>, settings: &Settings)
crates/ruff_linter/src/rules/isort/sorting.rs:159
Methodfrom_memory_fs
(memory_fs: MemoryFileSystem)
crates/ruff_db/src/system/test.rs:378
Methodfrom_message
( diagnostic: &'a Diagnostic, resolver: &dyn FileResolver, config: &'a DisplayDiagnost
crates/ruff_db/src/diagnostic/render/sarif.rs:384
Methodfrom_metadata
Create a project from resolved metadata and settings.
crates/ty_project/src/lib.rs:218
Methodfrom_metadata
( metadata: &[u8], system: &dyn System, )
crates/ty_project/src/uv/metadata.rs:45
Methodfrom_metadata
(metadata: &ProjectMetadata)
crates/ty_project/src/db/changes.rs:473
Methodfrom_metadata_result
(metadata: Result<UvMetadata, UvMetadataError>)
crates/ty_project/src/uv/environments.rs:546
Methodfrom_method
(name: &str, is_staticmethod: bool)
crates/ruff_linter/src/rules/pylint/rules/unexpected_special_method_signature.rs:20
Methodfrom_method
(dunder_method: &str)
crates/ruff_linter/src/rules/pylint/rules/unnecessary_dunder_call.rs:302
Methodfrom_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
Methodfrom_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
Methodfrom_module
Creates a new symbol referencing an entire module.
crates/ty_ide/src/all_symbols.rs:126
Methodfrom_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
Methodfrom_module
( name: Option<&'a str>, asname: Option<&'a str>, level: u32, first_alias: Opt
crates/ruff_linter/src/rules/isort/sorting.rs:97
Methodfrom_name
(name: &str)
crates/ty_ide/src/docstring/document/google.rs:491
Methodfrom_name
Returns the component represented by a `ParamSpec` attribute name.
crates/ty_python_semantic/src/types/typevar.rs:1877
Methodfrom_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
Methodfrom_name
(name: &str)
crates/ruff_linter/src/rules/pyupgrade/rules/use_pep604_isinstance.rs:28
Methodfrom_node
(node: N)
crates/ty_python_core/src/node_key.rs:15
Methodfrom_node
( builder: &'c ConstraintSetBuilder<'db>, node: NodeId, source_order: Option<SourceOrd
crates/ty_python_semantic/src/types/constraints.rs:418
Methodfrom_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
Methodfrom_node_ref
(node: ast::AnyNodeRef<'_>)
crates/ty_python_core/src/definition.rs:1762
Methodfrom_node_ref
(node_ref: &AstNodeRef<T>)
crates/ty_python_core/src/node_key.rs:22
Methodfrom_non_module_symbol
( db: &'_ dyn Db, symbol: SymbolInfo<'static>, module: Module<'db>, file: File
crates/ty_ide/src/all_symbols.rs:106
Methodfrom_normalized
(db: &'db dyn Db, value: Vec<Parameter<'db>>)
crates/ty_python_semantic/src/types/signatures.rs:5132
Methodfrom_notebook_document
(document: &NotebookDocument)
crates/ty_server/src/session.rs:1937
Methodfrom_numeric_flags
(numeric_flags: NumericFlags)
crates/ruff_linter/src/rules/flake8_pyi/rules/redundant_numeric_union.rs:285
Methodfrom_op
(op: ast::CmpOp, is_positive: bool)
crates/ty_python_semantic/src/types/narrow.rs:1636
Methodfrom_operation
(operation: NarrowingOperation<'db>)
crates/ty_python_semantic/src/types/narrow.rs:772
Methodfrom_options
Loads a project from a set of options with an optional pyproject-project table.
crates/ty_project/src/metadata.rs:145
Methodfrom_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
Methodfrom_options
Create a new [`IgnoreNames`] from the given options.
crates/ruff_linter/src/rules/pep8_naming/settings.rs:99
Methodfrom_overload
( db: &'db dyn Db, function: OverloadLiteral<'db>, )
crates/ty_python_semantic/src/types/call/bind.rs:9865
Methodfrom_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
Methodfrom_overloads
( signature_type: Type<'db>, overloads: impl IntoIterator<Item = Signature<'db>>, )
crates/ty_python_semantic/src/types/call/bind.rs:3561
Methodfrom_owned_parts
( kind: SectionKind, display_name: Option<String>, ty: Option<String>, descrip
crates/ty_ide/src/docstring/markdown/structured.rs:233
Methodfrom_param
(cls, obj)
crates/ruff_benchmark/resources/numpy/ctypeslib.py:185
Methodfrom_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
Methodfrom_parameters
( db: &'db dyn Db, index: &SemanticIndex<'db>, parameters: &ast::Parameters, h
crates/ty_python_semantic/src/types/signatures.rs:5538
Methodfrom_part
( part: StringLikePart, context: &PyFormatContext, preferred_quote: Quote, )
crates/ruff_python_formatter/src/string/normalize.rs:287
Methodfrom_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
Methodfrom_parts
( owner: Definition<'db>, bindings: Vec<DefinitionBinding<'db>>, declarations: Vec<Def
crates/ty_python_semantic/src/types/infer.rs:1257
Methodfrom_patch_items_with_openness
( db: &'db dyn Db, items: TypedDictSchema<'db>, openness: TypedDictOpenness<'db>,
crates/ty_python_semantic/src/types/typed_dict.rs:642
Methodfrom_path
( path: SystemPathBuf, system: &dyn System, )
crates/ty_project/src/metadata/configuration_file.rs:17
Methodfrom_path
(path: &Path)
crates/ruff/src/cache.rs:40
Methodfrom_path
Read the Jupyter Notebook from the given [`Path`].
crates/ruff_notebook/src/notebook.rs:84
Methodfrom_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
Methodfrom_path
(path: &SystemPath, system: &dyn System)
crates/ty_site_packages/src/lib.rs:580
Methodfrom_path_buf
( path: std::path::PathBuf, )
crates/ruff_db/src/system/path.rs:535
Methodfrom_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
Methodfrom_pattern
(pattern: &PatternMatchSequence, source: &str)
crates/ruff_python_formatter/src/pattern/pattern_match_sequence.rs:85
Methodfrom_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
Methodfrom_patterns
Create a new [`IgnoreNames`] from the given patterns.
crates/ruff_linter/src/rules/pep8_naming/settings.rs:162
Functionfrom_pkg
()
crates/ruff_linter/resources/test/fixtures/flake8_type_checking/TC001-3_future_strict.py:16
Methodfrom_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
Methodfrom_possibly_ambiguous_types
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, types: I, )
crates/ty_python_semantic/src/types/display.rs:266
Methodfrom_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
Methodfrom_program
Creates an environment with an already-established program.
crates/ty_python_semantic/src/types/context.rs:67
Methodfrom_project
(db: &'a dyn Db, project: Project)
crates/ty_project/src/walk.rs:31
Methodfrom_prose
Creates an unambiguous body containing the description as a single prose fragment.
crates/ty_ide/src/docstring/document.rs:104
Methodfrom_protocol
Construct the meta-type of a class-backed protocol.
crates/ty_python_semantic/src/types/subclass_of.rs:68
Methodfrom_pyproject
Loads a project from a `pyproject.toml` file.
crates/ty_project/src/metadata.rs:125
Methodfrom_qualified_name
(qualified_name: &QualifiedName)
crates/ruff_linter/src/rules/ruff/rules/legacy_form_pytest_raises.rs:98
Methodfrom_raw
(raw: Vec<T>)
crates/ruff_index/src/vec.rs:34
Methodfrom_raw
(raw: &[T])
crates/ruff_index/src/slice.rs:22
Methodfrom_raw
(raw: Box<[T]>)
crates/ruff_index/src/frozen.rs:15
Methodfrom_raw_mut
(raw: &mut [T])
crates/ruff_index/src/slice.rs:33
Methodfrom_raw_notebook
( mut raw_notebook: RawNotebook, trailing_newline: bool, )
crates/ruff_notebook/src/notebook.rs:124
Methodfrom_raw_parts
(kind: RootNodeKind, pointer: std::ptr::NonNull<()>)
crates/ruff_python_ast/src/generated.rs:8956
Methodfrom_raw_str
(text: &'a str)
crates/ruff_python_literal/src/format.rs:734
Methodfrom_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
Methodfrom_ref
Creates a key for a node reference.
crates/ruff_python_formatter/src/comments/node_key.rs:17
Methodfrom_references
Determine the kind of [`TypingReference`] for all references to a binding.
crates/ruff_linter/src/rules/flake8_type_checking/helpers.rs:45
Methodfrom_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
Methodfrom_registry_with_default
( registry: &LintRegistry, default_severity: Option<Severity>, )
crates/ty_python_semantic/src/lint.rs:623
Functionfrom_relative_import_missing_alias_suggests_as
()
crates/ty_ide/src/completion.rs:8878
Methodfrom_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
Methodfrom_resolver
(db: &'db dyn Db, resolver: PlaceLoadResolver<'db, '_>)
crates/ty_python_semantic/src/place/definitions.rs:51
Methodfrom_rule
(rule: &'a Rule)
crates/ruff/src/commands/rule.rs:33
Methodfrom_rule
(rule: Rule)
crates/ruff_linter/src/registry/rule_set.rs:28
Methodfrom_rule_selectors
( extend_safe_fixes: &[UnresolvedRuleSelector], extend_unsafe_fixes: &[UnresolvedRuleSelector]
crates/ruff_linter/src/settings/fix_safety_table.rs:44
Methodfrom_rules
(rules: &[Rule])
crates/ruff_linter/src/registry/rule_set.rs:50
Methodfrom_schema_items
(db: &'db dyn Db, items: TypedDictSchema<'db>)
crates/ty_python_semantic/src/types/typed_dict.rs:629
Methodfrom_schema_items_with_openness
Creates a synthesized schema while preserving its undeclared-item policy.
crates/ty_python_semantic/src/types/typed_dict.rs:634
Methodfrom_scope
Creates an environment that lazily obtains its program from `scope`.
crates/ty_python_semantic/src/types/context.rs:59
Methodfrom_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
Methodfrom_section
(section: &SectionContext)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:493
Methodfrom_sections
(sections: &'a SectionContexts, style: Option<SectionStyle>)
crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs:574
Methodfrom_selector
(unresolved: &UnresolvedRuleSelector, kind: RuleResolutionErrorKind)
crates/ruff_linter/src/rule_selector.rs:87
Methodfrom_semantic_completion
( db: &'db dyn Db, env: &ProgramEnvironment<'db>, semantic: SemanticCompletion<'db>,
crates/ty_ide/src/completion.rs:450
Methodfrom_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
Methodfrom_settings
Creates a program from settings whose search roots have already been registered.
crates/ty_python_core/src/program.rs:30
Methodfrom_settings
(settings: &LinterSettings)
crates/ruff_linter/src/directives.rs:29
Methodfrom_signatures
( source: &Signature<'db>, target: &Signature<'db>, relation: TypeRelation, ty
crates/ty_python_semantic/src/types/signatures.rs:866
Methodfrom_slice
(slice: &'slice [OperandOrOperator<'a>])
crates/ruff_python_formatter/src/expression/binary_like.rs:535
← previousnext →21,101–21,200 of 31,562, ranked by callers