Skip to content

Commit

Permalink
Use inspect.cleandoc for BaseRule.get_meta
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed Jan 10, 2019
1 parent ff82204 commit fdcfef9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion squabble/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def show_rule(name):
**color
}))

print('{bold}{name}{reset} - {description}\n{help}'.format(**{
print('{bold}{name}{reset} - {description}\n\n{help}'.format(**{
**meta,
**color
}))
Expand Down
4 changes: 3 additions & 1 deletion squabble/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import inspect

from squabble.rule import Registry


Expand Down Expand Up @@ -49,7 +51,7 @@ def meta(cls):
>>> m['help']
'More details about this rule.'
"""
split_doc = (cls.__doc__ or '').strip().split('\n', 1)
split_doc = inspect.cleandoc(cls.__doc__ or '').split('\n\n', 1)

help = None
if len(split_doc) == 2:
Expand Down

0 comments on commit fdcfef9

Please sign in to comment.