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

FIX: Add pre-commit Blacken-docs hooks #54137

Conversation

Revathyvenugopal162
Copy link

@Revathyvenugopal162 Revathyvenugopal162 commented Jul 15, 2023

This PR adds the configuration for the blacken-docs hook to the project's .pre-commit-config.yaml file. The blacken-docs hook applies the Black code formatter to reStructuredText (reST) files.

To accommodate potential parsing errors encountered with certain code blocks, the --skip-errors argument is included in the hook configuration. This argument instructs blacken-docs to skip errors and continue processing other files and blocks.

By including the blacken-docs hook with error skipping, we can ensure consistent formatting of reST files while allowing exceptions for code blocks that may contain unsupported syntax.

Please review this PR and provide any feedback or suggestions for improvement.

@noatamir @phofl SciPy Sprint 2023

@Revathyvenugopal162 Revathyvenugopal162 marked this pull request as ready for review July 15, 2023 16:41
@Revathyvenugopal162 Revathyvenugopal162 marked this pull request as draft July 15, 2023 16:47
@noatamir noatamir added the Sprints Sprint Pull Requests label Jul 15, 2023
@rhshadrach
Copy link
Member

Thanks for the PR! By putting partially closes #... in the OP, I believe merging this will automatically close the corresponding issue. This is because GitHub does not pickup on the "partially". Instead, I recommend "Part of #..."

def f(x):
return len(str(x))


Copy link
Member

@rhshadrach rhshadrach Jul 16, 2023

Choose a reason for hiding this comment

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

I believe this is what's causing the CI to fail. With nbsphinx, multiple blank lines will generate a warning causing our docs build to fail (docs are still built successfully though). Not sure if there is a good way to handle this.

https://github.com/pandas-dev/pandas/actions/runs/5563179982/jobs/10161969704?pr=54137#step:6:44

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Aug 16, 2023
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sprints Sprint Pull Requests Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants