Skip to content

miare-ir/staticcheck-gitlab-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

staticcheck-gitlab-ci

This repo is an adaptor that converts the staticcheck output to a format that is recognized by the gitlab-ci.

Installation

go install github.com/miare-ir/staticcheck-gitlab-ci@latest

Usage

This application expects the staticcheck result as json in stdin and outputs the converted result as json.

After installation run the below at the desired directory:

staticcheck -f json ./... | staticcheck-gitlab-ci

Check the example for a full integration.

Example

Somewhere in your gitlab-ci.yml you'll need to add sth like this:

stages:
  - checks

code_quality:
  stage: checks
  script:
    - go install honnef.co/go/tools/cmd/[email protected]
    - go install github.com/miare-ir/staticcheck-gitlab-ci@latest
    - staticcheck -f json ./... | staticcheck-gitlab-ci > staticcheck-report.json
  allow_failure: true
  artifacts:
    when: always
    reports:
      codequality: staticcheck-report.json

By doing so whenever the pipeline is ran, the Code Quality Report is put on the merge request:

img

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages