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

Local file check broken #21

Open
Flamefire opened this issue Jun 23, 2021 · 1 comment
Open

Local file check broken #21

Flamefire opened this issue Jun 23, 2021 · 1 comment

Comments

@Flamefire
Copy link

The local file check doesn't really work well for us. Please check the following suggestions below:

First the following line is superflous and actually has the expanduser at the wrong place breaking the passing of ~/... paths:

path = Path(path).resolve().expanduser() # must have .resolve()

Then our markdownfiles have relative links like [Request](req_resources.md) which are completely ignored (reported as "not found") by the linkchecker.

The check at

if {"/", "."}.intersection(stem):
continue
and
if {"/", "."}.intersection(stem):
continue
is needlessly duplicated.
However I don't understand its purpose: Why disallow links with slashes and dots, e.g. the one above?

Why doesn't

if not (
(path / (stem + ext)).is_file()
or (path.parent / (stem + ext)).is_file()
or (path / stem).is_dir()
):
check for (path / stem).is_file()?

And finally: The list is only printed, but does not affect the return code. See

print(missing_file)

@lhanson
Copy link

lhanson commented Apr 11, 2022

Relative links being ignored is a dealbreaker for me.

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