Skip to main content

lintwork

Actions Status Docker License Tag

Introduction

lintwork is a lint worker of lintflow written in Python.

Prerequisites

  • gRPC >= 1.36.0
  • Python >= 3.7.0

Run

  • Local mode
pip install -Ur requirements.txt
python work.py --config-file="config.yml" --lint-project="project" --output-file="output.json"
  • Service mode
pip install -Ur requirements.txt
python work.py --config-file="config.yml" --listen-url="127.0.0.1:9090"

Docker

  • Local mode
docker build -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
docker build -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
    javalint:
      - -jar
      - /home/craftslab/opt/javalint/lib/javalint.jar
      - --file
    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

Release files for lintwork 1.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lintwork 1.12.0
File Size Uploaded
lintwork-1.12.0.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lintwork 1.12.0
File Interpreter ABI Platform
lintwork-1.12.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 50.6 kB

Release files / lintwork-1.12.0.tar.gz

Download URL lintwork-1.12.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
736bdc1b981a422c5c9204119fe4b46bc92cfcb72d2997914bb3d6bd5cb93313
BLAKE2b-256 checksum
How to use checksums
9a49aa50b454331bf5709fde7eef629d2e6e55c6a638f72522d392fc656dabe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / lintwork-1.12.0-py2.py3-none-any.whl

Download URL lintwork-1.12.0-py2.py3-none-any.whl
Size 32.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
be96bd95a62fc885b21e2f7b4b25863ae041e33a7cbd18ba5deb3d7d2a0f2cb7
BLAKE2b-256 checksum
How to use checksums
4c1717272749bede75a7f0d0d63d35fdd57e467d3c95a7da29decbf58ea9f0db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.12.0 This release

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.21

2 release files

1.2.20

2 release files

1.2.19

2 release files

1.2.18

2 release files

1.2.17

2 release files

1.2.16

2 release files

1.2.15

2 release files

1.2.14

2 release files

1.2.13

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page