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

Check for backtick-quoted shortcut links in CI #16114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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 pieces of text that:

  • 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
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.

scripts/check_docs_formatted.py Show resolved Hide resolved
scripts/check_docs_formatted.py Outdated Show resolved Hide resolved
scripts/check_docs_formatted.py Outdated Show resolved Hide resolved
scripts/check_docs_formatted.py Outdated Show resolved Hide resolved
scripts/check_docs_formatted.py Show resolved Hide resolved
@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.

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