A framework for writing bots, that review a code base and post the review together with comments to Gerrit.
Project description
gerrit_review_robot
A framework for writing bots, that review a code base and post
the review together with comments to Gerrit. To write a bot,
inherit GerritReviewRobot
:
class CheckStyle(GerritReviewRobot):
# these two are optional: for documentation and the command-line
name = "Check Style"
description = "Uses Flake8 to lint the current change"
def _do_review(self, review):
# pass self.diff_lines so that we do not have to analyze files that
# are not part of the current change
for error in self._find_linting_errors_in_files(self.diff_files)
# only include lines in current diff
if (error.file, error.line_number) in self.diff_lines:
review.add_comment(
error.file, # relative path
(error.line_number, error.line_number), # from_line, to_line
error.message # message shown in the comment
)
def _find_linting_errors_in_files(self, files):
pass # here comes the actual logic
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for gerrit_review_robot-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07a0575d0ed5189827d82305a217dafc60d99224435c14ade83aa73b6b7a8042 |
|
MD5 | 73d9b83982244ceb15a593c7560b7fdb |
|
BLAKE2b-256 | 6268638a9821e7a6498f4e0ff3bf26b0d1ff7ab97b7fd804d2bf170df44ef3df |
Close
Hashes for gerrit_review_robot-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fee03982cd9a7d0265ad9fe1cb940687ca423b18527e27936aeb4b4271db1695 |
|
MD5 | a160439738481401ac4e619baa71b0f3 |
|
BLAKE2b-256 | 4bbac8db8c7bd94a236f25b5e4273e5b63e09f97e429e41644221ea852d63529 |