Skip to content

Commit

Permalink
fix review comments and switch to spectral linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur committed Nov 29, 2024
1 parent 36c6da9 commit 7b2f57e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ jobs:
with:
go-version-file: go.mod

- name: Lint
- name: Lint go code
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=30m
version: v1.60

shell: bash
- name: Run Vacuum
run: |
go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml
shell: bash

# Run Spectral
- name: Lint OpenAPI spec
uses: stoplightio/spectral-action@2ad0b9302e32a77c1caccf474a9b2191a8060d83 # v0.8.11
with:
file_glob: 'api/*.yaml'
1 change: 1 addition & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: ["spectral:oas"]
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ licensecheck:
exit 1; \
fi

# Requires to install spectral. See https://github.com/stoplightio/spectral
oas-lint:
go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml
spectral lint api/*.yaml

# Run all the linters
.PHONY: lint
Expand Down
4 changes: 2 additions & 2 deletions api/webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
openapi: "3.0.0"
info:
version: 0.14.0
version: v0.15.0
title: External DNS Webhook Server
description: >-
Implements the external DNS webhook endpoints.
Expand Down Expand Up @@ -44,7 +44,7 @@ paths:
- example.com
'500':
description: |
Failed to provide the list of domains we serve.
Negociation failed.
/records:
get:
Expand Down
1 change: 1 addition & 0 deletions provider/webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func TestAdjustEndpoints(t *testing.T) {
}
j, _ := json.Marshal(endpoints)
w.Write(j)

}))
defer svr.Close()

Expand Down

0 comments on commit 7b2f57e

Please sign in to comment.