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

Link checker: Add a method to ignore non-API docs for objects.inv #2337

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

arnaucasau
Copy link
Collaborator

This PR adds a new mechanism to ignore links where we can add a regex expression to ignore all the URLs that match it. It adds regexes for the non-API docs in the addons' and runtime's objects.inv.

Closes #2296

Comment on lines 81 to 86
// Latest version
`\/api\/qiskit-addon-[^\/]+\/${path}(\/.*|#.*|$)`,
// Historical versions
`\/api\/qiskit-addon-[^\/]+\/[0-9]+\.[0-9]\/${path}(\/.*|#.*|$)`,
// Dev version
`\/api\/qiskit-addon-[^\/]+\/dev\/${path}(\/.*|#.*|$)`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These three regexes could be merged into one, but to avoid having a complex regex that could easily match undesirable links, I kept it separate.

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Nice work!

scripts/js/lib/links/ignores.ts Outdated Show resolved Hide resolved
`\/api\/qiskit-ibm-runtime\/0.15\/${path}(\/.*|#.*|$)`,
`\/api\/qiskit-ibm-runtime\/0.14\/${path}(\/.*|#.*|$)`,
])
.flat();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto flatmap

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the flat call in this case given that it's not necessary anymore after combining the three regexes into one

Comment on lines 105 to 107
`\/api\/qiskit-ibm-runtime\/0.16\/${path}(\/.*|#.*|$)`,
`\/api\/qiskit-ibm-runtime\/0.15\/${path}(\/.*|#.*|$)`,
`\/api\/qiskit-ibm-runtime\/0.14\/${path}(\/.*|#.*|$)`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could use {14,15,16} to consolidate these into one rule?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, good idea! I used an or for the three versions 👍

@arnaucasau arnaucasau added this pull request to the merge queue Nov 18, 2024
Merged via the queue into Qiskit:main with commit 79746ea Nov 18, 2024
3 checks passed
@arnaucasau arnaucasau deleted the AC/ignore-non-api-urls branch November 18, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Improve link checker ignores of objects.inv for non-API docs
2 participants