Skip to content

Commit 4699a2c

Browse files
committed
Refactor create method for CodeReviewTool to use classmethod
1 parent 78af5a2 commit 4699a2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bugbug/tools/code_review/agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def __init__(
135135

136136
self.verbose = verbose
137137

138-
@staticmethod
139-
def create(**kwargs):
138+
@classmethod
139+
def create(cls, **kwargs):
140140
"""Factory method to instantiate the tool with default dependencies.
141141
142142
This method takes the same parameters as the constructor, but all
@@ -181,7 +181,7 @@ def create(**kwargs):
181181

182182
kwargs["suggestion_filterer"] = SuggestionFilteringTool.create()
183183

184-
return CodeReviewTool(**kwargs)
184+
return cls(**kwargs)
185185

186186
def count_tokens(self, text):
187187
return len(self._tokenizer.encode(text))

0 commit comments

Comments
 (0)