Cleanup: declare __all__ for many scripts in tools/

This commit is contained in:
Campbell Barton
2025-01-04 20:27:07 +11:00
parent 6f64d70e60
commit 5fe261c89d
61 changed files with 290 additions and 13 deletions

View File

@@ -2,6 +2,15 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"BUILD_DIR",
"IGNORE_CMAKE",
"IGNORE_SOURCE",
"IGNORE_SOURCE_MISSING",
"SOURCE_DIR",
"UTF8_CHECK",
)
import os
IGNORE_SOURCE = (

View File

@@ -8,6 +8,10 @@ noted by the date which must be included with the *DEPRECATED* comment.
Once this date is past, the code should be removed.
"""
__all__ = (
"main",
)
import os
import datetime

View File

@@ -8,6 +8,9 @@ this script updates XML themes once new settings are added
./blender.bin --background --python tools/check_source/check_descriptions.py
"""
__all__ = (
"main",
)
import bpy

View File

@@ -14,6 +14,9 @@ Then restore the headers to their original state:
python3 check_header_duplicate.py --restore
"""
__all__ = (
"main",
)
import os
import sys

View File

@@ -9,6 +9,10 @@ https://spdx.org/licenses/
This can be activated by calling "make check_licenses" from Blenders root directory.
"""
__all__ = (
"main",
)
import os
import argparse

View File

@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import os
from os.path import join

View File

@@ -2,6 +2,12 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"PATHS",
"PATHS_EXCLUDE",
"SOURCE_DIR",
)
import os
from typing import (
Any,

View File

@@ -13,6 +13,9 @@ Script for checking source code spelling.
Currently only python source is checked.
"""
__all__ = (
"main",
)
import os
import argparse

View File

@@ -4,6 +4,15 @@
# these must be all lower case for comparisons
__all__ = (
"dict_custom",
"dict_ignore",
"dict_ignore_hyphenated_prefix",
"dict_ignore_hyphenated_suffix",
"directories_ignore",
"files_ignore",
)
dict_custom = {
# Added to newer versions of the dictionary,
# we can remove these when the updated word-lists have been applied to `aspell-en`.

View File

@@ -5,6 +5,10 @@
# Checks for defines which aren't used anywhere.
__all__ = (
"main",
)
import os
import sys

View File

@@ -13,6 +13,11 @@ Invocation:
... defines and includes are optional
"""
__all__ = (
"main",
)
import sys
# delay parsing functions until we need them
USE_LAZY_INIT = True
@@ -380,9 +385,15 @@ def recursive_arg_sizes(node, ):
recursive_arg_sizes(c)
# cache function sizes
recursive_arg_sizes(tu.cursor)
_defs.update(defs_precalc)
def main() -> int:
# cache function sizes
recursive_arg_sizes(tu.cursor)
_defs.update(defs_precalc)
# --- second pass, check against def's
file_check_arg_sizes(tu)
# --- second pass, check against def's
file_check_arg_sizes(tu)
return 0
if __name__ == "__main__":
sys.exit(main)

View File

@@ -13,6 +13,10 @@ cd {BUILD_DIR}
python ../blender/tools/check_source/static_check_clang.py --match=".*" --checks=struct_comments
"""
__all__ = (
"main",
)
import argparse
import os

View File

@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import project_source_info
import subprocess
import sys

View File

@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import project_source_info
import subprocess
import sys