diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee76a861b9..c7f744da74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ exclude: | repos: - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.24 + rev: v0.24.1 hooks: - id: validate-pyproject @@ -60,7 +60,7 @@ repos: - black==25.1.0 - repo: https://github.com/crate-ci/typos - rev: v1.30.2 + rev: v1.31.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.11.0 + rev: v0.11.2 hooks: - id: ruff-format - id: ruff @@ -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.5.1 + rev: v1.5.2 hooks: - id: zizmor - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.1 hooks: - id: check-github-workflows diff --git a/crates/red_knot_project/src/combine.rs b/crates/red_knot_project/src/combine.rs index 0d035be839..659c23df5c 100644 --- a/crates/red_knot_project/src/combine.rs +++ b/crates/red_knot_project/src/combine.rs @@ -43,7 +43,7 @@ use ruff_python_ast::PythonVersion; /// resolved extra search path of `["b", "c", "a"]`, which means `a` will be tried last. /// /// There's an argument here that the user should be able to specify the order of the paths, -/// because only then is the user in full control of where to insert the path when specyifing `extra-paths` +/// because only then is the user in full control of where to insert the path when specifying `extra-paths` /// in multiple sources. /// /// ## Macro diff --git a/crates/red_knot_python_semantic/src/types.rs b/crates/red_knot_python_semantic/src/types.rs index eac89fe2e2..64032b633b 100644 --- a/crates/red_knot_python_semantic/src/types.rs +++ b/crates/red_knot_python_semantic/src/types.rs @@ -126,7 +126,7 @@ fn definition_expression_type<'db>( } } -/// The descriptor protocol distiguishes two kinds of descriptors. Non-data descriptors +/// The descriptor protocol distinguishes two kinds of descriptors. Non-data descriptors /// define a `__get__` method, while data descriptors additionally define a `__set__` /// method or a `__delete__` method. This enum is used to categorize attributes into two /// groups: (1) data descriptors and (2) normal attributes or non-data descriptors. diff --git a/crates/red_knot_server/src/edit/notebook.rs b/crates/red_knot_server/src/edit/notebook.rs index 452263264f..d71ada7808 100644 --- a/crates/red_knot_server/src/edit/notebook.rs +++ b/crates/red_knot_server/src/edit/notebook.rs @@ -118,7 +118,7 @@ impl NotebookDocument { // This is required because of the way the `NotebookCell` is modelled. We include // the `TextDocument` within the `NotebookCell` so when it's deleted, the // corresponding `TextDocument` is removed as well. But, when cells are - // re-oredered, the change request doesn't provide the actual contents of the cell. + // re-ordered, the change request doesn't provide the actual contents of the cell. // Instead, it only provides that (a) these cell URIs were removed, and (b) these // cell URIs were added. // https://github.com/astral-sh/ruff/issues/12573 diff --git a/crates/ruff/src/commands/add_noqa.rs b/crates/ruff/src/commands/add_noqa.rs index 582ce69501..c5a417ec3c 100644 --- a/crates/ruff/src/commands/add_noqa.rs +++ b/crates/ruff/src/commands/add_noqa.rs @@ -26,7 +26,7 @@ pub(crate) fn add_noqa( let start = Instant::now(); let (paths, resolver) = python_files_in_path(files, pyproject_config, config_arguments)?; let duration = start.elapsed(); - debug!("Identified files to lint in: {:?}", duration); + debug!("Identified files to lint in: {duration:?}"); if paths.is_empty() { warn_user_once!("No Python files found under the given path(s)"); @@ -87,7 +87,7 @@ pub(crate) fn add_noqa( .sum(); let duration = start.elapsed(); - debug!("Added noqa to files in: {:?}", duration); + debug!("Added noqa to files in: {duration:?}"); Ok(modifications) } diff --git a/crates/ruff/src/commands/check.rs b/crates/ruff/src/commands/check.rs index 56436fed52..98cf0b5281 100644 --- a/crates/ruff/src/commands/check.rs +++ b/crates/ruff/src/commands/check.rs @@ -174,7 +174,7 @@ pub(crate) fn check( caches.persist()?; let duration = start.elapsed(); - debug!("Checked {:?} files in: {:?}", checked_files, duration); + debug!("Checked {checked_files:?} files in: {duration:?}"); Ok(all_diagnostics) } diff --git a/crates/ruff/src/lib.rs b/crates/ruff/src/lib.rs index 882240b3b6..9c60eb5625 100644 --- a/crates/ruff/src/lib.rs +++ b/crates/ruff/src/lib.rs @@ -290,8 +290,8 @@ pub fn check(args: CheckCommand, global_options: GlobalConfigArgs) -> Result { // 3 │ X0 Y0 Z0 // │ ┏━━━━━┛ │ │ < We are writing these lines // │ ┃┌───────┘ │ < by reverting the "depth" of - // │ ┃│┌─────────┘ < their multilne spans. + // │ ┃│┌─────────┘ < their multiline spans. // 4 │ ┃││ X1 Y1 Z1 // 5 │ ┃││ X2 Y2 Z2 // │ ┃│└────╿──│──┘ `Z` label diff --git a/crates/ruff_linter/src/rules/isort/categorize.rs b/crates/ruff_linter/src/rules/isort/categorize.rs index cb607b39df..1e5d39b3fc 100644 --- a/crates/ruff_linter/src/rules/isort/categorize.rs +++ b/crates/ruff_linter/src/rules/isort/categorize.rs @@ -146,10 +146,7 @@ pub(crate) fn categorize<'a>( reason = Reason::DisabledSection(import_type); import_type = default_section; } - debug!( - "Categorized '{}' as {:?} ({:?})", - module_name, import_type, reason - ); + debug!("Categorized '{module_name}' as {import_type:?} ({reason:?})"); import_type } diff --git a/crates/ruff_python_formatter/src/comments/map.rs b/crates/ruff_python_formatter/src/comments/map.rs index 4c3fa1b218..e7be3d7a5f 100644 --- a/crates/ruff_python_formatter/src/comments/map.rs +++ b/crates/ruff_python_formatter/src/comments/map.rs @@ -505,7 +505,7 @@ impl InOrderEntry { #[derive(Clone, Debug)] struct OutOfOrderEntry { - /// Index into the [`MultiMap::out_of_order`] vector at which offset the leaading vec is stored. + /// Index into the [`MultiMap::out_of_order`] vector at which offset the leading vec is stored. leading_index: usize, _count: Count, } diff --git a/crates/ruff_python_parser/CONTRIBUTING.md b/crates/ruff_python_parser/CONTRIBUTING.md index 0a5c580121..90209ada78 100644 --- a/crates/ruff_python_parser/CONTRIBUTING.md +++ b/crates/ruff_python_parser/CONTRIBUTING.md @@ -71,7 +71,7 @@ script for more information or use the `--help` flag to see the available option #### CI The fuzzer is run as part of the CI pipeline. The purpose of running the fuzzer in the CI is to -catch any regresssions introduced by any new changes to the parser. This is why the fuzzer is run on +catch any regressions introduced by any new changes to the parser. This is why the fuzzer is run on the same set of seeds on every run. ## Benchmarks diff --git a/crates/ruff_python_resolver/src/lib.rs b/crates/ruff_python_resolver/src/lib.rs index 91993cadef..3cebaecdb7 100644 --- a/crates/ruff_python_resolver/src/lib.rs +++ b/crates/ruff_python_resolver/src/lib.rs @@ -625,7 +625,7 @@ mod tests { let result = resolve_options(file2, "file1", root, ResolverOptions::default()); - debug!("result: {:?}", result); + debug!("result: {result:?}"); assert!(!result.is_import_found); diff --git a/crates/ruff_python_resolver/src/resolver.rs b/crates/ruff_python_resolver/src/resolver.rs index 7bbab3535f..22228d3496 100644 --- a/crates/ruff_python_resolver/src/resolver.rs +++ b/crates/ruff_python_resolver/src/resolver.rs @@ -392,7 +392,7 @@ fn resolve_best_absolute_import( if allow_pyi && !module_descriptor.name_parts.is_empty() { // Check for a stdlib typeshed file. - debug!("Looking for typeshed stdlib path: {}", import_name); + debug!("Looking for typeshed stdlib path: {import_name}"); if let Some(mut typeshed_stdilib_import) = find_typeshed_path(module_descriptor, true, config, host) { @@ -401,7 +401,7 @@ fn resolve_best_absolute_import( } // Check for a third-party typeshed file. - debug!("Looking for typeshed third-party path: {}", import_name); + debug!("Looking for typeshed third-party path: {import_name}"); if let Some(mut typeshed_third_party_import) = find_typeshed_path(module_descriptor, false, config, host) { diff --git a/crates/ruff_server/src/edit/notebook.rs b/crates/ruff_server/src/edit/notebook.rs index 452263264f..d71ada7808 100644 --- a/crates/ruff_server/src/edit/notebook.rs +++ b/crates/ruff_server/src/edit/notebook.rs @@ -118,7 +118,7 @@ impl NotebookDocument { // This is required because of the way the `NotebookCell` is modelled. We include // the `TextDocument` within the `NotebookCell` so when it's deleted, the // corresponding `TextDocument` is removed as well. But, when cells are - // re-oredered, the change request doesn't provide the actual contents of the cell. + // re-ordered, the change request doesn't provide the actual contents of the cell. // Instead, it only provides that (a) these cell URIs were removed, and (b) these // cell URIs were added. // https://github.com/astral-sh/ruff/issues/12573 diff --git a/crates/ruff_workspace/src/pyproject.rs b/crates/ruff_workspace/src/pyproject.rs index 5693922eaf..cbee2032f9 100644 --- a/crates/ruff_workspace/src/pyproject.rs +++ b/crates/ruff_workspace/src/pyproject.rs @@ -209,7 +209,7 @@ fn get_fallback_target_version(dir: &Path) -> Option { let pyproject = match parsed_pyproject { Ok(pyproject) => pyproject, Err(err) => { - debug!("Failed to find fallback `target-version` due to: {}", err); + debug!("Failed to find fallback `target-version` due to: {err}"); return None; } }; diff --git a/crates/ruff_workspace/src/resolver.rs b/crates/ruff_workspace/src/resolver.rs index 1965f1c19a..918bb81250 100644 --- a/crates/ruff_workspace/src/resolver.rs +++ b/crates/ruff_workspace/src/resolver.rs @@ -578,18 +578,18 @@ impl ParallelVisitor for PythonFilesVisitor<'_, '_> { &file_basename, &settings.file_resolver.exclude, ) { - debug!("Ignored path via `exclude`: {:?}", path); + debug!("Ignored path via `exclude`: {path:?}"); return WalkState::Skip; } else if match_candidate_exclusion( &file_path, &file_basename, &settings.file_resolver.extend_exclude, ) { - debug!("Ignored path via `extend-exclude`: {:?}", path); + debug!("Ignored path via `extend-exclude`: {path:?}"); return WalkState::Skip; } } else { - debug!("Ignored path due to error in parsing: {:?}", path); + debug!("Ignored path due to error in parsing: {path:?}"); return WalkState::Skip; } } @@ -641,10 +641,10 @@ impl ParallelVisitor for PythonFilesVisitor<'_, '_> { let resolver = self.global.resolver.read().unwrap(); let settings = resolver.resolve(path); if settings.file_resolver.include.is_match(path) { - debug!("Included path via `include`: {:?}", path); + debug!("Included path via `include`: {path:?}"); Some(ResolvedFile::Nested(entry.into_path())) } else if settings.file_resolver.extend_include.is_match(path) { - debug!("Included path via `extend-include`: {:?}", path); + debug!("Included path via `extend-include`: {path:?}"); Some(ResolvedFile::Nested(entry.into_path())) } else { None @@ -765,14 +765,14 @@ fn is_file_excluded(path: &Path, resolver: &Resolver) -> bool { &file_basename, &settings.file_resolver.exclude, ) { - debug!("Ignored path via `exclude`: {:?}", path); + debug!("Ignored path via `exclude`: {path:?}"); return true; } else if match_candidate_exclusion( &file_path, &file_basename, &settings.file_resolver.extend_exclude, ) { - debug!("Ignored path via `extend-exclude`: {:?}", path); + debug!("Ignored path via `extend-exclude`: {path:?}"); return true; } } else {