You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Update pre-commit hooks configuration to use ruff instead of black
This commit is contained in:
committed by
Thaddeus Crews
parent
aaa4560729
commit
d9f8ef68df
@@ -1,11 +1,11 @@
|
||||
"""Functions used to generate scu build source files during build time
|
||||
"""
|
||||
"""Functions used to generate scu build source files during build time"""
|
||||
|
||||
import glob, os
|
||||
import glob
|
||||
import math
|
||||
from methods import print_error
|
||||
import os
|
||||
from pathlib import Path
|
||||
from os.path import normpath, basename
|
||||
|
||||
from methods import print_error
|
||||
|
||||
base_folder_path = str(Path(__file__).parent) + "/"
|
||||
base_folder_only = os.path.basename(os.path.normpath(base_folder_path))
|
||||
@@ -25,7 +25,7 @@ def clear_out_stale_files(output_folder, extension, fresh_files):
|
||||
|
||||
for file in glob.glob(output_folder + "/*." + extension):
|
||||
file = Path(file)
|
||||
if not file in fresh_files:
|
||||
if file not in fresh_files:
|
||||
# print("removed stale file: " + str(file))
|
||||
os.remove(file)
|
||||
|
||||
@@ -56,7 +56,7 @@ def find_files_in_folder(folder, sub_folder, include_list, extension, sought_exc
|
||||
|
||||
li = '#include "' + folder + "/" + sub_folder_slashed + file + '"'
|
||||
|
||||
if not simple_name in sought_exceptions:
|
||||
if simple_name not in sought_exceptions:
|
||||
include_list.append(li)
|
||||
else:
|
||||
found_exceptions.append(li)
|
||||
@@ -78,9 +78,9 @@ def write_output_file(file_count, include_list, start_line, end_line, output_fol
|
||||
|
||||
file_text = ""
|
||||
|
||||
for l in range(start_line, end_line):
|
||||
if l < len(include_list):
|
||||
line = include_list[l]
|
||||
for i in range(start_line, end_line):
|
||||
if i < len(include_list):
|
||||
line = include_list[i]
|
||||
li = line + "\n"
|
||||
file_text += li
|
||||
|
||||
@@ -221,7 +221,6 @@ def process_folder(folders, sought_exceptions=[], includes_per_scu=0, extension=
|
||||
lines_per_file = max(lines_per_file, 1)
|
||||
|
||||
start_line = 0
|
||||
file_number = 0
|
||||
|
||||
# These do not vary throughout the loop
|
||||
output_folder = abs_main_folder + "/scu/"
|
||||
|
||||
Reference in New Issue
Block a user