Git Product home page Git Product logo

Comments (6)

chipzoller avatar chipzoller commented on August 11, 2024 2

To add my two cents here, although I think a README change is probably sufficient, it seems like there could be some type of enhancement that would at least let users know that root-level files were discovered and skipped. Even if that were only shown in a debug or verbose mode, that'd be fine and probably enough to point users in the right direction. My expectation as a user of lychee is that there's some setting which will tell me absolutely every link lychee "saw" and what its disposition is. Even if the --base . flag isn't set, it's still a genuine link. I'd want to be told what it did or didn't do about it.

from lychee.

mre avatar mre commented on August 11, 2024 1

Yes, absolutely. Pull requests to lychee-action (and possibly lychee) to clarify the behavior would be very welcome. I'm too involved in the tool creation to make this an easy task for me, as it's kinda obvious by now, but of course that's just Stockholm syndrome. 😆

from lychee.

mre avatar mre commented on August 11, 2024

FYI: moved the issue to the lychee main repo, because it's a better fit there.

from lychee.

mre avatar mre commented on August 11, 2024

Thanks for the thorough analysis.

Yes, --base . is currently the suggested way. Making it the default would make your case work, but break another case:
If the input is https://example.com and we find a link such as /about on that page, we assume it is pointing to https://example.com/about, which is a sensible assumption.

However, setting --base to . by default conflicts with that.
That's because we set the base from the source URL if --base is not set.
#358

If we change that behavior, we have to track (or infer) whether the source is a directory path or a URL. Sounds straightforward, but there are edge-cases like /about, which could be either a path or a URL relative to the domain root — depending on the context.

I do think that this can be resolved, it just requires more research and thorough testing to avoid any future surprises. I would love to get some help on this by mapping out all cases and maybe writing some tests.
For now, --base . avoids any ambiguities, at the cost of false negatives if the parameter isn't used.

from lychee.

tgaff avatar tgaff commented on August 11, 2024

Thanks for triaging this mre.
It makes sense that completely ignoring the link is a bug for this repo.

Would it make sense to add some small description to the README of the lychee-action repo so that others are aware they should add --base . when testing against local files rather than a server? It can be pretty non-obvious when it checks a few hundred links that a few were quietly skipped over.

from lychee.

mre avatar mre commented on August 11, 2024

Fair. As a first step we could print the ignored potential links in verbose mode.

from lychee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.