From ce773fec4015b8f0173398aa773cb26a12004ef7 Mon Sep 17 00:00:00 2001 From: Wan Rujie Date: Mon, 17 Mar 2025 16:28:05 +0800 Subject: [PATCH] customized reviewed file types --- config/config.py | 6 +++++- review_engine/handler/default_handler.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/config.py b/config/config.py index cefa30b..90c4ebb 100644 --- a/config/config.py +++ b/config/config.py @@ -69,4 +69,8 @@ # ------------- Message notification -------------------- # dingding notification (un necessary) dingding_bot_webhook = "https://oapi.dingtalk.com/robot/send?access_token=*****************************************" -dingding_secret = "S********************************950f" \ No newline at end of file +dingding_secret = "S********************************950f" + +# ------------- Customized reviewed file type -------------------- +# reviewed file types +reviewed_file_types = ['.py', '.java', '.class', '.vue', ".go"] \ No newline at end of file diff --git a/review_engine/handler/default_handler.py b/review_engine/handler/default_handler.py index aa582fc..468d13d 100644 --- a/review_engine/handler/default_handler.py +++ b/review_engine/handler/default_handler.py @@ -3,7 +3,7 @@ from retrying import retry -from config.config import gpt_message +from config.config import gpt_message, reviewed_file_types from review_engine.abstract_handler import ReviewHandle from utils.gitlab_parser import filter_diff_content from utils.logger import log @@ -22,7 +22,7 @@ def process_change(change): futures = [] for change in changes: - if any(change["new_path"].endswith(ext) for ext in ['.py', '.java', '.class', '.vue', ".go"]) and not any( + if any(change["new_path"].endswith(ext) for ext in reviewed_file_types) and not any( change["new_path"].endswith(ext) for ext in ["mod.go"]): futures.append(executor.submit(process_change, change)) else: