-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dist/tools: check for for broken links in documentation files #13532
base: master
Are you sure you want to change the base?
Conversation
55ebe6c
to
388d4cd
Compare
@gschorcht Could you run your |
I think it would also be good to add a check in there if wget is available on the system. |
I will do. Thanks for the hint. |
One problem I have already noticed is that the shell script requires that a URL is always defined in one line. To be able to handle line breaks in URLs, we would need a more sophisticated Python script. On the other hand, also Doxygen is not always able to deal with line breaks in URLs. For example, see section Further reading in here. Therefore we should always define URLs without line breaks, even if they exceed the maximum line length. |
fbb3bc5
to
d501424
Compare
I'm running the tool locally without any option. There are still broken links but that can be fixed in follow-up PRs. I find the tool a little bit too verbose. Is it possible to only print lines with broken links and not all checked files ? Maybe the verbose mode could be enabled via an env variable ? |
cd "$RIOTBASE" | ||
|
||
: "${RIOTTOOLS:=${RIOTBASE}/dist/tools}" | ||
. "${RIOTTOOLS}"/ci/changed_files.sh |
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.
Since the tool is not integrated in the static-test
target this line is equivalent as testing all files, except the one that are in the EXCLUDE variable. Is it intentional ?
exit | ||
fi | ||
|
||
URL_REGEX='(?=https://|http://)[^ )\]>\"]+' |
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.
Can we add a way to provide excluded patterns ? There's one broken link reported which is on purpose, since it's an example url in sys/include/net/sock/util.h
: https://host.name:1234/url/path
@aabadie maybe you could PR your suggestions to @gschorcht branch? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Still useful if @aabadie @gschorcht can take another look |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This PR provides a small shell script that uses the
wget
command to check for broken links in given files.The documentation in
boards
,cpu
,drivers
, ... contains dozens of broken links. It should be checked for such broken links from time to time. This PR provides a very small tool that can detect such broken links in files specified as parameters or in files returned as changed files fromdist/tools/ci/changed_files.sh
.As the check in some cases takes a considerable amount of time, it does not seem appropriate to integrate it into the static tests.
Broken links in documentation found:
Testing procedure
Check an board documentation, for example:
Issues/PRs references