Skip to content
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

Reference style links are checked or reported multiple times #277

Open
theofidry opened this issue Mar 2, 2025 · 1 comment
Open

Reference style links are checked or reported multiple times #277

theofidry opened this issue Mar 2, 2025 · 1 comment

Comments

@theofidry
Copy link

Taken from this job: https://github.com/box-project/box/actions/runs/13615816913/job/38058706641

And an excerpt in case the job output is removed later:

✔ [200] https://secure.php.net/manual/en/phar.setsignaturealgorithm.php
✔ [200] https://secure.php.net/manual/en/book.zlib.php
✔ [200] https://symfony.com/slack-invite
✔ [200] https://symfony.com/slack-invite
## Summary

| Status        | Count |
|---------------|-------|
| 🔍 Total      | 644   |
| ✅ Successful | 642   |
| ⏳ Timeouts   | 0     |
| 🔀 Redirected | 0     |
| 👻 Excluded   | 0     |
| ❓ Unknown    | 0     |
| 🚫 Errors     | 2     |

## Errors per input

### Errors in doc/docker.md

* [404] [https://docs.docker.com/samples/library/php/](https://docs.docker.com/samples/library/php/) | Failed: Network error: Not Found

### Errors in ./doc/docker.md

* [404] [https://docs.docker.com/samples/library/php/](https://docs.docker.com/samples/library/php/) | Failed: Network error: Not Found
*

You can see the 404 appears twice. The underlying code was something like this:

blablabla [`docker-php-ext-install`][docker-php-ext-install] blablabla [`docker-php-ext-install`][docker-php-ext-install]

[docker-php-ext-install]: https://deadlink.com

In other words I am using a reference-style link in my document and it looks like it is either checked or reported for every usage, rather than once.

@theofidry theofidry changed the title Some links are checked multiple times Reference style links are checked or reported multiple times Mar 2, 2025
@mre
Copy link
Member

mre commented Mar 2, 2025

I think the problem is more that doc/docker.md and ./doc/docker.md are listed as separte documents.

When I search for docker.md inside the project, I can find a few links:

> rg 'docker.md'
./doc/symfony.md
104:« [Docker support](docker.md#docker-support) • [Reproducible build](reproducible-builds.md#reproducible-builds) »

./doc/code-isolation.md
75:« [Optimize your PHAR](optimizations.md#optimize-your-phar) • [Docker support](docker.md#docker-support) »

./README.md
27:- 🐳 [Docker support (`box docker`)](doc/docker.md#docker-support)
98:1. [Docker support](doc/docker.md#docker-support)

./doc/index.md
24:- 🐳 [Docker support (`box docker`)](docker.md#docker-support)

./mkdocs.yaml
50:            -   'Docker support': docker.md

And when I look at your lychee args, I can see a glob filter for 'doc/**/*.md':

--verbose --no-progress '*.md' 'doc/**/*.md' --cache --max-cache-age 1d .

lychee discovers files through command-line arguments (inputs) like these glob patterns, but also through links to other documents. That might explain why doc/docker.md and ./doc/docker.md get discovered.

We don't do any deduplication when listing the per-file summary and it's also pretty challenging due to many edge-cases, but perhaps we should give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants