magika icon indicating copy to clipboard operation
magika copied to clipboard

Add function to check python readme links are valid and absolute

Open bregwin opened this issue 1 year ago • 2 comments

I added a check for the python README file to check if all the links are valid and not relative.

If the links are not valid, it will print out the invalid links for review and stops the script (stopping the package build in the process).

Currently, this is assuming that all the links in the README file will be pointing to GitHub, if that is not the case, I can modify it to check if it is an HTTPS link.

Closes #730.

bregwin avatar Oct 02 '24 19:10 bregwin

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Oct 02 '24 19:10 google-cla[bot]

Thanks for the PR! Did a first review. Let me know if you have questions.

reyammer avatar Oct 04 '24 12:10 reyammer

Hello @brokoli777, still interested in helping out on this or should I take from here?

reyammer avatar Oct 14 '24 08:10 reyammer

Oh very sorry! For some reason, I didn't realize there was a reply to the pull request. I will do the recommended changes right now.

bregwin avatar Oct 14 '24 14:10 bregwin

Thanks, new round of comments:

  • ruff pass still fails, can you double check?
  • in case of errors, it seems the script just prints errors and does not really exit with 1?
  • I saw that the new function takes as input a markdown_path (which indicates it's a path to a given file), but the code tries to check whether it's a directory and does some recursive check to find new markdown. I find this confusing, I propose to keep it simple: the function should take a markdown_path (as it is now), and this should just be a path to a given markdown file; let's remove directory checks or anything like this. Unneeded complexity. So, let's move the code from the inner function to the outer function and then remove the inner function itself. and let's make sure it does exit with 1 in case of problems. Let's also update the comment to reflect that (focus on one markdown, not one or more).

Thanks!

reyammer avatar Oct 16 '24 14:10 reyammer

Hi, I believe I completed the mentioned suggestions. Let me know if it works on your end.

bregwin avatar Oct 16 '24 18:10 bregwin

Merged, thanks!

reyammer avatar Oct 17 '24 14:10 reyammer