docs: fix link to homepage#351
Merged
Merged
Conversation
I think this was a replacement mistake when moving over. This the the homepage for sp-repo-review, so linking to the GitHub page seems to make sense.
|
Hi @henryiii. If there is no linkchecker for this sort of check, maybe a custom script could help? Something like this? Not sure when or where to run this. It could be a pre-commit-hook, but if it talks to the network on every commit, this might be slowing things down. Mabye run this in CI? import logging
import requests
import toml
logger = logging.getLogger(__name__)
with open("pyproject.toml") as f:
data = toml.load(f)
urls = data.get("project", {}).get("urls", {})
with requests.Session() as session:
for label, url in urls.items():
try:
response = session.get(url)
response.raise_for_status()
logger.debug(f"URL for '{label}' is valid: {url}")
except requests.exceptions.HTTPError:
logger.warning(f"URL for '{label}' returned a non-success status code: {url}")
except requests.exceptions.RequestException as e:
logger.error(f"Error checking URL for '{label}': {url}\nError: {e}")Or this is stupid? |
Collaborator
Author
|
I think you could use Linkchecker, though it doesn't have an appropriate plugin AFAIK (https://linkchecker.github.io/linkchecker/man/linkchecker.html#plugins), you can just run it on the URLs, I think. (PS: use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think this was a replacement mistake when moving over. This the the homepage for sp-repo-review, so linking to the GitHub page seems to make sense.
Fix #331.
Not sure what the best way to check for this might be, might be something a link check tool could support?