Skip to content

Commit

Permalink
Make goal listing use only the first sentence of the description.
Browse files Browse the repository at this point in the history
Now that the description can be inferred from a task docstring,
this is pertinent.

Testing Done:
Manual testing before and after. Ran the list_goals tests.

Bugs closed: 1682

Reviewed at https://rbcommons.com/s/twitter/r/2366/
  • Loading branch information
benjyw authored and Benjy committed Jun 15, 2015
1 parent 80a2468 commit 3a15b93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/python/pants/backend/core/tasks/list_goals.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def report():
undocumented = []
max_width = 0
for goal in Goal.all():
if goal.description:
documented_rows.append((goal.name, goal.description))
desc = goal.description
if desc:
first_sentence = desc.partition('\n')[0]
documented_rows.append((goal.name, first_sentence))
max_width = max(max_width, len(goal.name))
elif self.get_options().all:
undocumented.append(goal.name)
Expand Down

0 comments on commit 3a15b93

Please sign in to comment.