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

[tools] Add a docstring check to the pre-commit #2444

Conversation

gabrieldemarmiesse
Copy link
Contributor

@gabrieldemarmiesse gabrieldemarmiesse commented Apr 29, 2024

Follow up on #2343

Fix #2331

This will run automatically in the CI and for contributors using pre-commit :)

Thanks for your work on it @sarfarazsiddiquii ! The commits of your PR are included here

sarfarazsiddiquii and others added 9 commits April 22, 2024 01:29
Signed-off-by: sarfaraz siddiqui <sarfarazsiddiqui199@gmail.com>
Signed-off-by: sarfaraz siddiqui <sarfarazsiddiqui199@gmail.com>
Signed-off-by: sarfaraz siddiqui <sarfarazsiddiqui199@gmail.com>
Signed-off-by: sarfaraz siddiqui <sarfarazsiddiqui199@gmail.com>
Signed-off-by: sarfaraz siddiqui <sarfarazsiddiqui199@gmail.com>
Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
Copy link
Collaborator

@JoeLoser JoeLoser left a comment

Choose a reason for hiding this comment

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

Generally looks good! Just a few quibbles. Thanks for working on this and continuing on the work from @sarfarazsiddiquii!


Mojo provides a command line utility, `mojo doc`, to validate the API doc strings in your code.
This ensures that your doc strings are correctly formatted and consistent with the Mojo style guidelines.
Not that you should not have any warnings.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Quibble s/Not/Note

stdlib/scripts/check-docstrings.py Show resolved Hide resolved
# ===----------------------------------------------------------------------=== #

import subprocess
from pathlib import Path
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggestion I think this import is unused: remove it.

stdlib/scripts/check-docstrings.py Show resolved Hide resolved
Signed-off-by: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com>
@JoeLoser
Copy link
Collaborator

Do you mind rebasing to fix conflicts, please?

@gabrieldemarmiesse
Copy link
Contributor Author

gabrieldemarmiesse commented Apr 30, 2024

image
Mmmhhh I can update the branch if you want, but maybe you have conflicts with internal commits that are not available externally? Externally it doesn't seems that there are conflicts. I'll update the branch just in case.

@JoeLoser
Copy link
Collaborator

image Mmmhhh I can update the branch if you want, but maybe you have conflicts with internal commits that are not available externally? Externally it doesn't seems that there are conflicts. I'll update the branch just in case.

Screenshot 2024-04-30 at 5 44 29 PM

Weird. I'll take a look at it. I can force import this PR anyways and see if there any conflicts, but even the GH UI is showing conflicts.

@gabrieldemarmiesse
Copy link
Contributor Author

I still have no conflicts on my UI. If you use incognito mode to go on the web page, does it still shows the conflicts?

@JoeLoser
Copy link
Collaborator

JoeLoser commented May 3, 2024

Something seems a bit odd as discussed upthread. There's also an issue with this branch where it doesn't contain any copybara base since it hasn't been rebased with nightly that contains a copybara baseline, so our importing fails. I opened #2483 with it being rebased etc to see if this will make it play nicely. I squashed everything and made sure the commit is attributed to both of you original authors. I'd love to see this get in as I'm seeing several PRs recently fail on doc strings internally when I import them, so this would save me some headaches.

@JoeLoser
Copy link
Collaborator

JoeLoser commented May 3, 2024

Closing in favor of #2483 which is imported internally and set to merge soon.

@JoeLoser JoeLoser closed this May 3, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants