more lint and formatting
Some checks failed
Some checks failed
This commit is contained in:
@@ -333,13 +333,31 @@ def print_result(success: bool, output: str = "", silent: bool = False) -> None:
|
||||
|
||||
|
||||
def get_gd_files(project_root: Path) -> List[Path]:
|
||||
"""Get all .gd files in the project."""
|
||||
return list(project_root.rglob("*.gd"))
|
||||
"""Get all .gd files in the project, respecting gitignore."""
|
||||
gitignore_patterns = read_gitignore(project_root)
|
||||
gd_files = []
|
||||
|
||||
for gd_file in project_root.rglob("*.gd"):
|
||||
if gd_file.is_file() and not is_ignored_by_gitignore(
|
||||
gd_file, project_root, gitignore_patterns
|
||||
):
|
||||
gd_files.append(gd_file)
|
||||
|
||||
return gd_files
|
||||
|
||||
|
||||
def get_py_files(project_root: Path) -> List[Path]:
|
||||
"""Get all .py files in the project."""
|
||||
return list(project_root.rglob("*.py"))
|
||||
"""Get all .py files in the project, respecting gitignore."""
|
||||
gitignore_patterns = read_gitignore(project_root)
|
||||
py_files = []
|
||||
|
||||
for py_file in project_root.rglob("*.py"):
|
||||
if py_file.is_file() and not is_ignored_by_gitignore(
|
||||
py_file, project_root, gitignore_patterns
|
||||
):
|
||||
py_files.append(py_file)
|
||||
|
||||
return py_files
|
||||
|
||||
|
||||
def read_gitignore(project_root: Path) -> List[str]:
|
||||
@@ -661,15 +679,21 @@ def check_naming_convention(file_path: Path) -> Tuple[bool, str]:
|
||||
|
||||
|
||||
def get_naming_files(project_root: Path) -> List[Path]:
|
||||
"""Get all .tscn and .gd files that should follow naming conventions."""
|
||||
"""Get all .tscn and .gd files that should follow naming conventions, respecting gitignore."""
|
||||
gitignore_patterns = read_gitignore(project_root)
|
||||
files = []
|
||||
for pattern in ["**/*.tscn", "**/*.gd"]:
|
||||
files.extend(project_root.glob(pattern))
|
||||
|
||||
# Filter out files that should be ignored
|
||||
for pattern in ["**/*.tscn", "**/*.gd"]:
|
||||
for file_path in project_root.glob(pattern):
|
||||
if file_path.is_file():
|
||||
files.append(file_path)
|
||||
|
||||
# Filter out files that should be ignored (gitignore + TestHelper)
|
||||
filtered_files = []
|
||||
for file_path in files:
|
||||
if not should_skip_file(file_path):
|
||||
if not should_skip_file(file_path) and not is_ignored_by_gitignore(
|
||||
file_path, project_root, gitignore_patterns
|
||||
):
|
||||
filtered_files.append(file_path)
|
||||
|
||||
return filtered_files
|
||||
@@ -1783,7 +1807,15 @@ def run_tests(
|
||||
success = failed_tests == 0
|
||||
|
||||
if yaml_output:
|
||||
output_yaml_results("test", {**stats, "results": test_results}, success)
|
||||
yaml_results = {**stats, "results": test_results}
|
||||
if failed_tests > 0:
|
||||
yaml_results["failed_test_details"] = [
|
||||
{"test": name, "error": error}
|
||||
for name, passed, error in test_results
|
||||
if not passed and error
|
||||
]
|
||||
|
||||
output_yaml_results("test", yaml_results, success)
|
||||
else:
|
||||
print_summary("Test Execution Summary", stats, silent)
|
||||
if not silent:
|
||||
@@ -1890,7 +1922,15 @@ async def run_tests_async(
|
||||
}
|
||||
|
||||
if yaml_output:
|
||||
output_yaml_results("test", {**stats, "results": test_results}, failed == 0)
|
||||
yaml_results = {**stats, "results": test_results}
|
||||
if failed > 0:
|
||||
yaml_results["failed_test_details"] = [
|
||||
{"test": name, "error": error}
|
||||
for name, passed, error in test_results
|
||||
if not passed and error
|
||||
]
|
||||
|
||||
output_yaml_results("test", yaml_results, failed == 0)
|
||||
elif not silent:
|
||||
print_summary("Test Summary", stats)
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user