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

gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables #118068

Merged
merged 17 commits into from
Apr 24, 2024

Conversation

uatach
Copy link
Contributor

@uatach uatach commented Apr 18, 2024

Pull request based on PR #21447 that was closed due to being too big, I've added only the changes related to backquotes in this PR.


📚 Documentation preview 📚: https://cpython-previews--118068.org.readthedocs.build/

@uatach uatach requested review from pganssle and abalkin as code owners April 18, 2024 22:42
Copy link

cpython-cla-bot bot commented Apr 18, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Most of those changes seem unnecessary. In particular, simple integers don't need code formatting.

Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

IMO, this PR falls into the same trap as #21447 did. I suggest to follow my advice when I closed that PR: implement the improvements as a series of small changes, one kind of change per PR. Resist the temptation to add any unrelated change. See also Diátaxis, our documentation north star, for more information/inspiration.

IMO, this PR should perform one kind of change only:

Mark up code samples, variables and literals with double backquotes.

This implies: do not add other types of markup such as pairs of * or rephrasings.

Follow up with a PR that adds missing :attr: and :class: markups. If needed, follow up with a PR that consistently marks up parameter names using pairs of *.

Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
@uatach uatach changed the title gh-85453: Improve backquotes, italics and timedelta read-only instance attributes gh-85453: Improve backquotes to follow devguide Apr 22, 2024
@erlend-aasland
Copy link
Contributor

For future reference, @uatach: we try to avoid force-pushes on pull requests. In order to sync with main, instead do:

$ git switch main
$ git pull
$ git switch wip
$ git merge --no-ff main -m "Pull in main"

See also the devguide :)

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Some comments:

Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
@erlend-aasland erlend-aasland changed the title gh-85453: Improve backquotes to follow devguide gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and literals Apr 23, 2024
@uatach
Copy link
Contributor Author

uatach commented Apr 23, 2024

@erlend-aasland as I address the comments, should I also resolve the conversations?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

I am not sure that the code formatting should be used for all numbers. Perhaps a variant without this could be simpler to review.

I am not sure that the code formatting instead of italic should be used for references to variables.

Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
@erlend-aasland
Copy link
Contributor

@serhiy-storchaka:

I am not sure that the code formatting instead of italic should be used for references to variables.

This is our recommended style as per the devguide.

@uatach
Copy link
Contributor Author

uatach commented Apr 24, 2024

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented Apr 24, 2024

Thanks for making the requested changes!

@erlend-aasland, @JelleZijlstra: please review the changes made to this pull request.

Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
Doc/library/datetime.rst Show resolved Hide resolved
Doc/library/datetime.rst Outdated Show resolved Hide resolved
@erlend-aasland
Copy link
Contributor

Thank you so much for picking this up, @uatach! Sorry if this turned out an unpleasant review experience for you; thank you for enduring all the nitpicking!

Feel free to create a PR for any of the remaining items; they should be easier to review, and hopefully you'll get a better contribution experience :)

@erlend-aasland erlend-aasland changed the title gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and literals gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables Apr 24, 2024
Doc/library/datetime.rst Outdated Show resolved Hide resolved
@erlend-aasland erlend-aasland enabled auto-merge (squash) April 24, 2024 19:39
@erlend-aasland erlend-aasland merged commit 809aa9a into python:main Apr 24, 2024
24 of 25 checks passed
@erlend-aasland erlend-aasland added the needs backport to 3.12 bug and security fixes label Apr 24, 2024
@miss-islington-app
Copy link

Thanks @uatach for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 24, 2024
…de snippets and variables (pythonGH-118068)

Also remove formatting from numeric literals.

(cherry picked from commit 809aa9a)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
@bedevere-app
Copy link

bedevere-app bot commented Apr 24, 2024

GH-118244 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Apr 24, 2024
erlend-aasland added a commit that referenced this pull request Apr 24, 2024
…ode snippets and variables (GH-118068) (#118244)

Also remove formatting from numeric literals.

(cherry picked from commit 809aa9a)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
@uatach uatach deleted the wip branch May 28, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants