Skip to content

Commit 27756c9

Browse files
authored
Use rstcheck to "lint" the README (#17367)
Follow up to #17363, so we can detect issues with the RST file early on. ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
1 parent cc5e589 commit 27756c9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
trial: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.trial }}
2222
integration: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.integration }}
2323
linting: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.linting }}
24+
linting_readme: ${{ !startsWith(github.ref, 'refs/pull/') || steps.filter.outputs.linting_readme }}
2425
steps:
2526
- uses: dorny/paths-filter@v3
2627
id: filter
@@ -72,6 +73,9 @@ jobs:
7273
- 'pyproject.toml'
7374
- 'poetry.lock'
7475
- '.github/workflows/tests.yml'
76+
77+
linting_readme:
78+
- 'README.rst'
7579
7680
check-sampleconfig:
7781
runs-on: ubuntu-latest
@@ -269,6 +273,20 @@ jobs:
269273

270274
- run: cargo fmt --check
271275

276+
# This is to detect issues with the rst file, which can otherwise cause issues
277+
# when uploading packages to PyPi.
278+
lint-readme:
279+
runs-on: ubuntu-latest
280+
needs: changes
281+
if: ${{ needs.changes.outputs.linting_readme == 'true' }}
282+
steps:
283+
- uses: actions/checkout@v4
284+
- uses: actions/setup-python@v5
285+
with:
286+
python-version: "3.x"
287+
- run: "pip install rstcheck"
288+
- run: "rstcheck --report-level=WARNING README.rst"
289+
272290
# Dummy step to gate other tests on without repeating the whole list
273291
linting-done:
274292
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
@@ -284,6 +302,7 @@ jobs:
284302
- lint-clippy
285303
- lint-clippy-nightly
286304
- lint-rustfmt
305+
- lint-readme
287306
runs-on: ubuntu-latest
288307
steps:
289308
- uses: matrix-org/done-action@v2
@@ -301,6 +320,7 @@ jobs:
301320
lint-clippy
302321
lint-clippy-nightly
303322
lint-rustfmt
323+
lint-readme
304324
305325
306326
calculate-test-jobs:

changelog.d/17367.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add CI check for the README.

0 commit comments

Comments
 (0)