velero/.github/workflows/pr-linter-check.yml

23 lines
446 B
YAML
Raw Normal View History

Add linter (#2615) * Add linter to Makefile and build image * Also make it part of verify step Signed-off-by: Tony Batard <tbatard@pivotal.io> * clean up of Makefile and permissions for .go/golangci-lint Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * changed verify-lint.sh to lint.sh to avoid breaking ci Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Add changelog Signed-off-by: Tony Batard <tbatard@pivotal.io> * Add LINTERS option to run only specific linters * e.g. make lint LINTERS=unused,deadcode Signed-off-by: Tony Batard <tbatard@pivotal.io> * adding timeout to golangci-lint, and checking cache Signed-off-by: Matyas Danter <mdanter@vmware.com> * Fixed some formatting and added comments Signed-off-by: Matyas Danter <mdanter@vmware.com> * modifying lint script to use golangci.yaml Signed-off-by: Matyas Danter <mdanter@vmware.com> * update to move default linters to Makefile Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Adding documentation for lint make targets. Signed-off-by: Matyas Danter <mdanter@vmware.com> * Update Copyright with current year Signed-off-by: Tony Batard <tbatard@pivotal.io> * initial git workflow commit Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Added lint-all target and implemented -n as default * Added a local-lint-all and lint-all target that will show lint errors for all of the codebase * changed the default of lint and local-lint to only show new lint errors Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * updated docs to reflect new target Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Duffie Cooley <cooleyd@vmware.com> Co-authored-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Matyas Danter <mdanter@vmware.com>
2020-06-30 16:51:10 +00:00
name: Pull Request Linter Check
on: [pull_request]
jobs:
build:
name: Run Linter Check
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
Add linter (#2615) * Add linter to Makefile and build image * Also make it part of verify step Signed-off-by: Tony Batard <tbatard@pivotal.io> * clean up of Makefile and permissions for .go/golangci-lint Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * changed verify-lint.sh to lint.sh to avoid breaking ci Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Add changelog Signed-off-by: Tony Batard <tbatard@pivotal.io> * Add LINTERS option to run only specific linters * e.g. make lint LINTERS=unused,deadcode Signed-off-by: Tony Batard <tbatard@pivotal.io> * adding timeout to golangci-lint, and checking cache Signed-off-by: Matyas Danter <mdanter@vmware.com> * Fixed some formatting and added comments Signed-off-by: Matyas Danter <mdanter@vmware.com> * modifying lint script to use golangci.yaml Signed-off-by: Matyas Danter <mdanter@vmware.com> * update to move default linters to Makefile Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Adding documentation for lint make targets. Signed-off-by: Matyas Danter <mdanter@vmware.com> * Update Copyright with current year Signed-off-by: Tony Batard <tbatard@pivotal.io> * initial git workflow commit Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Added lint-all target and implemented -n as default * Added a local-lint-all and lint-all target that will show lint errors for all of the codebase * changed the default of lint and local-lint to only show new lint errors Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * updated docs to reflect new target Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Duffie Cooley <cooleyd@vmware.com> Co-authored-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Matyas Danter <mdanter@vmware.com>
2020-06-30 16:51:10 +00:00
- name: Check out the code
uses: actions/checkout@v4
Add linter (#2615) * Add linter to Makefile and build image * Also make it part of verify step Signed-off-by: Tony Batard <tbatard@pivotal.io> * clean up of Makefile and permissions for .go/golangci-lint Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * changed verify-lint.sh to lint.sh to avoid breaking ci Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Add changelog Signed-off-by: Tony Batard <tbatard@pivotal.io> * Add LINTERS option to run only specific linters * e.g. make lint LINTERS=unused,deadcode Signed-off-by: Tony Batard <tbatard@pivotal.io> * adding timeout to golangci-lint, and checking cache Signed-off-by: Matyas Danter <mdanter@vmware.com> * Fixed some formatting and added comments Signed-off-by: Matyas Danter <mdanter@vmware.com> * modifying lint script to use golangci.yaml Signed-off-by: Matyas Danter <mdanter@vmware.com> * update to move default linters to Makefile Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Adding documentation for lint make targets. Signed-off-by: Matyas Danter <mdanter@vmware.com> * Update Copyright with current year Signed-off-by: Tony Batard <tbatard@pivotal.io> * initial git workflow commit Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> * Added lint-all target and implemented -n as default * Added a local-lint-all and lint-all target that will show lint errors for all of the codebase * changed the default of lint and local-lint to only show new lint errors Signed-off-by: Duffie Cooley <cooleyd@vmware.com> * updated docs to reflect new target Signed-off-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Duffie Cooley <cooleyd@vmware.com> Co-authored-by: mtritabaugh <mtritabaugh@vmware.com> Co-authored-by: Matyas Danter <mdanter@vmware.com>
2020-06-30 16:51:10 +00:00
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.57.2
args: --out-format=colored-line-number