From 35077e27a824afd1de52c757c8a526a078c5b5d2 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 20 Sep 2024 12:48:14 +0200 Subject: [PATCH] Discard changes to crates/ruff_linter/src/rules/pydocstyle/rules/ends_with_punctuation.rs --- .../rules/pydocstyle/rules/ends_with_punctuation.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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() } }