Skip to content

Commit f204cfa

Browse files
committed
feat: add open-rpc linter to ci
1 parent f1ea462 commit f204cfa

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
with:
2020
go-version: ^1.18
2121
id: go
22+
- name: Install openrpc-linter
23+
run: go install github.com/shanejonas/openrpc-linter@latest
24+
- name: Run openrpc-linter
25+
run: openrpc-linter lint refs-openrpc.json -r openrpc-lint.yml
26+
2227
- name: Install speccheck
2328
run: go install github.com/lightclient/rpctestgen/cmd/speccheck@latest
2429
- name: Run speccheck

openrpc-lint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
description: "OpenRPC validation rules"
2+
rules:
3+
info-title:
4+
description: "Info must have description. It supports markdown, and usually shows up as the index page of the documentation."
5+
given: "$.info"
6+
severity: "error"
7+
then:
8+
field: "description"
9+
function: "truthy"
10+
method-summary:
11+
description: "Method must have a summary."
12+
given: "$.methods[*]"
13+
severity: "error"
14+
then:
15+
field: "summary"
16+
function: "truthy"

0 commit comments

Comments
 (0)