diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1be2b2f45..1d535941d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,6 +19,11 @@ jobs: with: go-version: ^1.18 id: go + - name: Install openrpc-linter + run: go install github.com/shanejonas/openrpc-linter@latest + - name: Run openrpc-linter + run: openrpc-linter lint refs-openrpc.json -r openrpc-lint.yml + - name: Install speccheck run: go install github.com/lightclient/rpctestgen/cmd/speccheck@latest - name: Run speccheck diff --git a/openrpc-lint.yml b/openrpc-lint.yml new file mode 100644 index 000000000..eae6b62b2 --- /dev/null +++ b/openrpc-lint.yml @@ -0,0 +1,16 @@ +description: "OpenRPC validation rules" +rules: + info-title: + description: "Info must have description. It supports markdown, and usually shows up as the index page of the documentation." + given: "$.info" + severity: "error" + then: + field: "description" + function: "truthy" + method-summary: + description: "Method must have a summary." + given: "$.methods[*]" + severity: "error" + then: + field: "summary" + function: "truthy"