Skip to content

Commit

Permalink
Discard changes to crates/ruff_linter/src/rules/pydocstyle/rules/ends…
Browse files Browse the repository at this point in the history
…_with_punctuation.rs
  • Loading branch information
MichaReiser authored Sep 20, 2024
1 parent c297429 commit 35077e2
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<String> {
Some("Add closing punctuation".to_string())
fn fix_title(&self) -> String {
"Add closing punctuation".to_string()
}
}

Expand Down

0 comments on commit 35077e2

Please # to comment.