lintflow

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

{
"lint": [
{
"file": "name",
"line": 1,
"type": "Error",
"details": "text"
}
]
}
{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