Skip to content

Commit cf3553c

Browse files
authored
docs: enable Sphinx linter & fixing (#19515)
* docs: enable Sphinx linter * fixes
1 parent e43820a commit cf3553c

File tree

15 files changed

+55
-50
lines changed

15 files changed

+55
-50
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ repos:
7171
additional_dependencies: [tomli]
7272
args: ["--in-place"]
7373

74+
- repo: https://github.com/sphinx-contrib/sphinx-lint
75+
rev: v0.9.1
76+
hooks:
77+
- id: sphinx-lint
78+
7479
- repo: https://github.com/asottile/yesqa
7580
rev: v1.5.0
7681
hooks:
@@ -86,10 +91,10 @@ repos:
8691
- repo: https://github.com/astral-sh/ruff-pre-commit
8792
rev: "v0.2.0"
8893
hooks:
89-
- id: ruff
90-
args: ["--fix", "--preview"]
9194
- id: ruff-format
9295
args: ["--preview"]
96+
- id: ruff
97+
args: ["--fix", "--preview"]
9398

9499
- repo: https://github.com/executablebooks/mdformat
95100
rev: 0.7.17

docs/source-app/core_api/lightning_app/communication_content.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ And here's the output you get when running the App using the **Lightning CLI**:
8787

8888
.. code-block:: console
8989
90-
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
91-
State: {'works': {'w': {'vars': {'counter': 1}}}}
92-
State: {'works': {'w': {'vars': {'counter': 2}}}}
93-
State: {'works': {'w': {'vars': {'counter': 3}}}}
94-
State: {'works': {'w': {'vars': {'counter': 3}}}}
95-
State: {'works': {'w': {'vars': {'counter': 4}}}}
96-
...
90+
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
91+
State: {'works': {'w': {'vars': {'counter': 1}}}}
92+
State: {'works': {'w': {'vars': {'counter': 2}}}}
93+
State: {'works': {'w': {'vars': {'counter': 3}}}}
94+
State: {'works': {'w': {'vars': {'counter': 3}}}}
95+
State: {'works': {'w': {'vars': {'counter': 4}}}}
96+
...
9797
9898
----
9999

docs/source-app/core_api/lightning_app/dynamic_work_content.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ There are a couple of ways you can add a dynamic Work:
4141
def run(self):
4242
4343
if not hasattr(self, "work"):
44-
# The `Work` component is created and attached here.
44+
# The `Work` component is created and attached here.
4545
setattr(self, "work", Work())
46-
# Run the `Work` component.
46+
# Run the `Work` component.
4747
getattr(self, "work").run()
4848
4949
**OPTION 2:** Use the built-in Lightning classes :class:`~lightning.app.structures.Dict` or :class:`~lightning.app.structures.List`
@@ -60,7 +60,7 @@ There are a couple of ways you can add a dynamic Work:
6060
6161
def run(self):
6262
if "work" not in self.dict:
63-
# The `Work` component is attached here.
63+
# The `Work` component is attached here.
6464
self.dict["work"] = Work()
6565
self.dict["work"].run()
6666

docs/source-app/glossary/environment_variables.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Environment variables are available in all Flows and Works, and can be accessed
2424
print(os.environ["BAZ"]) # FAZ
2525
2626
.. note::
27-
Environment variables are not encrypted. For sensitive values, we recommend using :ref:`Encrypted Secrets <secrets>`.
27+
Environment variables are not encrypted. For sensitive values, we recommend using :ref:`Encrypted Secrets <secrets>`.

docs/source-app/glossary/secrets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Encrypted Secrets allow you to pass private data to your apps, like API keys, ac
88
Secrets provide you with a secure way to store this data in a way that is accessible to Apps so that they can authenticate third-party services/solutions.
99

1010
.. tip::
11-
For non-sensitive configuration values, we recommend using :ref:`plain-text Environment Variables <environment_variables>`.
11+
For non-sensitive configuration values, we recommend using :ref:`plain-text Environment Variables <environment_variables>`.
1212

1313
************
1414
Add a secret

docs/source-app/glossary/sharing_components.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Now, imagine you have implemented a **KerasScriptRunner** component for training
3434

3535
Here are the best practices steps before sharing the component:
3636

37-
* **Testing**: Ensure your component is well tested by following the ref:`../testing` guide.
37+
* **Testing**: Ensure your component is well tested by following the :doc:`../testing` guide.
3838
* **Documented**: Ensure your component has a docstring and comes with some usage explications.
3939

4040
.. Note:: As a Lightning user, it helps to implement your components thinking someone else is going to use them.

docs/source-app/workflows/access_app_state.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ And here's the output you get when running the App using **Lightning CLI**:
5050

5151
.. code-block:: console
5252
53-
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
54-
State: {'works': {'w': {'vars': {'counter': 1}}}}
55-
State: {'works': {'w': {'vars': {'counter': 2}}}}
56-
State: {'works': {'w': {'vars': {'counter': 3}}}}
57-
State: {'works': {'w': {'vars': {'counter': 3}}}}
58-
State: {'works': {'w': {'vars': {'counter': 4}}}}
59-
...
53+
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
54+
State: {'works': {'w': {'vars': {'counter': 1}}}}
55+
State: {'works': {'w': {'vars': {'counter': 2}}}}
56+
State: {'works': {'w': {'vars': {'counter': 3}}}}
57+
State: {'works': {'w': {'vars': {'counter': 3}}}}
58+
State: {'works': {'w': {'vars': {'counter': 4}}}}
59+
...

docs/source-app/workflows/add_web_ui/react/communicate_between_react_and_lightning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Update React <-- Lightning app
4747
******************************
4848
To change the React app from the Lightning app, use the values from the `lightningState`.
4949

50-
In this example, when the `react_ui.counter`` increaes in the Lightning app:
50+
In this example, when the ``react_ui.counter`` increaes in the Lightning app:
5151

5252
.. literalinclude:: ../../../../../src/lightning/app/cli/react-ui-template/example_app.py
5353
:emphasize-lines: 18, 24

docs/source-pytorch/advanced/post_training_quantization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Usage
5555

5656
Minor code changes are required for the user to get started with Intel® Neural Compressor quantization API. To construct the quantization process, users can specify the below settings via the Python code:
5757

58-
1. Calibration Dataloader (Needed for post-training static quantization)
59-
2. Evaluation Dataloader and Metric
58+
1. Calibration Dataloader (Needed for post-training static quantization)
59+
2. Evaluation Dataloader and Metric
6060

6161
The code changes that are required for Intel® Neural Compressor are highlighted with comments in the line above.
6262

docs/source-pytorch/data/alternatives.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ As datasets grow in size and the number of nodes scales, loading training data c
3232
The `StreamingDataset <https://github.com/mosaicml/streaming>`__ can make training on large datasets from cloud storage
3333
as fast, cheap, and scalable as possible.
3434

35-
This library uses a custom built class:`~torch.utils.data.IterableDataset`. The library recommends iterating through it
36-
via a regular class:`~torch.utils.data.DataLoader`. This means that support in the ``Trainer`` is seamless:
35+
This library uses a custom built :class:`~torch.utils.data.IterableDataset`. The library recommends iterating through it
36+
via a regular :class:`~torch.utils.data.DataLoader`. This means that support in the ``Trainer`` is seamless:
3737

3838
.. code-block:: python
3939

0 commit comments

Comments
 (0)