diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d25d867b0f..e29168b31c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: - black==25.1.0 - repo: https://github.com/crate-ci/typos - rev: v1.29.7 + rev: v1.30.0 hooks: - id: typos @@ -74,7 +74,7 @@ repos: pass_filenames: false # This makes it a lot faster - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.6 + rev: v0.9.9 hooks: - id: ruff-format - id: ruff @@ -84,7 +84,7 @@ repos: # Prettier - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.5.1 + rev: v3.5.2 hooks: - id: prettier types: [yaml] @@ -92,12 +92,12 @@ repos: # zizmor detects security vulnerabilities in GitHub Actions workflows. # Additional configuration for the tool is found in `.github/zizmor.yml` - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.3.1 + rev: v1.4.1 hooks: - id: zizmor - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-github-workflows diff --git a/_typos.toml b/_typos.toml index 7a6abdad8e..2f38f52eea 100644 --- a/_typos.toml +++ b/_typos.toml @@ -23,6 +23,10 @@ extend-ignore-re = [ # Line ignore with trailing "spellchecker:disable-line" "(?Rm)^.*#\\s*spellchecker:disable-line$", "LICENSEs", + # Various third party dependencies uses `typ` as struct field names (e.g., lsp_types::LogMessageParams) + "typ", + # TODO: Remove this once the `TYP` redirects are removed from `rule_redirects.rs` + "TYP", ] [default.extend-identifiers] diff --git a/crates/ruff_annotate_snippets/src/renderer/display_list.rs b/crates/ruff_annotate_snippets/src/renderer/display_list.rs index 95b0a98639..022e1943c3 100644 --- a/crates/ruff_annotate_snippets/src/renderer/display_list.rs +++ b/crates/ruff_annotate_snippets/src/renderer/display_list.rs @@ -1251,25 +1251,25 @@ fn fold_body(body: Vec>) -> Vec> { const INNER_UNFOLD_SIZE: usize = INNER_CONTEXT * 2 + 1; let mut lines = vec![]; - let mut unhighlighed_lines = vec![]; + let mut unhighlighted_lines = vec![]; for line in body { match &line { DisplayLine::Source { annotations, .. } => { if annotations.is_empty() { - unhighlighed_lines.push(line); + unhighlighted_lines.push(line); } else { if lines.is_empty() { - // Ignore leading unhighlighed lines - unhighlighed_lines.clear(); + // Ignore leading unhighlighted lines + unhighlighted_lines.clear(); } - match unhighlighed_lines.len() { + match unhighlighted_lines.len() { 0 => {} n if n <= INNER_UNFOLD_SIZE => { // Rather than render our cut indicator, don't fold - lines.append(&mut unhighlighed_lines); + lines.append(&mut unhighlighted_lines); } _ => { - lines.extend(unhighlighed_lines.drain(..INNER_CONTEXT)); + lines.extend(unhighlighted_lines.drain(..INNER_CONTEXT)); let inline_marks = lines .last() .and_then(|line| { @@ -1287,16 +1287,16 @@ fn fold_body(body: Vec>) -> Vec> { lines.push(DisplayLine::Fold { inline_marks: inline_marks.clone(), }); - unhighlighed_lines - .drain(..unhighlighed_lines.len().saturating_sub(INNER_CONTEXT)); - lines.append(&mut unhighlighed_lines); + unhighlighted_lines + .drain(..unhighlighted_lines.len().saturating_sub(INNER_CONTEXT)); + lines.append(&mut unhighlighted_lines); } } lines.push(line); } } _ => { - unhighlighed_lines.push(line); + unhighlighted_lines.push(line); } } } diff --git a/crates/ruff_linter/src/rules/flake8_bandit/rules/jinja2_autoescape_false.rs b/crates/ruff_linter/src/rules/flake8_bandit/rules/jinja2_autoescape_false.rs index 7891f9388f..988ad15774 100644 --- a/crates/ruff_linter/src/rules/flake8_bandit/rules/jinja2_autoescape_false.rs +++ b/crates/ruff_linter/src/rules/flake8_bandit/rules/jinja2_autoescape_false.rs @@ -60,8 +60,8 @@ pub(crate) fn jinja2_autoescape_false(checker: &Checker, call: &ast::ExprCall) { if checker .semantic() .resolve_qualified_name(&call.func) - .is_some_and(|qualifieed_name| { - matches!(qualifieed_name.segments(), ["jinja2", "Environment"]) + .is_some_and(|qualified_name| { + matches!(qualified_name.segments(), ["jinja2", "Environment"]) }) { if let Some(keyword) = call.arguments.find_keyword("autoescape") { diff --git a/crates/ruff_linter/src/rules/flake8_todos/rules/todos.rs b/crates/ruff_linter/src/rules/flake8_todos/rules/todos.rs index e9f482804b..9b4698d36a 100644 --- a/crates/ruff_linter/src/rules/flake8_todos/rules/todos.rs +++ b/crates/ruff_linter/src/rules/flake8_todos/rules/todos.rs @@ -299,7 +299,7 @@ pub(crate) fn todos( has_issue_link = true; } - // If the next_comment isn't a tag or an issue, it's worthles in the context of this + // If the next_comment isn't a tag or an issue, it's worthless in the context of this // linter. We can increment here instead of waiting for the next iteration of the outer // loop. curr_range = next_range; diff --git a/crates/ruff_linter/src/rules/refurb/rules/fromisoformat_replace_z.rs b/crates/ruff_linter/src/rules/refurb/rules/fromisoformat_replace_z.rs index 010aaaa2b6..b89dcb7c6c 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/fromisoformat_replace_z.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/fromisoformat_replace_z.rs @@ -239,7 +239,7 @@ fn strip_z_date(call: &ExprCall) -> Option<(&Expr, &Expr)> { Some((value, func)) } -/// Returns `Some` if this is a subscribt with the form `date[:-1] + "-00"`. +/// Returns `Some` if this is a subscript with the form `date[:-1] + "-00"`. fn slice_minus_1_date(subscript: &ExprSubscript) -> Option<&Expr> { let ExprSubscript { value, slice, .. } = subscript; let slice = slice.as_slice_expr()?;