Skip to content

devops-lintflow/lintflow

Repository files navigation

lintflow

Actions Status Go Report Card License Tag

Introduction

lintflow is a server of lint workers written in Go.

Prerequisites

  • Go >= 1.22.0

Run

make build
./bin/lintflow --config-file="tests/config.yml" --code-review="gerrit" --commit-hash="{hash}"

Docker

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

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:
  --[no-]help                Show context-sensitive help (also try --help-long and --help-man).
  --[no-]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)

Settings

lintflow parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: server
metadata:
  name: lintflow
spec:
  flow:
    timeout: 120s
  lint:
    - name: lintai
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
            - .c
            - .cc
            - .cpp
            - .h
            - .hpp
            - .java
          file:
          repo:
      vote: AI-Verified
    - name: lintcommit
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
          file:
            - COMMIT_MSG
          repo:
      vote: Verified
    - name: lintcpp
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
            - .c
            - .cc
            - .cpp
            - .h
            - .hpp
          file:
          repo:
      vote: Lint-Verified
    - name: lintjava
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
            - .java
            - .xml
          file:
          repo:
      vote: Lint-Verified
    - name: lintpython
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
            - .py
          file:
          repo:
      vote: Lint-Verified
    - name: lintshell
      host: 127.0.0.1
      port: 9090
      filter:
        include:
          extension:
            - .sh
          file:
          repo:
      vote: Lint-Verified
  review:
    name: gerrit
    url: http://127.0.0.1:8080
    user: user
    pass: pass
    vote:
      - label: AI-Verified
        approval: +1
        disapproval: -1
        message: Voting AI-Verified by lintflow
      - label: Lint-Verified
        approval: +1
        disapproval: -1
        message: Voting Lint-Verified by lintflow
      - label: Verified
        approval: +1
        disapproval: -1
        message: Voting Verified by lintflow

Project

  • Commit Files
lintwork-20240630231055/
├── COMMIT_MSG
├── {change-number}-{commit-id}.meta
├── {change-number}-{commit-id}.patch
└── path/to/file
  • Commit Meta
{
  "branch": "main",
  "owner": {
    "name": "name"
  },
  "project": "name",
  "revisions": {
    "39fe82c424a319e9613126d2ef1c837e114440c5": {
      "_number": 1
    }
  },
  "updated": "2024-09-20T07:15:44+08:00",
  "url": "http://127.0.0.1:8080"
}

Report

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

About

lint server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages