-
Notifications
You must be signed in to change notification settings - Fork 87
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
Conversation
scripts/js/lib/links/ignores.ts
Outdated
// Latest version | ||
`\/api\/qiskit-addon-[^\/]+\/${path}(\/.*|#.*|$)`, | ||
// Historical versions | ||
`\/api\/qiskit-addon-[^\/]+\/[0-9]+\.[0-9]\/${path}(\/.*|#.*|$)`, | ||
// Dev version | ||
`\/api\/qiskit-addon-[^\/]+\/dev\/${path}(\/.*|#.*|$)`, |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
`\/api\/qiskit-ibm-runtime\/0.15\/${path}(\/.*|#.*|$)`, | ||
`\/api\/qiskit-ibm-runtime\/0.14\/${path}(\/.*|#.*|$)`, | ||
]) | ||
.flat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto flatmap
There was a problem hiding this comment.
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
scripts/js/lib/links/ignores.ts
Outdated
`\/api\/qiskit-ibm-runtime\/0.16\/${path}(\/.*|#.*|$)`, | ||
`\/api\/qiskit-ibm-runtime\/0.15\/${path}(\/.*|#.*|$)`, | ||
`\/api\/qiskit-ibm-runtime\/0.14\/${path}(\/.*|#.*|$)`, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 👍
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