Title: Revise docstrings, comments, and a few messages by EliahKagan · Pull Request #1850 · gitpython-developers/GitPython · GitHub
Open Graph Title: Revise docstrings, comments, and a few messages by EliahKagan · Pull Request #1850 · gitpython-developers/GitPython
X Title: Revise docstrings, comments, and a few messages by EliahKagan · Pull Request #1850 · gitpython-developers/GitPython
Description: Fixes #1845
Fixes #1847
Fixes #1849
This pull request is a sequel to #1725. Most changes are to docstrings. Notable changes:
Applies revisions to recently discussed docstrings, including improving on the wording I added in #1839 and #1844, and making the changes discussed in #1845, #1847, and #1849.
Revises docstrings throughout the git package along the lines of #1725, covering areas I outright missed, or where a further improvement or kind of improvement became apparent since then (either over time or due to recent rereading), or arose since then, or where I am better able to check the effect on rendered documentation, or where I am more comfortable making the change due to an improved understanding of the code being documented (or commented).
Goes beyond that in making some new kinds of formatting changes to improve consistency that I had not included there, some that I had intentionally omitted at that time due to less experience with the project, and others that I only realized the benefit of more recently. See 1cd73ba for a list of many of these (that commit only covers a handful of files, but other commits made those kinds of changes to more files).
Makes bigger formatting changes for readability, when reading the docstrings in the code, than in #1725. These also improve consistency, but their value is even more for readability:
Putting blank lines between all sections of all docstrings (in the git package).
Giving role-labeled sections a newline after the leading :role:/:role args...:.
Wrapping nearly all docstrings and most comments to 88 columns.
Formatting all occurrences of a class name that is intended to refer to that class with :class:, except in rare cases where there are disadvantages of doing so (e.g., the first line of a class docstring must not link to the class itself, or some readers may infer that it is a reference to another same-named class).
The addition of blank lines and line breaks in docstrings is unneeded in some projects and often not done, but seems very useful to me in GitPython, where many docstrings have long sections (rather than, for example, sections like :param foo: the predecessor of *bar* that fit on a single line).
The advantages of linking class names almost everywhere are that it:
makes clear that the class is what is being referred to (this is not always obvious, especially in GitPython due to subtleties of Git itself and, to a lesser extent, of GitPython's design), and
makes it easy to use the reference to get to information on something one is reading about.
Codes all Sphinx references to classes, methods/functions, and attributes as either:
Relative to the current module, top-level function, class, or method.
Absolute.
One effect is that there are far more absolute Sphinx references than before. This does not cause rendered Sphinx documentation to become more longwinded, because the references are written in such a way that the rendered text still omits the qualifiers (except on hover). This is mostly achieved by writing things like :class:`~a.b.c.D`, which is short for :class:`D
Open Graph Description: Fixes #1845 Fixes #1847 Fixes #1849 This pull request is a sequel to #1725. Most changes are to docstrings. Notable changes: Applies revisions to recently discussed docstrings, including improvin...
X Description: Fixes #1845 Fixes #1847 Fixes #1849 This pull request is a sequel to #1725. Most changes are to docstrings. Notable changes: Applies revisions to recently discussed docstrings, including improvin...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1850
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:a305179a-e7af-3aa2-596b-e682e99db2c1 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 9A92:2011A1:10C1C92:1745A5F:6968A925 |
| html-safe-nonce | a58ee4675a379125ac602dd6a7ade813204083b4635d3416be489191b1a16056 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTkyOjIwMTFBMToxMEMxQzkyOjE3NDVBNUY6Njk2OEE5MjUiLCJ2aXNpdG9yX2lkIjoiNDI2MzMxNjQzODIyMzcyNjg4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fa740a05792abf9c2720c16da471883f5c694823e4e026cbcb1b9052c1967e24 |
| hovercard-subject-tag | pull_request:1749287603 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1850/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1845 Fixes #1847 Fixes #1849 This pull request is a sequel to #1725. Most changes are to docstrings. Notable changes: Applies revisions to recently discussed docstrings, including improvin... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3223a6503d318917691422cdadfbe16cd8fb21e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width