diff options
author | Jakub Marcowski <chubercikbattle@gmail.com> | 2024-05-21 15:14:59 +0200 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-05-21 18:02:29 -0500 |
commit | d9f8ef68df1df8cf88d484fc22995f55a9c3f9aa (patch) | |
tree | 69f67b54e7fbb15be77877d5de8d3906fc41b882 /doc | |
parent | aaa4560729bf0161deb71789b47eba5623893845 (diff) | |
download | redot-engine-d9f8ef68df1df8cf88d484fc22995f55a9c3f9aa.tar.gz |
Update pre-commit hooks configuration to use `ruff` instead of `black`
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/tools/doc_status.py | 8 | ||||
-rwxr-xr-x | doc/tools/make_rst.py | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py index a23c11b585..57c03bfdee 100755 --- a/doc/tools/doc_status.py +++ b/doc/tools/doc_status.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 import fnmatch -import os -import sys -import re import math +import os import platform +import re +import sys import xml.etree.ElementTree as ET from typing import Dict, List, Set @@ -286,7 +286,7 @@ class ClassStatus: status.progresses[tag.tag].increment(is_deprecated or is_experimental or has_descr) elif tag.tag in ["constants", "members", "theme_items"]: for sub_tag in list(tag): - if not sub_tag.text is None: + if sub_tag.text is not None: is_deprecated = "deprecated" in sub_tag.attrib is_experimental = "experimental" in sub_tag.attrib has_descr = len(sub_tag.text.strip()) > 0 diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 43e1afe720..bc379f8553 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -4,17 +4,16 @@ import argparse import os -import platform import re import sys import xml.etree.ElementTree as ET from collections import OrderedDict -from typing import List, Dict, TextIO, Tuple, Optional, Any, Union +from typing import Any, Dict, List, Optional, TextIO, Tuple, Union # Import hardcoded version information from version.py root_directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../") sys.path.append(root_directory) # Include the root directory -import version +import version # noqa: E402 # $DOCS_URL/path/to/page.html(#fragment-tag) GODOT_DOCS_PATTERN = re.compile(r"^\$DOCS_URL/(.*)\.html(#.*)?$") @@ -706,7 +705,7 @@ def main() -> None: # <https://github.com/python/cpython/issues/73245> if should_color and sys.stdout.isatty() and sys.platform == "win32": try: - from ctypes import windll, byref, WinError # type: ignore + from ctypes import WinError, byref, windll # type: ignore from ctypes.wintypes import DWORD # type: ignore stdout_handle = windll.kernel32.GetStdHandle(DWORD(-11)) @@ -1413,7 +1412,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir: operator_anchor = f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}" for parameter in m.parameters: operator_anchor += f"_{parameter.type_name.type_name}" - operator_anchor += f":\n\n" + operator_anchor += ":\n\n" f.write(operator_anchor) f.write(".. rst-class:: classref-operator\n\n") @@ -1553,7 +1552,7 @@ def make_method_signature( out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}" for parameter in definition.parameters: out += f"_{parameter.type_name.type_name}" - out += f">`" + out += ">`" elif ref_type == "method": ref_type_qualifier = "" if definition.name.startswith("_"): |