Merged
Conversation
b608f6c to
7d02939
Compare
This reverts commit 7d02939.
Collaborator
Author
|
A few loose-ends to tie, but that will be for tomorrow! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR introduces a doc styling script and applies it to the repo. The styling script runs similarly to black, with a an option that fixes and overwrites the files (put inside
make style) and an option that only checks if there should be a restyle, failing with an error if that's the case (put insidemake quality).The script is applied to all rst files inside
docs/sourceand all py files insidesrc/transformers. It will look for paragraphs and always reorganize them to use the most of themax_lenpassed (set at 119 for the repo, like for the code). It will remove all duplicate or trailing whitespace, make all blank lines empty, ignore blocks of code/math and properly take care of the indentation.A few extra things are performed:
max_lenand always adding a blank line after those titles.To make the script ignore a string inside triple quotes (like warnings or long regex expressions), put a
# docstyle-ignoresomewhere before (it has to be between the previous triple quotes and the ones of the string you want to ignore).In general, if the script reformats atrociously a docstring, it was because it was badly formatted. Adding a blank line to clearly mark paragraphs can make the script happier. Properly indenting list of arguments (see examples on any of the files of the lib) is also important to get good outputs.