saltstack / saltstack/salt

Add rst/sphinx ".. deprecated::" directive to docs in Deprecating Code guidance

Open
#58,208 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Deprecation doc-rework documentation severity-medium time-estimate-long-term
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Deprecating code, be it functions and args/options, should involve including something similar to the following within their respective function docstrings:

.. deprecated:: 3002,3001.1
    This function is deprecated. Please use ``new_function()`` instead.

This adds .. deprecated:: Sphinx / rst directives, which render into something like this, using salt.netapi.rest_cherrypy docs as an example, for the expire_responses option:

Deprecated since version 2016.11.9,2017.7.3,2018.3.0: The "expire_responses" configuration setting, which corresponds to the timeout_monitor setting in CherryPy, is no longer supported in CherryPy versions >= 12.0.0.

Source code of above example:

https://github.com/saltstack/salt/blob/1a5ce828ad983e15205a80ae361150069afaebac/salt/netapi/rest_cherrypy/app.py#L109-L117

The docs need to be updated here:

Additional context

Include examples, and provide best practice for function deprecation vs. arg/option deprecations, perhaps?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with doc/topics/development/deprecations.rst and compare its current guidance with the linked salt.netapi.rest_cherrypy example in app.py lines 109-117. Update the documentation to explain the .. deprecated:: directive, include examples, and distinguish function deprecation from argument or option deprecation; the documentation should clearly describe the recommended practice.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.