Skip to main content

Lint

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.

Metadata

Release files for lint 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lint 1.2.1
File Size Uploaded Provenance Actions
lint-1.2.1.tar.gz 14.4 kB Without provenance Details for lint-1.2.1.tar.gz

Release files / lint-1.2.1.tar.gz

Download URL lint-1.2.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b3675d89a849da38a32e6cdae07146e551215cf5623a84ac5ef6895052b2b7c2
BLAKE2b-256 checksum
How to use checksums
7e538044a8523212654618ede007cd1b17a6c2bd686b7af38be70bcc1ce5f9cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lint 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page