Skip to main content

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

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

Uploaded Source

Built Distribution

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.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page