Bump MSRV to Rust 1.80 (#13826)

This commit is contained in:
Micha Reiser 2024-10-20 10:55:36 +02:00 committed by GitHub
parent 075e378b0f
commit 27c50bebec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 110 additions and 133 deletions

View file

@ -1,5 +1,5 @@
use once_cell::sync::Lazy;
use regex::Regex;
use std::sync::LazyLock;
use ruff_diagnostics::{AlwaysFixableViolation, Diagnostic, Edit, Fix};
use ruff_macros::{derive_message_formats, violation};
@ -98,8 +98,8 @@ impl AlwaysFixableViolation for NoBlankLineAfterFunction {
}
}
static INNER_FUNCTION_OR_CLASS_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"^\s+(?:(?:class|def|async def)\s|@)").unwrap());
static INNER_FUNCTION_OR_CLASS_REGEX: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^\s+(?:(?:class|def|async def)\s|@)").unwrap());
/// D201, D202
pub(crate) fn blank_before_after_function(checker: &mut Checker, docstring: &Docstring) {

View file

@ -1,5 +1,6 @@
use std::sync::LazyLock;
use imperative::Mood;
use once_cell::sync::Lazy;
use ruff_diagnostics::{Diagnostic, Violation};
use ruff_macros::{derive_message_formats, violation};
@ -12,7 +13,7 @@ use crate::docstrings::Docstring;
use crate::rules::pydocstyle::helpers::normalize_word;
use crate::rules::pydocstyle::settings::Settings;
static MOOD: Lazy<Mood> = Lazy::new(Mood::new);
static MOOD: LazyLock<Mood> = LazyLock::new(Mood::new);
/// ## What it does
/// Checks for docstring first lines that are not in an imperative mood.

View file

@ -1,7 +1,7 @@
use itertools::Itertools;
use once_cell::sync::Lazy;
use regex::Regex;
use rustc_hash::FxHashSet;
use std::sync::LazyLock;
use ruff_diagnostics::{AlwaysFixableViolation, Violation};
use ruff_diagnostics::{Diagnostic, Edit, Fix};
@ -1846,8 +1846,8 @@ fn missing_args(checker: &mut Checker, docstring: &Docstring, docstrings_args: &
}
// See: `GOOGLE_ARGS_REGEX` in `pydocstyle/checker.py`.
static GOOGLE_ARGS_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"^\s*(\*?\*?\w+)\s*(\(.*?\))?\s*:(\r\n|\n)?\s*.+").unwrap());
static GOOGLE_ARGS_REGEX: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"^\s*(\*?\*?\w+)\s*(\(.*?\))?\s*:(\r\n|\n)?\s*.+").unwrap());
fn args_section(context: &SectionContext) -> FxHashSet<String> {
let mut following_lines = context.following_lines().peekable();