Skip to content

Commit

Permalink
Merge pull request #637 from jivaccarezza/bug/validation-doc
Browse files Browse the repository at this point in the history
Fix check document and check item signature in example
  • Loading branch information
jacebrowning authored Feb 26, 2024
2 parents 4dcff34 + 6e3baa7 commit 0cd68d3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/api/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ For this use case, create a script to call in place of the default command-line
```python
#!/usr/bin/env python


import sys
from doorstop import build, DoorstopInfo, DoorstopWarning, DoorstopError

Expand All @@ -56,12 +55,12 @@ def main():
sys.exit(0 if success else 1)


def check_document(document):
def check_document(document, tree):
if sum(1 for i in document if i.normative) < 10:
yield DoorstopInfo("fewer than 10 normative items")


def check_item(item):
def check_item(item, document, tree):
if not item.get('type'):
yield DoorstopWarning("no type specified")
if item.derived and not item.get('rationale'):
Expand Down

0 comments on commit 0cd68d3

Please sign in to comment.