Commit e2dbd4b3 authored by GridexX's avatar GridexX Committed by Thomas Boni
Browse files

feat(golint): use official docker image



Signed-off-by: default avatarGridexX <arsene582@gmail.com>
parent 5ca7459d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [1.3.0] - 2023-03-02
* Add `GOLINT_VERSION` variable to specify the version of golangci-lint
* Change `IMAGE_TAG` from `v1.50.1` to `alpine3.17`
* Change the default image from `golangci/golangci-lint` to `golang` 

## [1.2.1] - 2023-02-28
* Fix broken documentation links

+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ A ready-to-use job to lint your Golang project. It includes a lot of linters suc
| `GOLINT_REPORTS_DIRECTORY` | Name for the reports directory | `reports` |
| `GOLINT_OUTPUT_FORMAT` | Format for the linters. Could be `junit-xml`, `code-climate` or `colored-line-number` for printing the output in the console.  | `junit-xml` |
| `ADDITIONAL_OPTIONS` | [Additional options](https://golangci-lint.run/usage/configuration/) available for the user, they are added at the end of lint command | ` ` |
| `IMAGE_TAG` | The default tag for the docker image | `v1.50.1`  |
| `GOLINT_VERSION` | The version of golangci-lint | `1.51.2`  |
| `IMAGE_TAG` | The default tag for the docker image | `alpine3.17`  |

## Author
This resource is an **[official job](https://docs.r2devops.io/get-started/faq/#use-a-template)** added in [**R2Devops repository**](https://gitlab.com/r2devops/hub) by [@Alexia](https://gitlab.com/alexiaognard). Was improved by [@GridexX](https://gitlab.com/GridexX) on October 2022.
+6 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ stages:
  - tests

golint:
  image: golangci/golangci-lint:${IMAGE_TAG}
  image: golang:${IMAGE_TAG}
  stage: tests
  variables:
    PROJECT_ROOT: "."
@@ -12,8 +12,12 @@ golint:
    GOLINT_REPORTS_DIRECTORY: "reports"
    GOLINT_OUTPUT_FORMAT: "junit-xml" 
    ADDITIONAL_OPTIONS: ""
    IMAGE_TAG: "v1.50.1"
    GOLINT_VERSION: "1.51.2"
    IMAGE_TAG: "alpine3.17"
  script:
    - wget -O ./golint.tar.gz "https://github.com/golangci/golangci-lint/releases/download/v${GOLINT_VERSION}/golangci-lint-${GOLINT_VERSION}-linux-amd64.tar.gz"
    - tar -xzf ./golint.tar.gz
    - mv ./golangci-lint-${GOLINT_VERSION}-linux-amd64/golangci-lint /usr/local/bin/golangci-lint
    - cd ${CI_PROJECT_DIR}/${PROJECT_ROOT}
    - mkdir ${GOLINT_REPORTS_DIRECTORY}
    - touch ${GOLINT_REPORTS_DIRECTORY}/report-golint.xml