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-title-id

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/longer-id.md
---
id: longer-id
type: t
title: Ok
---
nodes/n1.md
---
id: n1
type: t
title: Short
---
nodes/n2.md
---
id: n2
type: t
title: Much too long
---
nodes/n3.md
---
id: n3
type: t
---
nodes/n4.md
---
id: n4
type: t
title: ééééé
---
nodes/r1.md
---
id: r1
type: rule
fields:
  statement: s
  applies_to: {type: t}
  check: {field_is: {title: {max_length: 5}}}
---
nodes/r2.md
---
id: r2
type: rule
fields:
  statement: s
  applies_to: {type: t}
  check: {field_is: {id: {max_bytes: 3}}}
---
nodes/r3.md
---
id: r3
type: rule
fields:
  statement: s
  applies_to: {type: t}
  check: {field_is: {title: {max_bytes: 5, min_length: 2}}}
---

Expected output

0 ghosts · 0 load errors · 8 nodes · 15 results

expected.json
{
 "ghosts": [],
 "load_errors": [],
 "nodes": [
  {
   "body": "",
   "fields": {},
   "id": "longer-id",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "Ok",
   "type": "t"
  },
  {
   "body": "",
   "fields": {},
   "id": "n1",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "Short",
   "type": "t"
  },
  {
   "body": "",
   "fields": {},
   "id": "n2",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "Much too long",
   "type": "t"
  },
  {
   "body": "",
   "fields": {},
   "id": "n3",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "n3",
   "type": "t"
  },
  {
   "body": "",
   "fields": {},
   "id": "n4",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "ééééé",
   "type": "t"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "t"
    },
    "check": {
     "field_is": {
      "title": {
       "max_length": 5
      }
     }
    },
    "statement": "s"
   },
   "id": "r1",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "r1",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "t"
    },
    "check": {
     "field_is": {
      "id": {
       "max_bytes": 3
      }
     }
    },
    "statement": "s"
   },
   "id": "r2",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "r2",
   "type": "rule"
  },
  {
   "body": "",
   "fields": {
    "applies_to": {
     "type": "t"
    },
    "check": {
     "field_is": {
      "title": {
       "max_bytes": 5,
       "min_length": 2
      }
     }
    },
    "statement": "s"
   },
   "id": "r3",
   "links": [],
   "parent": null,
   "plane": null,
   "title": "r3",
   "type": "rule"
  }
 ],
 "results": [
  {
   "node": "longer-id",
   "rule": "r1",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "longer-id",
   "rule": "r2",
   "severity": "warn",
   "status": "fail"
  },
  {
   "node": "longer-id",
   "rule": "r3",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n1",
   "rule": "r1",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n1",
   "rule": "r2",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n1",
   "rule": "r3",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n2",
   "rule": "r1",
   "severity": "warn",
   "status": "fail"
  },
  {
   "node": "n2",
   "rule": "r2",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n2",
   "rule": "r3",
   "severity": "warn",
   "status": "fail"
  },
  {
   "node": "n3",
   "rule": "r1",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n3",
   "rule": "r2",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n3",
   "rule": "r3",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n4",
   "rule": "r1",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n4",
   "rule": "r2",
   "severity": "warn",
   "status": "pass"
  },
  {
   "node": "n4",
   "rule": "r3",
   "severity": "warn",
   "status": "fail"
  }
 ],
 "structure": {
  "errors": [],
  "warnings": []
 }
}