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

docs: use stricter validation options #6096

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

mkniewallner
Copy link
Contributor

@mkniewallner mkniewallner commented Aug 14, 2024

Summary

mkdocs supports validation rules for links, which can be tightened to report more issues than the default configuration. I used the recommended "maximal strictness" configuration from the documentation.

Adding the anchors rule helped spot 4 errors:

WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#python-distributions', but the doc 'concepts/python-versions.md' does not contain an anchor '#python-distributions'.
WARNING -  Doc file 'guides/install-python.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.
WARNING -  Doc file 'guides/projects.md' contains a link '../concepts/projects.md#lock-file', but the doc 'concepts/projects.md' does not contain an anchor '#lock-file'.
WARNING -  Doc file 'pip/environments.md' contains a link '../concepts/python-versions.md#discovery-order', but the doc 'concepts/python-versions.md' does not contain an anchor '#discovery-order'.

Test Plan

Local run of the documentation + mkdocs build --strict.

@mkniewallner mkniewallner force-pushed the docs/stricter-validation-options branch from 50feedb to 8d61a6b Compare August 14, 2024 23:50
@mkniewallner mkniewallner marked this pull request as ready for review August 14, 2024 23:51
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you!

@zanieb zanieb added documentation Improvements or additions to documentation internal A refactor or improvement that is not user-facing labels Aug 15, 2024
@zanieb zanieb merged commit 85be33d into astral-sh:main Aug 15, 2024
46 checks passed
@mkniewallner mkniewallner deleted the docs/stricter-validation-options branch August 15, 2024 00:28
@mkniewallner
Copy link
Contributor Author

https:/astral-sh/uv/actions/runs/10396684003/job/28791143067 whoops, this broke the main build. That's because anchors is mkdocs 1.6+, and apparently insiders dependencies are installing 1.5.0.

@zanieb
Copy link
Member

zanieb commented Aug 15, 2024

Ah just noticed this broke on my branch. Thanks for noting it too :D

We'll need to upgrade insiders, but I recall there were some regressions we were blocked by...

@mkniewallner
Copy link
Contributor Author

Ah just noticed this broke on my branch. Thanks for noting it too :D

We'll need to upgrade insiders, but I recall there were some regressions we were blocked by...

Ah, too bad! We can remove anchors for now if that's problematic, it's the only option that is 1.6+ only.

zanieb pushed a commit to astral-sh/ruff that referenced this pull request Aug 19, 2024
## Summary

Applying the same change as done in
astral-sh/uv#6096. Note that in `uv` repository,
this [broke the docs
build](astral-sh/uv#6096 (comment))
because `anchors` is `mdkocs` 1.6+ only, and insiders used 1.5.0 while
public dependencies used 1.6.0, but in this repository, both use 1.6.0
([public](https:/astral-sh/ruff/blob/049cda2ff37bcae59f7dae9af6a453075c76e635/docs/requirements.txt#L3),
[insiders](https:/astral-sh/ruff/blob/049cda2ff37bcae59f7dae9af6a453075c76e635/docs/requirements-insiders.txt#L3)),
so this should not be an issue to have in the template.

Contrarily to `uv` repository, no violations were reported here, but
this could prevent adding some in the future.

## Test Plan

Local run of the documentation + `mkdocs build --strict`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants