Skip to main content

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gerrit_review_robot-0.0.7.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gerrit_review_robot-0.0.7-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file gerrit_review_robot-0.0.7.tar.gz.

File metadata

  • Download URL: gerrit_review_robot-0.0.7.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for gerrit_review_robot-0.0.7.tar.gz
Algorithm Hash digest
SHA256 11d847b9545155018ffd8e6d9fc6d7cdda9a5ea78f9430fc3b5deb919139e3ef
MD5 dda73f369f6960812c22a11f7939fb38
BLAKE2b-256 3758e57c81901fcf3d07dc07e8ceaeea071e273ceffc594e3f3a531f730c58e8

See more details on using hashes here.

File details

Details for the file gerrit_review_robot-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: gerrit_review_robot-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for gerrit_review_robot-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3274a5474210dc392529d93c2af228bc6edb97f34f34f01b3afb46f2e5f468
MD5 9429bb7aa852da18121a186325272d12
BLAKE2b-256 80207a89377e5acab71d699b9f34ccaa3de06388302896e9899a2573ecc0f7b0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page