Skip to main content

UNKNOWN

Project description

Python script to automatically lint new reviews to gerrit. Designed to be run from within Jenkins via the Gerrit Trigger plugin

Lint is a python package to assist with automatic code reviews. It provides the following tools:

  1. Get a list of files changed between the active gerrit branch and the specified gerrit review.

  2. Lint the original files in the active gerrit branch.

  3. Checkout the current review ID

  4. Lint the changed files.

  5. Analyze the results according to specified validators.

  6. Post the results of the validation to gerrit via SSH (+1/-1 score assigned, including a message).

Lint uses the environmental variables set by Gerrit Trigger to do almost all of the configuration. You can still use it via command-line (with options!) for manual testing.

You can also add a checkers to validators, which are simple functions to compare lint data that are passed to the validator.

Installation

pip install git+https://github.com/astraw38/Lint

Usage

For pylint, just use ‘gpylinter.py’. It by default will use the ‘Pylinter’ plugin for .py files, as well as the default pylint validators.

Lint provides the ability to plugin your own Linter or Validator classes. All you need to do is run

LintFactory.register_linter(NewLinter())

or

ValidatorFactory.register_validator(NewValidator())

When you run ‘run_linters()’ or ‘run_validators()’, it’ll pick them up and use them. Your new Linters should derive from BaseLinter, and your new Validators should derive from BaseValidator.

You can also customize the order of operations, or how comments/scores are posted to gerrit. Just look at gpylinter as an example.

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

lint-1.2.1.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file lint-1.2.1.tar.gz.

File metadata

  • Download URL: lint-1.2.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lint-1.2.1.tar.gz
Algorithm Hash digest
SHA256 b3675d89a849da38a32e6cdae07146e551215cf5623a84ac5ef6895052b2b7c2
MD5 535a19fd112ab1b943dbea7ba398030b
BLAKE2b-256 7e538044a8523212654618ede007cd1b17a6c2bd686b7af38be70bcc1ce5f9cc

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