-
Notifications
You must be signed in to change notification settings - Fork 63
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
Multi-line args descriptions are not indented correctly #76
Comments
Edit: 0.4.0dev indents the lines correctly under rst style |
inmzhang
added a commit
to tqec/tqec
that referenced
this issue
Feb 7, 2024
Closes #118 This PR changes the docstring style of all the functions and classes from rest to google style. Initially, I used [pyment](https://github.com/dadadel/pyment) for this, however, it turns out `pyment` cannot handle the multi-line argument descriptions correctly[^1]. Then I turn to a less well-known package [docconvert](https://github.com/cbillingham/docconvert) and it worked out quite well. I have checked the auto-converted files with `diff` preview in my IDE, but slight errors might still exist. The conversion process can be reproduced following the procedure below: 1. Install the `docconvert` python package: ```shell pip install docconvert ``` 2. Create the configuration file `docconvert.json` under the directory of your `tqec` project: ```json { "input_style": "rest", "output_style": "google", "accepted_shebangs": [ "python" ], "output": { "first_line": true, "replace_quotes": "\"\"\"", "standard_indent": " ", "tab_length": 4, "realign": true, "max_line_length": 80, "use_optional": false, "remove_type_back_ticks": "true", "use_types": false, "separate_keywords": false } } ``` 3. Run `docconvert` from the command line: ```shell docconvert --threads 4 --in-place --config docconvert.json src/tqec ``` [^1]: dadadel/pyment#76
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's an example that illustrates the issue.
Formatting under google style results in:
where the second line of the arg description is indented incorrectly.
The text was updated successfully, but these errors were encountered: