Skip to content

Commit 6f97ed8

Browse files
authored
Add rstcheck to pre-commit (#4755)
* Introduce rstcheck * Fix rstcheck errors * Add changelog * Fix link to PR
1 parent 5c8269c commit 6f97ed8

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ repos:
1313
rev: 0.6.0
1414
hooks:
1515
- id: uv-lock
16+
- repo: https://github.com/rstcheck/rstcheck
17+
rev: 77490ffa33bfc0928975ae3cf904219903db755d # frozen: v6.2.5
18+
hooks:
19+
- id: rstcheck
20+
additional_dependencies: ['rstcheck[sphinx]']
21+
args: ["--report-level", "warning"]

.rstcheck.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[rstcheck]
2+
ignore_directives = automodule
3+
ignore_roles = scm_web,scm_raw_web

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
1313
## Unreleased
1414

15+
- Add `rstcheck` to pre-commit to stop introducing invalid RST
16+
([#4755](https://github.com/open-telemetry/opentelemetry-python/pull/4755))
17+
1518
## Version 1.37.0/0.58b0 (2025-09-11)
1619

1720
- Add experimental composite samplers

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ You can run `tox` with the following arguments:
7272
- `tox -e tracecontext` to run integration tests for tracecontext.
7373
- `tox -e precommit` to run all `pre-commit` actions
7474

75-
`ruff check` and `ruff format` are executed when `tox -e ruff` is run. We strongly recommend you to configure [pre-commit](https://pre-commit.com/) locally to run `ruff` automatically before each commit by installing it as git hooks. You just need to [install pre-commit](https://pre-commit.com/#install) in your environment:
75+
`ruff check` and `ruff format` are executed when `tox -e ruff` is run. We strongly recommend you to configure [pre-commit](https://pre-commit.com/) locally to run `ruff` and `rstcheck` automatically before each commit by installing it as git hooks. You just need to [install pre-commit](https://pre-commit.com/#install) in your environment:
7676

7777
```console
7878
pip install pre-commit -c dev-requirements.txt

shim/opentelemetry-opentracing-shim/tests/testbed/test_multiple_callbacks/README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Implementation details:
3838
with self.tracer.start_active_span("task"):
3939
await asyncio.sleep(interval)
4040
41-
# Invoke and yield over the corotuines.
42-
with self.tracer.start_active_span("parent"):
43-
tasks = self.submit_callbacks()
44-
await asyncio.gather(*tasks)
41+
# Invoke and yield over the coroutines.
42+
with self.tracer.start_active_span("parent"):
43+
tasks = self.submit_callbacks()
44+
await asyncio.gather(*tasks)

0 commit comments

Comments
 (0)