From 2e3c7b07823079f9405f0428c5241172f194d775 Mon Sep 17 00:00:00 2001 From: pratap0007 Date: Tue, 30 Jun 2020 19:06:06 +0530 Subject: [PATCH] Modifies lint task from golang directory according to the new reorg proposal **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: #386 Signed-off-by: Shiv Verma --- golang/lint.yaml | 73 +++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/golang/lint.yaml b/golang/lint.yaml index 4c76b564e8..00744f8648 100644 --- a/golang/lint.yaml +++ b/golang/lint.yaml @@ -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)"