Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

Conformance cases /

check-precedence

Tests one check in the rule vocabulary: how it decides, and what it reports.

Our implementation passes this case when its check --json output for the input below equals the expected output.

Input

nodes/a.md
---
id: a
type: svc
plane: p
---
nodes/p.md
---
id: p
type: plane
fields:
  order: 1
---
nodes/r.md
---
id: r
type: rule
fields:
  statement: s
  applies_to: {type: svc}
  check: {require_fields: [owner], require_link: {type: x}}
---

Expected output

1 ghosts · 0 load errors · 3 nodes · 1 results

expected.json
{
 "ghosts": [
  {
   "link": "x",
   "node": "a",
   "plane": "p",
   "rule": "r",
   "to_type": null
  }
 ],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {},
   "id": "a",
   "links": [],
   "parent": null,
   "plane": "p",
   "title": "a",
   "type": "svc"
  },
  {
   "body": "",
   "fields": {
    "order": 1
   },
   "id": "p",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "p",
   "type": "plane"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "svc"
    },
    "check": {
     "require_fields": [
      "owner"
     ],
     "require_link": {
      "type": "x"
     }
    },
    "statement": "s"
   },
   "id": "r",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "r",
   "type": "rule"
  }
 ],
 "results": [
  {
   "node": "a",
   "rule": "r",
   "severity": "warn",
   "status": "fail"
  }
 ],
 "structure": {
  "errors": [],
  "warnings": []
 }
}