Skip to content

Commit

Permalink
Allow Rule description to span lines
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed Jan 15, 2019
1 parent 0d22caa commit de8b31d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions squabble/rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ def meta(cls):
>>> class MyRule(BaseRule):
... '''
... Brief description of rule.
... Brief description of rule. This can
... wrap to the next line.
...
... More details about this rule.
... '''
>>> m = MyRule.meta()
>>> m['name']
'MyRule'
>>> m['description']
'Brief description of rule.'
'Brief description of rule. This can wrap to the next line.'
>>> m['help']
'More details about this rule.'
"""
Expand All @@ -57,9 +58,11 @@ def meta(cls):
if len(split_doc) == 2:
help = split_doc[1]

description = split_doc[0].replace('\n', ' ')

return {
'name': cls.__name__,
'description': split_doc[0],
'description': description,
'help': help
}

Expand Down

0 comments on commit de8b31d

Please sign in to comment.