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

Pylint comments appear in the API documentation (e.g., # pylint: disable=line-too-long) #4405

Open
andylizf opened this issue Nov 24, 2024 · 0 comments

Comments

@andylizf
Copy link
Contributor

In the SkyPilot API documentation where pylint comments, such as # pylint: disable=line-too-long, are included in the generated documentation. For example:

The job recovery strategy to use for the managed job to recover the cluster from preemption. Refer to recovery_strategy module # pylint: disable=line-too-long for more details. When a dict is provided, it can have the following fields:

This inclusion seems unintended and appears out of place in the user-facing documentation.

Suggested Fixes:

  1. Reposition the Pylint Comments
    Place # pylint directives outside of docstrings, ideally above the function or module definitions. For instance:

    # pylint: disable=line-too-long
    def some_function():
        """
        The job recovery strategy to use for the managed job to recover the cluster
        from preemption. Refer to the recovery_strategy module for more details.
        """
  2. Filter Pylint Comments During Documentation Generation
    Use a Sphinx filter to strip out # pylint: comments during documentation generation. This can be implemented using either:

    • Regex-based filtering to exclude lines containing # pylint.
    • AST-based filtering to clean up docstrings before they are processed by Sphinx.

I think cleaning this up would significantly improve the documentation’s clarity and polish.

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

No branches or pull requests

1 participant