mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-09 22:25:09 +00:00
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 <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
22edee2353
commit
c0259e7bf2
3 changed files with 8 additions and 7 deletions
|
@ -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 @@ SNIPPED_RE = re.compile(
|
|||
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 @@ KNOWN_FORMATTING_VIOLATIONS = [
|
|||
"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 @@ KNOWN_FORMATTING_VIOLATIONS = [
|
|||
"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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue