/cardboardlint

Cheap lint solution for PRs

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

image

image

image

image

image

image

Introduction

Cardboardlint is a cheap lint solution for pull requests.

It is a non-hosted and customizable tool similar to commercial services like:

For more advanced analysis, one could use Coverty Scan. (https://scan.coverity.com/)

Cardboardlint wraps a collection of linters, intended to be used on a project in a Git repository. Cardboardlint is able to report just those messages related to lines that have changed in your development branch, compared to another commit, e.g. the HEAD of the master branch. This is intended to make life easier for contributors to a project: in their pull requests, they will only see linting issues related to the code they have touched. For some linters, cardboardlint also supports automatic fixes of linting issues, optionally restricted to code that has changed in your development branch.

Some example projects that use Cardboardlint:

Usage

Change log

  • Version 1.3.1 August 26, 2020
    • Improve interaction with Roberto.
    • Hide duplicate messages.
  • Version 1.3.0 April 14, 2019
    • More verbose output. List of selected files for linting is always shown.
    • Fix default location for Python command-line scripts is ./bin, not ./scripts.
    • Wall time of linters is printed.
    • Few cleanups.
  • Version 1.2.0 April 12, 2019
    • Added support for fixers. The following liners can also fix problems: header, whitespace, autopep8, yapf, black. The latter three are new.
    • Removed some Python-2 compatibility code.
    • Replace nosetests by pytest.
    • Add more context to README.
    • Add RST linter.
  • Version 1.1.0 April 3, 2019
    • Add option for number of processors to use.
  • Version 1.0.1 March 30, 2019
    • Add missing config options for cpplint.
  • Version 1.0.0 March 27, 2019

    First release, mainly in anticipation of API-breaking changes, which will result in a major version increase. By making a release, we can handle this change in API gracefully. Notable features include:

    • Support for the following linters: cppcheck, ccplint, doxygen, flake8, header (internal), import (internal), namespace (internal), pycodestyle, pydocstyle, pylint, whitespace (internal), yamllint
    • For all supported linters, the output can be restricted to files and (lines in those files) that have changed between two git commits. In pull requests, this will then only show errors that are relevant for the code touched in the PR. This is intended for making life easy for contributors, i.e. to not bother them with linting issues in code they have not touched.
    • Flexible file filtering, essentially a simplified version of rsync's file filtering rules.
    • Consistent and colored output for all linters, making it easy to process linting issues.