From c0259e7bf2e3cd7932431a1f96c57249f646b8ee Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 17:18:38 +0000 Subject: [PATCH] Update dependency ruff to v0.9.1 (#15432) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood --- docs/requirements-insiders.txt | 2 +- docs/requirements.txt | 2 +- scripts/check_docs_formatted.py | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/requirements-insiders.txt b/docs/requirements-insiders.txt index 74456f55bef3a..a092310c5b842 100644 --- a/docs/requirements-insiders.txt +++ b/docs/requirements-insiders.txt @@ -1,5 +1,5 @@ PyYAML==6.0.2 -ruff==0.8.6 +ruff==0.9.1 mkdocs==1.6.1 mkdocs-material @ git+ssh://git@github.com/astral-sh/mkdocs-material-insiders.git@39da7a5e761410349e9a1b8abf593b0cdd5453ff mkdocs-redirects==1.2.2 diff --git a/docs/requirements.txt b/docs/requirements.txt index c2e868994f492..bb51f76176503 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ PyYAML==6.0.2 -ruff==0.8.6 +ruff==0.9.1 mkdocs==1.6.1 mkdocs-material==9.5.38 mkdocs-redirects==1.2.2 diff --git a/scripts/check_docs_formatted.py b/scripts/check_docs_formatted.py index 7f576988fd945..c3d65383d4479 100755 --- a/scripts/check_docs_formatted.py +++ b/scripts/check_docs_formatted.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Check code snippets in docs are formatted by black.""" +"""Check code snippets in docs are formatted by Ruff.""" from __future__ import annotations @@ -22,7 +22,7 @@ re.DOTALL | re.MULTILINE, ) -# For some rules, we don't want black to fix the formatting as this would "fix" the +# For some rules, we don't want Ruff to fix the formatting as this would "fix" the # example. KNOWN_FORMATTING_VIOLATIONS = [ "avoidable-escaped-quote", @@ -72,6 +72,7 @@ "prohibited-trailing-comma", "redundant-backslash", "shebang-leading-whitespace", + "single-line-implicit-string-concatenation", "surrounding-whitespace", "too-few-spaces-before-inline-comment", "too-many-blank-lines", @@ -92,7 +93,7 @@ "whitespace-before-punctuation", ] -# For some docs, black is unable to parse the example code. +# For some docs, Ruff is unable to parse the example code. KNOWN_PARSE_ERRORS = [ "blank-line-with-whitespace", "indentation-with-invalid-multiple-comment", @@ -237,9 +238,9 @@ def format_file(file: Path, error_known: bool, args: argparse.Namespace) -> int: def main(argv: Sequence[str] | None = None) -> int: - """Check code snippets in docs are formatted by black.""" + """Check code snippets in docs are formatted by Ruff.""" parser = argparse.ArgumentParser( - description="Check code snippets in docs are formatted by black.", + description="Check code snippets in docs are formatted by Ruff.", ) parser.add_argument("--skip-errors", action="store_true") parser.add_argument("--generate-docs", action="store_true")