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

[python] add type hints in docs/conf.py #4526

Merged
merged 4 commits into from
Aug 19, 2021
Merged

Conversation

jameslamb
Copy link
Collaborator

Adds type hints to code in docs/conf.py, as part of #3756.

Notes for Reviewers

#3756 has been open for about 8 months now, so I think it's ok for maintainers to start picking up the work to finish it and not wait any longer for outside contributors to find it from searches for good first issue.

Better type hints will improve the ability of mypy to catch issues (#3868 ).

docs/conf.py Outdated
@@ -197,7 +198,7 @@ def run(self):
latex_logo = str(CURR_PATH / 'logo' / 'LightGBM_logo_black_text_small.png')


def generate_doxygen_xml(app):
def generate_doxygen_xml(app: Any) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use sphinx.application.Sphinx for app (here and at L246 and L308)?
https://www.sphinx-doc.org/en/master/extdev/appapi.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, can do. I was just following the documentation below.

    Parameters
    ----------
    app : object
        The application object representing the Sphinx process.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can update docstring as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! Updated in 81f0a82

docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jameslamb jameslamb merged commit 67f2cb3 into master Aug 19, 2021
@jameslamb jameslamb deleted the misc/type-hints-docs branch August 19, 2021 01:32
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants