From d9b7cfac7e05eabb5c81898e70179cdab195f47f Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 30 Dec 2024 04:14:59 -0500 Subject: [PATCH] Fix and enforce new lines at the end of files. --- api_server/services/file_service.py | 2 +- api_server/utils/file_operations.py | 2 +- app/app_settings.py | 2 +- comfy/ldm/util.py | 2 +- comfy_extras/nodes_load_3d.py | 2 +- comfy_extras/nodes_morphology.py | 2 +- comfy_extras/nodes_webcam.py | 2 +- ruff.toml | 1 + tests-unit/comfy_test/folder_path_test.py | 2 +- tests-unit/folder_paths_test/filter_by_content_types_test.py | 2 +- 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/api_server/services/file_service.py b/api_server/services/file_service.py index 39457108..115edccd 100644 --- a/api_server/services/file_service.py +++ b/api_server/services/file_service.py @@ -10,4 +10,4 @@ class FileService: if directory_key not in self.allowed_directories: raise ValueError("Invalid directory key") directory_path: str = self.allowed_directories[directory_key] - return self.file_system_ops.walk_directory(directory_path) \ No newline at end of file + return self.file_system_ops.walk_directory(directory_path) diff --git a/api_server/utils/file_operations.py b/api_server/utils/file_operations.py index ef1bf999..32d6e047 100644 --- a/api_server/utils/file_operations.py +++ b/api_server/utils/file_operations.py @@ -39,4 +39,4 @@ class FileSystemOperations: "path": relative_path, "type": "directory" }) - return file_list \ No newline at end of file + return file_list diff --git a/app/app_settings.py b/app/app_settings.py index 8c6edc56..efe87adb 100644 --- a/app/app_settings.py +++ b/app/app_settings.py @@ -51,4 +51,4 @@ class AppSettings(): settings = self.get_settings(request) settings[setting_id] = await request.json() self.save_settings(request, settings) - return web.Response(status=200) \ No newline at end of file + return web.Response(status=200) diff --git a/comfy/ldm/util.py b/comfy/ldm/util.py index 2ed4aa2a..30b4b472 100644 --- a/comfy/ldm/util.py +++ b/comfy/ldm/util.py @@ -194,4 +194,4 @@ class AdamWwithEMAandWings(optim.Optimizer): for param, ema_param in zip(params_with_grad, ema_params_with_grad): ema_param.mul_(cur_ema_decay).add_(param.float(), alpha=1 - cur_ema_decay) - return loss \ No newline at end of file + return loss diff --git a/comfy_extras/nodes_load_3d.py b/comfy_extras/nodes_load_3d.py index b72a357b..d10c4e12 100644 --- a/comfy_extras/nodes_load_3d.py +++ b/comfy_extras/nodes_load_3d.py @@ -121,4 +121,4 @@ NODE_DISPLAY_NAME_MAPPINGS = { "Load3D": "Load 3D", "Load3DAnimation": "Load 3D - Animation", "Preview3D": "Preview 3D" -} \ No newline at end of file +} diff --git a/comfy_extras/nodes_morphology.py b/comfy_extras/nodes_morphology.py index 071521d8..b1372b8c 100644 --- a/comfy_extras/nodes_morphology.py +++ b/comfy_extras/nodes_morphology.py @@ -46,4 +46,4 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "Morphology": "ImageMorphology", -} \ No newline at end of file +} diff --git a/comfy_extras/nodes_webcam.py b/comfy_extras/nodes_webcam.py index 32a0ba2f..31eddb2d 100644 --- a/comfy_extras/nodes_webcam.py +++ b/comfy_extras/nodes_webcam.py @@ -30,4 +30,4 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "WebcamCapture": "Webcam Capture", -} \ No newline at end of file +} diff --git a/ruff.toml b/ruff.toml index 30488e86..6f9ac932 100644 --- a/ruff.toml +++ b/ruff.toml @@ -5,6 +5,7 @@ lint.ignore = ["ALL"] lint.select = [ "S307", # suspicious-eval-usage "T201", # print-usage + "W292", "W293", # The "F" series in Ruff stands for "Pyflakes" rules, which catch various Python syntax errors and undefined names. # See all rules here: https://docs.astral.sh/ruff/rules/#pyflakes-f diff --git a/tests-unit/comfy_test/folder_path_test.py b/tests-unit/comfy_test/folder_path_test.py index 55613505..f8173cdc 100644 --- a/tests-unit/comfy_test/folder_path_test.py +++ b/tests-unit/comfy_test/folder_path_test.py @@ -95,4 +95,4 @@ def test_get_save_image_path(temp_dir): assert filename == "test" assert counter == 1 assert subfolder == "" - assert filename_prefix == "test" \ No newline at end of file + assert filename_prefix == "test" diff --git a/tests-unit/folder_paths_test/filter_by_content_types_test.py b/tests-unit/folder_paths_test/filter_by_content_types_test.py index 5574789e..6b334313 100644 --- a/tests-unit/folder_paths_test/filter_by_content_types_test.py +++ b/tests-unit/folder_paths_test/filter_by_content_types_test.py @@ -49,4 +49,4 @@ def test_handles_no_extension(): def test_handles_no_files(): files = [] - assert filter_files_content_types(files, ["image", "audio", "video"]) == [] \ No newline at end of file + assert filter_files_content_types(files, ["image", "audio", "video"]) == []