Skip to content

Commit

Permalink
Modifies lint task from golang directory according to the new reorg p…
Browse files Browse the repository at this point in the history
…roposal

**NOTE: This only modifies the content of the yaml, changing
        the location of the file will be done in a different
        commit to make review easier

Changes include:
  - adds version label
  - adds a minimum pipeline versions supported by the task
  - adds tags for task
  - adds display name for task
  - modified description to add a summary

Issue: tektoncd#386

Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Jun 30, 2020
1 parent 276fb33 commit 2e3c7b0
Showing 1 changed file with 41 additions and 32 deletions.
73 changes: 41 additions & 32 deletions golang/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,49 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: golangci-lint
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tags: lint
displayName: "golangci lint"
spec:
description: >-
This Task is Golang task to validate Go projects.
params:
- name: package
description: base package (and its children) under validation
- name: flags
description: flags to use for the test command
default: --verbose
- name: version
description: golangci-lint version to use
default: "v1.21.0"
- name: GOOS
description: "running operating system target"
default: linux
- name: GOARCH
description: "running architecture target"
default: amd64
- name: GO111MODULE
description: "value of module support"
default: auto
workspaces:
- name: source
mountPath: /workspace/src/$(params.package)
steps:
- name: lint
image: golangci/golangci-lint:$(params.version)
workingDir: $(workspaces.source.path)
script: |
golangci-lint run $(params.flags)
env:
- name: GOPATH
value: /workspace
- name: package
description: base package (and its children) under validation
- name: flags
description: flags to use for the test command
default: --verbose
- name: version
description: golangci-lint version to use
default: "v1.21.0"
- name: GOOS
value: "$(params.GOOS)"
description: "running operating system target"
default: linux
- name: GOARCH
value: "$(params.GOARCH)"
description: "running architecture target"
default: amd64
- name: GO111MODULE
value: "$(params.GO111MODULE)"
description: "value of module support"
default: auto
workspaces:
- name: source
mountPath: /workspace/src/$(params.package)
steps:
- name: lint
image: golangci/golangci-lint:$(params.version)
workingDir: $(workspaces.source.path)
script: |
golangci-lint run $(params.flags)
env:
- name: GOPATH
value: /workspace
- name: GOOS
value: "$(params.GOOS)"
- name: GOARCH
value: "$(params.GOARCH)"
- name: GO111MODULE
value: "$(params.GO111MODULE)"

0 comments on commit 2e3c7b0

Please sign in to comment.