git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 04/20] git-p4: improve consistency of docstring formatting

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 12, 2022, 19:20 UTC
Message-ID
<CAPig+cQodfguFukatAN73Z1VvgCQqyFpUOkExvprmwhL55Zt1g@mail.gmail.com>
In-Reply-To
<20220112134635.177877-5-jholdsworth@nvidia.com>
On Wed, Jan 12, 2022 at 8:47 AM Joel Holdsworth <jholdsworth@nvidia.com> wrote:
Show 10 quoted lines
> This patch attempts to improve the consistency of the docstrings by
> making the following changes:
>
>   - Rewraps all docstrings to a 79-character column limit.
>   - Adds a full stop at the end of every docstring.
>   - Removes any spaces after the opening triple-quotes of all
>     docstrings.
>   - Sets the hanging indent of multi-line docstrings to 3-spaces.
>   - Ensures that the closing triple-quotes of multi-line docstrings are
>     always on a new line indented by a 3-space indent.
A couple very minor comments below... probably not worth a re-roll.
Show 6 quoted lines
> Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
> ---
> diff --git a/git-p4.py b/git-p4.py
> @@ -271,20 +271,20 @@ def run_git_hook(cmd, param=[]):
>  def run_hook_command(cmd, param):
>      """Executes a git hook command
Missing full-stop (as described by the commit message)?
Show 8 quoted lines
> -       cmd = the command line file to be executed. This can be
> -       a file that is run by OS association.
>
> -       param = a list of parameters to pass to the cmd command
> +       cmd -- the command line file to be executed.  This can be a file that
> +           is run by OS association.
> +
> +       param -- a list of parameters to pass to the cmd command
These were changed from `=` to `--` (double hyphen), which is fine, but...
Show 17 quoted lines
> @@ -715,21 +718,22 @@ def getGitTags():
>  def parseDiffTreeEntry(entry):
>      """Parses a single diff tree entry into its component elements.
>
> +       See git-diff-tree(1) manpage for details about the format of the diff
> +       output. This method returns a dictionary with the following elements:
> +
> +       src_mode - The mode of the source file
> +       dst_mode - The mode of the destination file
> +       src_sha1 - The sha1 for the source file
> +       dst_sha1 - The sha1 fr the destination file
> +       status - The one letter status of the diff (i.e. 'A', 'M', 'D', etc)
> +       status_score - The score for the status (applicable for 'C' and 'R'
> +                      statuses). This is None if there is no score.
> +       src - The path for the source file.
> +       dst - The path for the destination file. This is only present for
> +             copy or renames. If it is not present, this is None.
... these just use `-` (single hyphen).
> +       If the pattern is not matched, None is returned.
> +       """
Previous: Joel HoldsworthNext: Joel Holdsworth
Message 6 of 27 in “git-p4: Various code tidy-ups”
  1. 00/20 git-p4: Various code tidy-upsJoel Holdsworth, Jan 12, 2022
  2. 01/20 git-p4: add blank lines between functions and class definitionsJoel Holdsworth, Jan 12, 2022
  3. 02/20 git-p4: remove unneeded semicolons from statementsJoel Holdsworth, Jan 12, 2022
  4. 03/20 git-p4: indent with 4-spacesJoel Holdsworth, Jan 12, 2022
  5. 04/20 git-p4: improve consistency of docstring formattingJoel Holdsworth, Jan 12, 2022
  6. Eric SunshineJan 12, 2022
  7. 05/20 git-p4: convert descriptive class and function comments into docstringsJoel Holdsworth, Jan 12, 2022
  8. Eric SunshineJan 12, 2022
  9. 06/20 git-p4: remove commented codeJoel Holdsworth, Jan 12, 2022
  10. Eric SunshineJan 12, 2022
  11. 09/20 git-p4: remove spaces around default argumentsJoel Holdsworth, Jan 12, 2022
  12. 07/20 git-p4: sort and de-duplcate pylint disable listJoel Holdsworth, Jan 12, 2022
  13. 08/20 git-p4: remove padding from lists, tuples and function argumentsJoel Holdsworth, Jan 12, 2022
  14. 10/20 git-p4: place a single space after every commaJoel Holdsworth, Jan 12, 2022
  15. Eric SunshineJan 12, 2022
  16. 16/20 git-p4: tidied visual indented lines of conditionalsJoel Holdsworth, Jan 12, 2022
  17. Eric SunshineJan 12, 2022
  18. 11/20 git-p4: remove extraneous spaces before function argumentsJoel Holdsworth, Jan 12, 2022
  19. 12/20 git-p4: remove redundant backslash-continuations inside bracketsJoel Holdsworth, Jan 12, 2022
  20. 13/20 git-p4: remove spaces between dictionary keys and colonsJoel Holdsworth, Jan 12, 2022
  21. 14/20 git-p4: ensure every comment has a single #Joel Holdsworth, Jan 12, 2022
  22. 17/20 git-p4: compare to singletons with "is" and "is not"Joel Holdsworth, Jan 12, 2022
  23. Eric SunshineJan 12, 2022
  24. 15/20 git-p4: ensure there is a single space around all operatorsJoel Holdsworth, Jan 12, 2022
  25. 18/20 git-p4: only seperate code blocks by a single empty lineJoel Holdsworth, Jan 12, 2022
  26. 19/20 git-p4: move inline comments to line aboveJoel Holdsworth, Jan 12, 2022
  27. 20/20 git-p4: seperate multiple statements onto seperate linesJoel Holdsworth, Jan 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.