Skip to content

Add command line capability to print out the full docstring of a session #939

@namurphy

Description

@namurphy

How would this feature be useful?

When I'm writing a noxfile.py, I sometimes write helpful or contextual information in a second paragraph in the docstring of a session (such as in this session).

Individual session docstrings can be used to:

  • Show examples of how to invoke a nox session
  • Describe the different parametrizations of a session
  • Describe arguments that are often passed to a session (e.g., a filename or a pytest flag to run only certain tests)
  • Describe differences for when a session is invoked locally vs. in CI

Describe the solution you'd like

Currently, doing nox -l print outs only the first lines of docstrings, but I don't know of a way to print out the full docstrings.

Some possible syntaxes would be:

  1. nox -l session_name to print out the full docstring of a session
  2. nox -l -v to print out the full docstrings of all the sessions (though this would get lengthy)

Describe alternatives you've considered

  • Create a new command line flag, like nox -d session_name (which would keep things separate, but it may be harder to remember)
  • Include contextual information in the top-level docstring of noxfile.py (which would become unwieldy for a large noxfile.py)

Anything else?

Thank you so much to everyone who created this wonderful tool!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions