diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 587e1cd8c6c..5b9bf9973f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,9 @@ repos: rev: 0.6.0 hooks: - id: uv-lock + - repo: https://github.com/rstcheck/rstcheck + rev: 77490ffa33bfc0928975ae3cf904219903db755d # frozen: v6.2.5 + hooks: + - id: rstcheck + additional_dependencies: ['rstcheck[sphinx]'] + args: ["--report-level", "warning"] diff --git a/.rstcheck.cfg b/.rstcheck.cfg new file mode 100644 index 00000000000..7b06a656f75 --- /dev/null +++ b/.rstcheck.cfg @@ -0,0 +1,3 @@ +[rstcheck] +ignore_directives = automodule +ignore_roles = scm_web,scm_raw_web diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e174f982e..870884ee2c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Add `rstcheck` to pre-commit to stop introducing invalid RST + ([#4755](https://github.com/open-telemetry/opentelemetry-python/pull/4755)) + ## Version 1.37.0/0.58b0 (2025-09-11) - Add experimental composite samplers diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e325b718e6d..fad76562250 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ You can run `tox` with the following arguments: - `tox -e tracecontext` to run integration tests for tracecontext. - `tox -e precommit` to run all `pre-commit` actions -`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: +`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: ```console pip install pre-commit -c dev-requirements.txt diff --git a/shim/opentelemetry-opentracing-shim/tests/testbed/test_multiple_callbacks/README.rst b/shim/opentelemetry-opentracing-shim/tests/testbed/test_multiple_callbacks/README.rst index 204f282cf23..4d52b7e0fdc 100644 --- a/shim/opentelemetry-opentracing-shim/tests/testbed/test_multiple_callbacks/README.rst +++ b/shim/opentelemetry-opentracing-shim/tests/testbed/test_multiple_callbacks/README.rst @@ -38,7 +38,7 @@ Implementation details: with self.tracer.start_active_span("task"): await asyncio.sleep(interval) - # Invoke and yield over the corotuines. - with self.tracer.start_active_span("parent"): - tasks = self.submit_callbacks() - await asyncio.gather(*tasks) + # Invoke and yield over the coroutines. + with self.tracer.start_active_span("parent"): + tasks = self.submit_callbacks() + await asyncio.gather(*tasks)