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# TODOdirectives 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
Ruleimplementations, 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 generatingDisplayimplementations 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§
Enums§
- FixAvailability
- Suppression
Kind - The kind of suppression comment to be added to suppress a diagnostic.
Constants§
Traits§
- Always
Fixable Violation - This trait exists just to make implementing the
Violationtrait more convenient for violations that can always be fixed. - Violation
- Violation
Metadata
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.