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

[Pylint] dedent should never have a number #38207

Closed
lmazuel opened this issue Oct 30, 2024 · 1 comment · Fixed by Azure/azure-sdk-tools#9669
Closed

[Pylint] dedent should never have a number #38207

lmazuel opened this issue Oct 30, 2024 · 1 comment · Fixed by Azure/azure-sdk-tools#9669
Assignees
Labels

Comments

@lmazuel
Copy link
Member

lmazuel commented Oct 30, 2024

See for instance this:

.. literalinclude:: ../samples/sample_authentication.py
:start-after: [START auth_from_connection_string]
:end-before: [END auth_from_connection_string]
:language: python
:dedent: 8
:caption: Authenticating a TableServiceClient from a connection_string

If dedent has a number, this forces a specific number of dedent, which creates possibly invalid doc:
Image

But a number is actually optional, and if we don't put it, Sphinx dedent automatically correctly (I tested that myself with tox and sphinx).

Linter rule is to forbid people from putting a number after dedent, so sphinx can handle this by itself.

Ref: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-option-literalinclude-dedent

@l0lawrence
Copy link
Member

Image

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 a pull request may close this issue.

2 participants