lintflow

command module
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

lintflow

Actions Status Go Report Card License Tag

Introduction

lintflow is a master of lint workers written in Go.

Prerequisites

  • Go >= 1.16.0
  • gRPC >= 1.36.0

Build

git clone https://github.com/craftslab/lintflow.git

cd lintflow
make build

Run

./lintflow --config-file="config.yml" --code-review="gerrit" --commit-hash="{hash}" --output-file="output.json"

Docker

git clone https://github.com/craftslab/lintflow.git

cd lintflow
docker build --no-cache -f Dockerfile -t craftslab/lintflow:latest .
docker run craftslab/lintflow:latest /lintflow --config-file="/config.yml" --code-review="gerrit" --commit-hash="{hash}" --output-file="/output.json"

Compose

# Run workers
docker-compose -f docker-compose.yml pull
docker-compose -f docker-compose.yml up -d

# Stop workers
docker-compose -f docker-compose.yml stop
docker-compose -f docker-compose.yml rm -f

Usage

usage: lintflow --code-review=CODE-REVIEW --commit-hash=COMMIT-HASH --config-file=CONFIG-FILE [<flags>]

Lint Flow

Flags:
  --help                     Show context-sensitive help (also try --help-long
                             and --help-man).
  --version                  Show application version.
  --code-review=CODE-REVIEW  Code review (bitbucket|gerrit|gitee|github|gitlab)
  --commit-hash=COMMIT-HASH  Commit hash (SHA-1)
  --config-file=CONFIG-FILE  Config file (.yml)
  --output-file=OUTPUT-FILE  Output file (.json|.txt|.xlsx)

Settings

lintflow parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: master
metadata:
  name: lintflow
spec:
  lint:
    - name: lintcpp
      host: 127.0.0.1
      port: 9090
      timeout: 300
      filter:
        include:
          extension:
            - .c
            - .cc
            - .cpp
            - .h
            - .hpp
          file:
            - message
          repo:
            - foo
    - name: lintjava
      host: 127.0.0.1
      port: 9091
      timeout: 300
      filter:
        include:
          extension:
            - .java
            - .xml
          file:
            - message
          repo:
            - foo
    - name: lintpython
      host: 127.0.0.1
      port: 9092
      timeout: 300
      filter:
        include:
          extension:
            - .py
          file:
            - message
          repo:
            - foo
    - name: lintshell
      host: 127.0.0.1
      port: 9093
      timeout: 300
      filter:
        include:
          extension:
            - .sh
          file:
            - message
          repo:
            - foo
  review:
    - name: gerrit
      host: http://127.0.0.1/
      port: 8080
      user: user
      pass: pass
      vote:
        approval: +1
        disapproval: -1
        label: Code-Review
        message: Voting Code-Review by lintflow

Design

design

Errorformat

  • JSON format
{
  "lint": [
    {
      "file": "name",
      "line": 1,
      "type": "Error",
      "details": "text"
    }
  ]
}
  • Text format
{lint}:{file}:{line}:{type}:{details}

Issues

One or more comments were rejected in validation: Exceeding maximum number of comments: 5001 (existing) + 1 (new) > 5000

License

Project License can be found here.

Reference

Gerrit
Misc

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL