TheAlgorithms / Algorithms-Explanation

Popular algorithms explained in simple language with examples and links to their implementation in various programming languages and other required resources.
MIT License
2.97k stars 738 forks source link

chore: add `url_check.yml` #231

Closed vil02 closed 5 months ago

vil02 commented 5 months ago

Description

Related to #154. This PR adds a workflow checking all links in the markdown files.

There are too many broken links to fix them at once. I decided to change the workflow in such a way, that (temporary) it will not fail when broken links are found.

Checklist

Screenshots (if any)

Note to reviewers

Adds a workflow checking links.

vil02 commented 5 months ago

Is there an (easy) option to make it fail if there are more broken links than there were before, though?

I am not aware of an easy way. But I also think this is not the right way to go. One can split these broken links into three groups:

  1. the ones in the implementations-section: you suggested to remove these sections,
  2. links to images showing nicely the complexity, like O(n),
  3. all the others.

Two first groups are quite easy to fix (the second one just needs a guideline, so all of the formulas will be written in an uniform way). And I think there are not that many in the 3rd. I would suggest no broken links policy.

appgurueu commented 5 months ago

I am not aware of an easy way. But I also think this is not the right way to go.

Well, the idea was that if someone opens a PR, we would like for CI to check whether they are introducing any new broken links.

Two first groups are quite easy to fix (the second one just needs a guideline, so all of the formulas will be written in an uniform way). And I think there are not that many in the 3rd. I would suggest no broken links policy.

Yes, I agree. Though the policy should probably be "no broken links, and try to use permanent links (such as archive.org) that are unlikely to break". Most links were probably not broken when they were added, but broke later on.

I've opened a PR to update our policy.

vil02 commented 5 months ago

I would merge this as it is, remove all of the broken links (as mentioned above: some of them should be easy) and then make this workflow fail if any broken link is found. In the meantime one needs to manually inspect the log of this workflow.