diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 637134b0f9..15656efe73 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -17,4 +17,4 @@ MD013: false # MD024/no-duplicate-heading MD024: # Allow when nested under different parents e.g. CHANGELOG.md - allow_different_nesting: true + siblings_only: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8759c00026..fc1b4822f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ exclude: | repos: - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.15 + rev: v0.16 hooks: - id: validate-pyproject @@ -31,7 +31,7 @@ repos: )$ - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.37.0 + rev: v0.39.0 hooks: - id: markdownlint-fix exclude: | @@ -41,7 +41,7 @@ repos: )$ - repo: https://github.com/crate-ci/typos - rev: v1.16.22 + rev: v1.19.0 hooks: - id: typos @@ -55,7 +55,7 @@ repos: pass_filenames: false # This makes it a lot faster - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.3.4 hooks: - id: ruff-format - id: ruff @@ -70,7 +70,7 @@ repos: # Prettier - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v3.1.0 hooks: - id: prettier types: [yaml] diff --git a/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap b/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap index 1c0402e163..adff7742ce 100644 --- a/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap +++ b/crates/ruff/tests/snapshots/show_settings__display_default_settings.snap @@ -50,6 +50,7 @@ file_resolver.exclude = [ "venv", ] file_resolver.extend_exclude = [ + "crates/ruff/resources/", "crates/ruff_linter/resources/", "crates/ruff_python_formatter/resources/", ] diff --git a/crates/ruff_python_ast/tests/preorder.rs b/crates/ruff_python_ast/tests/preorder.rs index b3b1f457f8..21a159b424 100644 --- a/crates/ruff_python_ast/tests/preorder.rs +++ b/crates/ruff_python_ast/tests/preorder.rs @@ -158,7 +158,7 @@ fn trace_preorder_visitation(source: &str) -> String { } /// Emits a `tree` with a node for every visited AST node (labelled by the AST node's kind) -/// and leafs for attributes. +/// and leaves for attributes. #[derive(Default)] struct RecordVisitor { depth: usize, diff --git a/crates/ruff_python_ast/tests/visitor.rs b/crates/ruff_python_ast/tests/visitor.rs index 1097d699a9..e039e78d96 100644 --- a/crates/ruff_python_ast/tests/visitor.rs +++ b/crates/ruff_python_ast/tests/visitor.rs @@ -181,7 +181,7 @@ where } /// Emits a `tree` with a node for every visited AST node (labelled by the AST node's kind) -/// and leafs for attributes. +/// and leaves for attributes. #[derive(Default)] struct RecordVisitor { depth: usize, diff --git a/pyproject.toml b/pyproject.toml index c1db0a8585..fdcf414dbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,10 +58,17 @@ include = [ [tool.ruff] extend-exclude = [ + "crates/ruff/resources/", "crates/ruff_linter/resources/", "crates/ruff_python_formatter/resources/" ] +[tool.ruff.lint] +ignore = [ + # Conflicts with the formatter + "COM812", "ISC001" +] + [tool.black] force-exclude = ''' /( diff --git a/python/ruff-ecosystem/ruff_ecosystem/check.py b/python/ruff-ecosystem/ruff_ecosystem/check.py index 983133b9a2..bebbe97a62 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/check.py +++ b/python/ruff-ecosystem/ruff_ecosystem/check.py @@ -1,6 +1,7 @@ """ Execution, comparison, and summary of `ruff check` ecosystem checks. """ + from __future__ import annotations import asyncio diff --git a/python/ruff-ecosystem/ruff_ecosystem/defaults.py b/python/ruff-ecosystem/ruff_ecosystem/defaults.py index bf096046fb..e6d130d015 100644 --- a/python/ruff-ecosystem/ruff_ecosystem/defaults.py +++ b/python/ruff-ecosystem/ruff_ecosystem/defaults.py @@ -1,6 +1,7 @@ """ Default projects for ecosystem checks """ + from ruff_ecosystem.projects import ( CheckOptions, FormatOptions, diff --git a/scripts/add_plugin.py b/scripts/add_plugin.py index e930398c65..1e12e47e6b 100755 --- a/scripts/add_plugin.py +++ b/scripts/add_plugin.py @@ -8,6 +8,7 @@ Example usage: --url https://pypi.org/project/flake8-pie/ \ --prefix PIE """ + from __future__ import annotations import argparse diff --git a/scripts/add_rule.py b/scripts/add_rule.py index bfc61b733e..42928fb7aa 100755 --- a/scripts/add_rule.py +++ b/scripts/add_rule.py @@ -9,6 +9,7 @@ Example usage: --code 807 \ --linter flake8-pie """ + from __future__ import annotations import argparse diff --git a/scripts/check_docs_formatted.py b/scripts/check_docs_formatted.py index c25e3d1929..96f6ec3a74 100755 --- a/scripts/check_docs_formatted.py +++ b/scripts/check_docs_formatted.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """Check code snippets in docs are formatted by black.""" + from __future__ import annotations import argparse diff --git a/scripts/check_ecosystem.py b/scripts/check_ecosystem.py index f13d623391..cc8206673f 100755 --- a/scripts/check_ecosystem.py +++ b/scripts/check_ecosystem.py @@ -9,6 +9,7 @@ Example usage: scripts/check_ecosystem.py """ + from __future__ import annotations import argparse diff --git a/scripts/ecosystem_all_check.py b/scripts/ecosystem_all_check.py index 8882142e85..7d3c2e5cfe 100644 --- a/scripts/ecosystem_all_check.py +++ b/scripts/ecosystem_all_check.py @@ -3,6 +3,7 @@ panics, fix errors and similar problems. It's a less elaborate, more hacky version of check_ecosystem.py """ + from __future__ import annotations import json diff --git a/scripts/generate_known_standard_library.py b/scripts/generate_known_standard_library.py index f35a714d0e..559663b16d 100644 --- a/scripts/generate_known_standard_library.py +++ b/scripts/generate_known_standard_library.py @@ -5,6 +5,7 @@ Source: Only the generation of the file has been modified for use in this project. """ + from __future__ import annotations from pathlib import Path diff --git a/scripts/generate_mkdocs.py b/scripts/generate_mkdocs.py index 2b61daec3e..5085f4400b 100644 --- a/scripts/generate_mkdocs.py +++ b/scripts/generate_mkdocs.py @@ -1,4 +1,5 @@ """Generate an MkDocs-compatible `docs` and `mkdocs.yml` from the README.md.""" + from __future__ import annotations import argparse diff --git a/scripts/transform_readme.py b/scripts/transform_readme.py index 7170eef20f..63f5c00267 100644 --- a/scripts/transform_readme.py +++ b/scripts/transform_readme.py @@ -4,6 +4,7 @@ By default, we assume that our README.md will be rendered on GitHub. However, di targets have different strategies for rendering light- and dark-mode images. This script adjusts the images in the README.md to support the given target. """ + from __future__ import annotations import argparse diff --git a/scripts/update_ambiguous_characters.py b/scripts/update_ambiguous_characters.py index 17347009ce..24143adaab 100644 --- a/scripts/update_ambiguous_characters.py +++ b/scripts/update_ambiguous_characters.py @@ -1,4 +1,5 @@ """Generate the confusables.rs file from the VS Code ambiguous.json file.""" + from __future__ import annotations import json diff --git a/scripts/update_schemastore.py b/scripts/update_schemastore.py index 7f45f9b331..967ca7b75b 100644 --- a/scripts/update_schemastore.py +++ b/scripts/update_schemastore.py @@ -4,6 +4,7 @@ This script will clone astral-sh/schemastore, update the schema and push the cha to a new branch tagged with the ruff git hash. You should see a URL to create the PR to schemastore in the CLI. """ + from __future__ import annotations import json