Skip to content

Commit c26fd11

Browse files
Refactor tools into modular code review and core packages (#5344)
1 parent f56c114 commit c26fd11

File tree

27 files changed

+2409
-2161
lines changed

27 files changed

+2409
-2161
lines changed

bugbug/code_search/mozilla.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from bugbug.code_search.parser import FunctionSearchParser
77
from bugbug.code_search.searchfox_api import FunctionSearchSearchfoxAPI
88
from bugbug.code_search.searchfox_data import FunctionSearchSearchfoxData
9-
from bugbug.tools.code_review import PhabricatorPatch
9+
from bugbug.tools.core.platforms.phabricator import PhabricatorPatch
1010

1111

1212
class FunctionSearchMozilla(FunctionSearch):

bugbug/tools/base.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
4+
# You can obtain one at http://mozilla.org/MPL/2.0/.
5+
6+
from abc import ABC, abstractmethod
7+
from typing import Any
8+
9+
10+
class GenerativeModelTool(ABC):
11+
@property
12+
@abstractmethod
13+
def version(self) -> str: ...
14+
15+
@abstractmethod
16+
def run(self, *args, **kwargs) -> Any: ...
17+
18+
@staticmethod
19+
def _print_answer(answer):
20+
print(f"\u001b[33;1m\033[1;3m{answer}\u001b[0m")

0 commit comments

Comments
 (0)