Skip to content

Commit

Permalink
add the config file for pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: roman-kiselenko <[email protected]>
  • Loading branch information
roman-kiselenko committed Nov 15, 2023
1 parent a7edd28 commit 82af693
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: ["pre-push"]
exclude: '(^vendor|.*golden$)'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-yaml
args: ["--allow-multiple-documents"]
exclude: '(test\/gohelloworld\/gohelloworld-chart\/templates\/.*yaml$)' # Ignore yaml files with {{ }} cause they're not a valid
- id: check-shebang-scripts-are-executable
- id: check-json
- id: detect-private-key
exclude: "(.*_test.go|^examples\/v1\/pipelineruns\/beta\/isolated-workspaces.yaml$)"
- repo: local
hooks:
- id: lint-go
name: "Run make golangci-lint"
entry: make
args: ["golangci-lint"]
language: system
types: [go]
pass_filenames: false
- id: test-unit
name: "Unit testing"
entry: make
args: ["test-unit"]
language: system
types: [go]
pass_filenames: false
2 changes: 2 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ You must install these tools:

1. [`git`](https://help.github.com/articles/set-up-git/): For source control

1. [`pre-commit`](https://pre-commit.com/#install): Git hook scripts

1. [`go`](https://golang.org/doc/install): The language Tekton Pipelines is
built in.
> **Note** Golang [version v1.15](https://golang.org/dl/) or higher is recommended.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ![pipe](./pipe.png) Tekton Pipelines

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Go Report Card](https://goreportcard.com/badge/tektoncd/pipeline)](https://goreportcard.com/report/tektoncd/pipeline)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4020/badge)](https://bestpractices.coreinfrastructure.org/projects/4020)

Expand Down

0 comments on commit 82af693

Please sign in to comment.