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

Update baredoc to dump docstrings like sys.doc #56902

Merged
merged 4 commits into from
May 7, 2020

Conversation

mchugh19
Copy link
Contributor

What does this PR do?

Improves the recently merged baredoc to support display of module and module.function docstrings like sys.doc. Leverages the same formatting util as sys.doc to generate the same output, only baredoc does not require the state or execution module to be loadable by salt. Thus, it is useful in situations when you need docs for modules which cannot be loaded on the current machine. Or to export docstrings in bulk.

What issues does this PR fix or reference?

None

Previous Behavior

Docstrings not suppored by baredoc

New Behavior

(zpool module is not loadable on this machine)

# salt-call --local baredoc.module_docs zpool
local:
    ----------
    zpool:
        Module for running ZFS zpool command
        
        :codeauthor:    Nitin Madhok <nmadhok@clemson.edu>, Jorge Schrauwen <sjorge@blackdot.be>
...

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

No

@mchugh19 mchugh19 requested a review from a team as a code owner April 26, 2020 19:24
@ghost ghost requested review from cmcmarrow and removed request for a team April 26, 2020 19:25
@mchugh19
Copy link
Contributor Author

re-run pr-centos7-py3-pycryptodomex

@mchugh19
Copy link
Contributor Author

re-run pr-ubuntu1604-py3-pycryptodomex

@mchugh19
Copy link
Contributor Author

mchugh19 commented May 6, 2020

re-run pr-macosxmojave-py3

@dwoz dwoz merged commit c58707e into saltstack:master May 7, 2020
@sagetherage sagetherage added the ZRelease-Sodium retired label label May 18, 2020
@max-arnold
Copy link
Contributor

@mchugh19 Hopefully it is not too late to fix the examples inside of docstrings:

def list_states(name=False, names_only=False):
    """
        salt myminion baredoc.modules_and_args
def list_modules(name=False, names_only=False):
   """
    .. code-block:: bash

        salt myminion baredoc.modules_and_args

        myminion:
            ----------
        [...]
          at:
          - present:
              name: null
              timespec: null

@mchugh19 mchugh19 mentioned this pull request May 30, 2020
1 task
@mchugh19
Copy link
Contributor Author

@mchugh19 Hopefully it is not too late to fix the examples inside of docstrings:

Good catch! PR in #57503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZRelease-Sodium retired label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants