Skip to main content

Lint Work

Project description

lintwork

Actions Status Docker License PyPI Tag

Introduction

lintwork is a lint worker of lintflow written in Python.

Prerequisites

  • gRPC >= 1.36.0
  • Python >= 3.7.0

Run

  • Local mode
git clone https://github.com/craftslab/lintwork.git

cd lintwork
pip install -Ur requirements.txt
python work.py --config-file="config.yml" --lint-project="project" --output-file="output.json"
  • Service mode
git clone https://github.com/craftslab/lintwork.git

cd lintwork
pip install -Ur requirements.txt
python work.py --config-file="config.yml" --listen-url="127.0.0.1:9090"

Docker

  • Local mode
git clone https://github.com/craftslab/lintwork.git

cd lintwork
docker build --no-cache -f Dockerfile -t craftslab/lintwork:latest .
docker run -it -v /tmp:/tmp craftslab/lintwork:latest ./lintwork --config-file="config.yml" --lint-project="/tmp/project" --output-file="/tmp/output.json"
  • Service mode
git clone https://github.com/craftslab/lintwork.git

cd lintwork
docker build --no-cache -f Dockerfile -t craftslab/lintwork:latest .
docker run -it --network=host craftslab/lintwork:latest ./lintwork --config-file="config.yml" --listen-url="127.0.0.1:9090"

Usage

usage: work.py [-h] --config-file CONFIG_FILE
               [--lint-project LINT_PROJECT | --listen-url LISTEN_URL]
               [--output-file OUTPUT_FILE] [-v]

Lint Work

optional arguments:
  -h, --help            show this help message and exit
  --config-file CONFIG_FILE
                        config file (.yml)
  --lint-project LINT_PROJECT
                        lint project (/path/to/project)
  --listen-url LISTEN_URL
                        listen url (host:port)
  --output-file OUTPUT_FILE
                        output file (.json|.txt|.xlsx)
  -v, --version         show program's version number and exit

Settings

lintwork parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: worker
metadata:
  name: lintwork
spec:
  cpp:
    checkpatch:
      - --no-summary
      - --no-tree
      - --terse
    cpplint:
  java:
    aosplint:
      - --disable
      - LintError
      - --nolines
      - --quiet
    checkstyle:
      - -jar
      - /home/craftslab/opt/checkstyle/lib/checkstyle.jar
      - -c=/home/craftslab/opt/checkstyle/etc/google_checks.xml
    stringscheck:
  make:
    checkmake:
      - --format=:{{.LineNumber}}::{{.Violation}}\n
  python:
    flake8:
  shell:
    shellcheck:
      - --format=gcc

Design

design

Errorformat

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

License

Project License can be found here.

Reference

Linter

Misc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lintwork-1.8.1.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

lintwork-1.8.1-py2.py3-none-any.whl (31.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lintwork-1.8.1.tar.gz.

File metadata

  • Download URL: lintwork-1.8.1.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

File hashes

Hashes for lintwork-1.8.1.tar.gz
Algorithm Hash digest
SHA256 e980345bbde6da2b8a7672dfc706062377206727979895e3f3cc1286118d9ea9
MD5 9850b14c18cd41e4b806b7e4f47f817f
BLAKE2b-256 73a55cf3d6ffb74db79511503122a7481b1e63a511706e1a3ad12a32ccf31f1f

See more details on using hashes here.

File details

Details for the file lintwork-1.8.1-py2.py3-none-any.whl.

File metadata

  • Download URL: lintwork-1.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.9

File hashes

Hashes for lintwork-1.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bfbfc5d945db83690c5c9b6c293d45b6cb05164e069a2bd1c1bff5e49b04fc4a
MD5 dd29e438918223875dd2a02ba7c3a4e0
BLAKE2b-256 eef8f49963268c8be5713f804d1c57f60237f7c0172ac6184a8579737d6baac2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page