Skip to main content

Crate ruff_linter

Crate ruff_linter 

Source
Expand description

This is the library for the Ruff Python linter.

The API is currently completely unstable and subject to change drastically.

Re-exports§

pub use rule_selector::RuleSelector;
pub use rule_selector::UnresolvedRuleSelector;

Modules§

codes
directives
Extract # noqa, # isort: skip, and # TODO directives from tokenized source.
fs
line_width
linter
logging
message
package
packaging
Detect Python package roots and file associations.
preview
Helpers to test if a specific preview style is enabled or not.
registry
Remnant of the registry of all Rule implementations, now it’s reexporting from codes.rs with some helper symbols
rule_selector
rules
settings
Effective program settings, taking into account pyproject.toml and command-line options. Structure is optimized for internal usage, as opposed to external visibility or parsing.
source_kind
suppression
toml
upstream_categories
This module should probably not exist in this shape or form.

Macros§

display_settings
display_settings! is a macro that can display and format struct fields in a readable, namespaced format. It’s particularly useful at generating Display implementations for types used in settings.
notify_user
warn_user
warn_user_once
Warn a user once, with uniqueness determined by the calling location itself.
warn_user_once_by_id
Warn a user once, with uniqueness determined by the given ID.
warn_user_once_by_message
Warn a user once, if warnings are enabled, with uniqueness determined by the content of the message.

Structs§

IOError
What it does
Locator

Enums§

FixAvailability
SuppressionKind
The kind of suppression comment to be added to suppress a diagnostic.

Constants§

RUFF_PKG_VERSION
VERSION

Traits§

AlwaysFixableViolation
This trait exists just to make implementing the Violation trait more convenient for violations that can always be fixed.
Violation
ViolationMetadata

Functions§

generate_suppression_edits
Generates an array of edits that matches the length of diagnostics. Each potential edit in the array is paired, in order, with the associated diagnostic. Each edit will add a suppression comment to the appropriate line in the source to hide the diagnostic. These edits may conflict with each other and should not be applied simultaneously.