Skip to content

Check for backtick-quoted shortcut links in CI#16114

Merged
MichaReiser merged 2 commits intoastral-sh:mainfrom
InSyncWithFoo:docs-backticked-shortcut-links
Feb 14, 2025
Merged

Check for backtick-quoted shortcut links in CI#16114
MichaReiser merged 2 commits intoastral-sh:mainfrom
InSyncWithFoo:docs-backticked-shortcut-links

Conversation

@InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Feb 12, 2025

Summary

Follow-up to #16035.

check_docs_formatted.py will now report backtick-quoted shortcut links in rule documentation. It uses a regular expression to find them. Such a link:

  • Starts with [, followed by `, then a "name" sequence of at least one non-backtick non-newline character, followed by another `, then ends with ].
  • Is not followed by either a [ or a (.
  • Is not placed within a code block.

If the name is a known Ruff option name, that link is not considered a violation.

Test Plan

Manual.

@InSyncWithFoo InSyncWithFoo force-pushed the docs-backticked-shortcut-links branch from 836774a to 1553f39 Compare February 12, 2025 11:08
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@AlexWaygood AlexWaygood added the ci Related to internal CI tooling label Feb 12, 2025
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks, this is great. I only have a few suggestions around commenting the code.

@InSyncWithFoo
Copy link
Contributor Author

With this merged, I will be able to rest easy and monkeypatch the rest of the broken links client-side (not that I think I should, though) as they will be guaranteed to be option links.

@MichaReiser MichaReiser merged commit 1db8392 into astral-sh:main Feb 14, 2025
21 checks passed
@InSyncWithFoo InSyncWithFoo deleted the docs-backticked-shortcut-links branch February 14, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants