-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fab -d
display detailed task info including signature
#922
Conversation
because the return type changed from plain tuple to namedtuple since 2.6
Thanks, this looks awesome! Only thing left undone was a changelog entry but I can add that easily enough. When testing it by hand I noticed an oddball issue with indentation that I am trying to track down. This is mostly a note to myself for later today when I return from AFK. In master,
In this ticket's branch, the 2nd line (+ subsequent lines - tested that temporarily) of the docstring is indented an extra indent, which is incorrect:
|
so that the docstring and the method signature are uniformly indented.
@bitprophet Fixed on the branch. Previously, the method signature (the added bits) and the docstring don't have the same indentation level (the docstring was manually indented), so when the output was produced, the second line of the docstring is indented twice. Now I call
|
Cool, thanks. I added a test for the issue as well, and a changelog entry, and am currently running tests + pushing. |
Hrm, as usual Github is disagreeing with me (and I didn't rebase; might've been the cherry-pick of the last commit) - it is in fact fully merged to master. Closing manually. |
Currently, running
fab -d <task_name>
shows only the docstring. Sometimes, if the task takes arguments, merely listing what's in the docstring isn't enough. You can always read the function definition in the fabfile, but if the fabfile exports tasks from another module, you will have to trace to that module to find the definition.This PR spares you of all that trouble by making the signature, as well as any information of default arguments available to you through
fab -d <task_name>
. This works on old style tasks, decorated tasks and class-based tasks.