Skip to content

Fix some markup (including 2 false-positives). #957

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

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

ezio-melotti
Copy link
Member

This PR fixes markup errors exposed by sphinx-lint 0.6.3, even though two of them are actually false positives:

# Ignore the tools and venv dirs and check that the default role is not used.
./venv/bin/sphinx-lint -i tools -i ./venv --enable default-role
testing/coverage.rst:262: default role used (hint: for inline literals, use double backticks) (default-role)
documentation/style-guide.rst:154: default role used (hint: for inline literals, use double backticks) (default-role)
internals/parser.rst:836: default role used (hint: for inline literals, use double backticks) (default-role)
internals/parser.rst:837: default role used (hint: for inline literals, use double backticks) (default-role)
internals/parser.rst:838: default role used (hint: for inline literals, use double backticks) (default-role)

See also:

(cc @JulienPalard, @hugovk, @CAM-Gerlach)

Comment on lines +154 to +155
similar to :samp:`"Please refer to the :ref:\`{security-considerations}\`
section for important information on how to avoid common mistakes."`.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a workaround for one of the two false positives. It's semantically (and syntactically) valid, and solves the error reported by sphinx-lint.

It is rendered as
image
with the variable part in italic.

* `Lib/test/test_exceptions.py`.
* ``Lib/test/test_grammar.py``.
* ``Lib/test/test_syntax.py``.
* ``Lib/test/test_exceptions.py``.
Copy link
Member Author

Choose a reason for hiding this comment

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

These were actual errors.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe just link the actual files (on GitHub instead)?

Copy link
Member

Choose a reason for hiding this comment

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

That would be a good improvement for another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

`issue tracker`_ and submit a :ref:`pull request <pullrequest>`.
Once you have increased coverage,
you need to create an issue on the `issue tracker`_ and
submit a :ref:`pull request <pullrequest>`.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is another workaround: by reflowing the paragraph I avoid having the link and the ref on the same line.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Maybe combine this with #956?

@ezio-melotti
Copy link
Member Author

I'm planning to merge #956 just after this, but I wanted to make sure that these changes didn't trigger any errors with 0.6.1.

@JelleZijlstra JelleZijlstra merged commit 2b8d823 into python:main Oct 6, 2022
@ezio-melotti ezio-melotti deleted the fix-markup branch October 6, 2022 20:42
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

One minor optional comment, otherwise LGTM

* `Lib/test/test_exceptions.py`.
* ``Lib/test/test_grammar.py``.
* ``Lib/test/test_syntax.py``.
* ``Lib/test/test_exceptions.py``.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just link the actual files (on GitHub instead)?

@CAM-Gerlach
Copy link
Member

(Oops, wasn't showing as merged first)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants