-
Notifications
You must be signed in to change notification settings - Fork 394
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 check: CI verision does not work properly #1148
Comments
I think a few things are wrong with these scripts:
should it be
This a nice stuff, but I think it creates a temp Not sure if there are any other problems ... |
Also,
sed on Mac does not like |
Absolutely not. No idea what this is. Definitely not a valid command. Accidental garbage committed in 847d4ad ? @pavelgrinchenko did you mean to do this? The original line was simply: Were you trying to exclude the
Yes, I was very aware of this and opted for lazy programming since it's only ever an issue with running on git-diffs (a bit of extra pain for devs to fix one link at a time if there are multiple broken links in a single diff. I'd query "Y IZ MOAARR BODEN LINKZ IN UR PR PLZ? HAZ PAIN FIX PLZ"). I can definitely fix this though. |
gotcha
yes, it looks like so
for redirects probably it's better to make an exception and exclude it in the script?
got it, as well ... if it is too much effort - let's keep it as is |
Similar to #1123 (comment), this was never intended to be run locally, and certainly not on a mac. Could probably replace
Using
rather than (currently,
I don't have particularly strong opinions on this. |
Yes I think we're both talking about the same thing. To be clear:
|
yep, that would be great |
yep, same. But it looks it is the only thing (if pcre is installed and it's quite easy) that prevents this script from running on Mac (granted you didn't have intention to support it locally, but even for devs to debug the script itself you have to run it at least somehow ). Also, forgive me my lack of regex knowledge, but why can't we just use |
Btw, I think it would be great for exclude-list to support path to a file to exclude. Again, if it's not that much effort. It's not nice to hard code some file within the script itself. |
Yes. Why it works: https://stackoverflow.com/questions/5685007/making-git-log-ignore-changes-for-certain-paths/21079437#21079437 |
yes, it's
$ git diff master --name-only # correct, but no exclusion
scripts/link-check-git-diff.sh
$ git diff master --name-only ':^redirects-list.json' # incorrect (current)
fatal: ambiguous argument ':^redirects-list.json': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
$ git diff master --name-only -- ':^redirects-list.json' # requires git>=2.13
$ git diff master --name-only -- ':!redirects-list.json' # still fails
fatal: There is nothing to exclude from by :(exclude) patterns.
Perhaps you forgot to add either ':/' or '.' ?
$ git diff master --name-only -- . ':!redirects-list.json' # correct
scripts/link-check-git-diff.sh Also probably we should have a file-exclusion list as well as a link-exclusion list (see #1000). Will fix. |
from the original #958, it's called recursive/balancing groups regex. Technically only |
outputs nothing (not tested)
outputs:
If that was the intention, what is the case we need the |
oh I thought you were talking about If you mean dropping the |
|
curious, ok. I've seen reports in the past where mac users needed |
* test: fix link-check diffs Fixes #1148 * test: link-check: fix file paths, add comments * test: link-check: use git pathspec exclusions * test: link-check: more path safety and comments * test: link-check: misc tidy * test: link-check: fix git diff multi-errors * test: link-check: fix mac sed * test: link-check: diff: whitelist rather than blacklist As with `link-check-git-all.sh`, only include `md` & `js` rather than include all except specified files * link-check: add more file extensions * link-check: add and sort exclusions * link-check: add *.css * link-check: re-exclude redirects-list.json
Example
https://dvc.org/uploads/images/2020-02-10/image.png
was detected here:
https://app.circleci.com/pipelines/github/iterative/dvc.org/2946/workflows/f15ce218-150d-4504-a5a3-647e8e721f43/jobs/2994
The text was updated successfully, but these errors were encountered: