diff --git a/crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs b/crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs index 4b7ae2633e82e..6f8cf9ef2f3b0 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs +++ b/crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs @@ -1,7 +1,7 @@ use ruff_text_size::TextLen; use strum::IntoEnumIterator; -use ruff_diagnostics::{Diagnostic, Edit, Fix, FixAvailability, Violation}; +use ruff_diagnostics::{AlwaysFixableViolation, Diagnostic, Edit, Fix}; use ruff_macros::{derive_message_formats, violation}; use ruff_source_file::{UniversalNewlineIterator, UniversalNewlines}; use ruff_text_size::Ranged; @@ -46,18 +46,14 @@ use crate::rules::pydocstyle::helpers::logical_line; #[violation] pub struct EndsInPunctuation; -impl Violation for EndsInPunctuation { - /// `None` in the case a fix is never available or otherwise Some - /// [`FixAvailability`] describing the available fix. - const FIX_AVAILABILITY: FixAvailability = FixAvailability::Sometimes; - +impl AlwaysFixableViolation for EndsInPunctuation { #[derive_message_formats] fn message(&self) -> String { format!("First line should end with a period, question mark, or exclamation point") } - fn fix_title(&self) -> Option { - Some("Add closing punctuation".to_string()) + fn fix_title(&self) -> String { + "Add closing punctuation".to_string() } }