Skip to content

customized reviewed file types #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
dingding_secret = "S********************************950f"

# ------------- Customized reviewed file type --------------------
# reviewed file types
reviewed_file_types = ['.py', '.java', '.class', '.vue', ".go"]
4 changes: 2 additions & 2 deletions review_engine/handler/default_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down