mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 22:54:42 +00:00
Upgrade Rust toolchain to 1.84.0 (#15408)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
This commit is contained in:
parent
2d82445794
commit
c39ca8fe6d
18 changed files with 36 additions and 45 deletions
|
@ -540,7 +540,7 @@ fn is_docstring_section(
|
|||
// The return value of the function.
|
||||
// """
|
||||
// ```
|
||||
if previous_line.map_or(false, |line| line.trim().is_empty()) {
|
||||
if previous_line.is_some_and(|line| line.trim().is_empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ pub(crate) fn fix_file(
|
|||
diagnostic
|
||||
.fix
|
||||
.as_ref()
|
||||
.map_or(false, |fix| fix.applies(required_applicability))
|
||||
.is_some_and(|fix| fix.applies(required_applicability))
|
||||
})
|
||||
.peekable();
|
||||
|
||||
|
|
|
@ -78,11 +78,7 @@ impl<'a> Directive<'a> {
|
|||
comment_start = text[..comment_start].trim_end().len();
|
||||
|
||||
// The next character has to be the `#` character.
|
||||
if text[..comment_start]
|
||||
.chars()
|
||||
.last()
|
||||
.map_or(true, |c| c != '#')
|
||||
{
|
||||
if !text[..comment_start].ends_with('#') {
|
||||
continue;
|
||||
}
|
||||
comment_start -= '#'.len_utf8();
|
||||
|
|
|
@ -493,7 +493,7 @@ pub(crate) fn f_strings(checker: &mut Checker, call: &ast::ExprCall, summary: &F
|
|||
checker
|
||||
.semantic()
|
||||
.resolve_qualified_name(call.func.as_ref())
|
||||
.map_or(false, |qualified_name| {
|
||||
.is_some_and(|qualified_name| {
|
||||
matches!(
|
||||
qualified_name.segments(),
|
||||
["django", "utils", "translation", "gettext" | "gettext_lazy"]
|
||||
|
|
|
@ -145,7 +145,7 @@ pub(crate) fn super_call_with_parameters(checker: &mut Checker, call: &ast::Expr
|
|||
.resolve_qualified_name(func)
|
||||
.is_some_and(|name| name.segments() == ["dataclasses", "dataclass"])
|
||||
{
|
||||
arguments.find_keyword("slots").map_or(false, |keyword| {
|
||||
arguments.find_keyword("slots").is_some_and(|keyword| {
|
||||
matches!(
|
||||
keyword.value,
|
||||
Expr::BooleanLiteral(ast::ExprBooleanLiteral { value: true, .. })
|
||||
|
|
|
@ -117,7 +117,7 @@ fn in_subscript_index(expr: &ExprSubscript, semantic: &SemanticModel) -> bool {
|
|||
}
|
||||
|
||||
// E.g., `Generic[DType, Unpack[int]]`.
|
||||
if parent.slice.as_tuple_expr().map_or(false, |slice| {
|
||||
if parent.slice.as_tuple_expr().is_some_and(|slice| {
|
||||
slice
|
||||
.elts
|
||||
.iter()
|
||||
|
@ -144,5 +144,5 @@ fn in_vararg(expr: &ExprSubscript, semantic: &SemanticModel) -> bool {
|
|||
.as_ref()
|
||||
.and_then(|vararg| vararg.annotation.as_ref())
|
||||
.and_then(|annotation| annotation.as_subscript_expr())
|
||||
.map_or(false, |annotation| annotation == expr)
|
||||
== Some(expr)
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ pub(crate) fn print_empty_string(checker: &mut Checker, call: &ast::ExprCall) {
|
|||
let empty_separator = call
|
||||
.arguments
|
||||
.find_keyword("sep")
|
||||
.map_or(false, |keyword| is_empty_string(&keyword.value));
|
||||
.is_some_and(|keyword| is_empty_string(&keyword.value));
|
||||
if !empty_separator {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue