Skip to content

Commit faf77e9

Browse files
committed
adding linting to CI and linting scripts for local development
1 parent 42ac3ca commit faf77e9

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

.github/workflows/golangci-lint.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, reopened]
7+
8+
jobs:
9+
golangci:
10+
name: lint
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: golangci-lint
15+
uses: golangci/golangci-lint-action@v2
16+
with:
17+
version: v1.34
18+
args: -v

.golangci.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
linters:
2+
enable:
3+
- goheader
4+
- golint
5+
disable-all: true
6+
# all available settings of specific linters
7+
linters-settings:
8+
goheader:
9+
template-path: code-header-template.txt
10+
issues:
11+
max-issues-per-linter: 0
12+
max-same-issues: 0

code-header-template.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright 2020 VMware, Inc.
2+
SPDX-License-Identifier: Apache-2.0

hack/build-and-lint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -e -x -u
4+
5+
./hack/build.sh
6+
./hack/linter.sh

hack/linter.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
4+
golangci-lint cache clean
5+
golangci-lint run

0 commit comments

Comments
 (0)