Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing first line of task's docsting by --list #105 #110

Merged
merged 4 commits into from May 6, 2014

Conversation

hirokiky
Copy link
Contributor

Supported issue #105.

I also added a test but I'm not similar with the testing tool 'spec'.
So that, please teach me about it of fix the code If you don't like the addition.

docstring = collection[primary].__doc__
if docstring:
max_width = max(map(len, names))
out += " " * (max_width - len(primary) + 1) + docstring.split('\n')[0]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest adding an lstrip() there (e.g. "... + docstring.lstrip().split('\n')[0]") to support docstrings that start on the line after the quotes.

@hirokiky
Copy link
Contributor Author

@rread Thanks! I fixed it just now.

@jthigpen
Copy link

jthigpen commented Feb 8, 2014

When a submodule has a default task, the denotation of that task causes a bug in the formatting of that output.

  aws.elb_status           Check Status of all load balancers.
  deploy.deploy (deploy)            Deploy the branch (default=stable) to staging.
  deploy.jenkins           Establish ssh tunnel to jenkins on port 9000 and open Jenkins.

@hirokiky
Copy link
Contributor Author

hirokiky commented Feb 9, 2014

@jthigpen Thank you. You are completely right. I will fix it as soon as I can!.

It seems this bug caused by a task with some aliases, not only the case of 'default task'.
so that when I fix tests, I will add a task decorated with task(aliases=('',)).
Because It is easier to write and understand that meaning than adding a taks having default task.

@patcon
Copy link

patcon commented Feb 23, 2014

👍

@hirokiky
Copy link
Contributor Author

hirokiky commented May 3, 2014

This pull-request still can be merged with master safely.
I tried with 0bcf45a.

@bitprophet bitprophet merged commit d321987 into pyinvoke:master May 6, 2014
bitprophet added a commit that referenced this pull request May 6, 2014
@bitprophet
Copy link
Member

Thanks a bunch! Very useful change :)

Merged this in, rejiggered a bunch of it (there was existing code to handle this display format so I used that), added changelog, and seems to all work now. Just pushed.

@hirokiky
Copy link
Contributor Author

hirokiky commented May 7, 2014

Im glad, thanks a lot.

@hirokiky hirokiky deleted the list-with-docstring branch May 7, 2014 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants