1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-25 06:17:50 +00:00
catalog/task/golangci-lint/0.1
SM43 9770a832b8 Adds context param in golangci-lint
This adds context param to provide path to the directory to use
as context.

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
2021-02-11 04:26:46 +00:00
..
tests Add add_task helper function for tests 2020-10-07 17:51:55 +01:00
golangci-lint.yaml Adds context param in golangci-lint 2021-02-11 04:26:46 +00:00
README.md Adds context param in golangci-lint 2021-02-11 04:26:46 +00:00

Golangci Lint

This Task is a Golang task to validate Go projects.

Install the task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/golangci-lint/0.1/golangci-lint.yaml

Parameters

  • package: base package under validation
  • context: path to the directory to use as context (default: .)
  • flags: flags to use for golangci-lint command (default:--verbose)
  • version: golangci-lint version to use (default: v1.16)
  • GOOS: operating system target (default: linux)
  • GOARCH: architecture target (default: amd64)
  • GO111MODULE: value of module support (default: auto)

Workspaces

  • source: A Workspace containing the source to build.

Usage

This TaskRun runs the Task to validate tektoncd/pipeline pkg package with golangci-lint.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: lint-my-code
spec:
  taskRef:
    name: golangci-lint
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source
  params:
  - name: package
    value: github.com/tektoncd/pipeline
  - name: flags
    value: --verbose