Skip to content

Commit b4be2f0

Browse files
committed
Update tools for ReviewBot
[WARNING] py.warnings: /venv/lib/python3.12/site-packages/reviewbot/celery.py:70: RemovedInReviewBot40Warning: ChardetectorTool must subclass reviewbot.tools.base.BaseTool. All overridden methods, including __init__() and handle_file(), must take a **kwargs argument, and self.settings should be accessed for tool-specific settings. Legacy support will be removed in Review Bot 4.0. tool = tool_class()
1 parent 0c1294c commit b4be2f0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

extended_bots/chardetector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import chardet
44
from os.path import splitext
55

6-
from reviewbot.tools import Tool
6+
from reviewbot.tools import BaseTool
77

88

9-
class ChardetectorTool(Tool):
9+
class ChardetectorTool(BaseTool):
1010
"""Review Bot tool to run chardet."""
1111

1212
name = 'chardetector'
@@ -38,7 +38,7 @@ class ChardetectorTool(Tool):
3838
},
3939
]
4040

41-
def handle_file(self, f, settings):
41+
def handle_file(self, f, settings, **kwargs):
4242
"""Perform a review of a single file.
4343
4444
Args:

extended_bots/regex.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from os.path import splitext
44
import re
55

6-
from reviewbot.tools import Tool
6+
from reviewbot.tools import BaseTool
77

88

9-
class RegexTool(Tool):
9+
class RegexTool(BaseTool):
1010
"""Review Bot tool to run regex."""
1111

1212
name = 'regex'
@@ -46,7 +46,7 @@ class RegexTool(Tool):
4646
},
4747
]
4848

49-
def handle_file(self, f, settings):
49+
def handle_file(self, f, settings, **kwargs):
5050
"""Perform a review of a single file.
5151
5252
Args:

extended_bots/uncrustify.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import os
44
from os.path import splitext
55

6-
from reviewbot.tools import Tool
6+
from reviewbot.tools import BaseTool
77
from reviewbot.utils.filesystem import make_tempfile
88
from reviewbot.utils.process import execute, is_exe_in_path
99

1010

11-
class UncrustifyTool(Tool):
11+
class UncrustifyTool(BaseTool):
1212
"""Review Bot tool to run formatting tool uncrustify."""
1313

1414
name = 'uncrustify'
@@ -67,7 +67,7 @@ def check_dependencies(self):
6767
"""
6868
return is_exe_in_path('uncrustify') and is_exe_in_path('diff')
6969

70-
def handle_file(self, f, settings):
70+
def handle_file(self, f, settings, **kwargs):
7171
"""Perform a review of a single file.
7272
7373
Args:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
install_requires=[
2626
'chardet>=2.3.0',
27-
'reviewbot-worker>=1.0',
27+
'reviewbot-worker>=3.0',
2828
'RBTools>=1.0',
2929
],
3030
classifiers=[

0 commit comments

Comments
 (0)