Skip to content

Add linkspector config to fix local links issue - #740

Merged
AdrianDAlessandro merged 13 commits into
mainfrom
ci/fix-linkspector-local-links
Aug 14, 2026
Merged

AdrianDAlessandro merged 13 commits into
mainfrom
ci/fix-linkspector-local-links

Conversation

@sbland

@sbland sbland commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an issue with linkspector failing local links. See #533 (comment)

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Technical work (non-breaking, change which is work as part of a new feature)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • The documentation builds and looks OK (eg. mkdocs serve)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))

@sbland
sbland requested a review from AdrianDAlessandro June 10, 2026 08:56
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AdrianDAlessandro AdrianDAlessandro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just approved this, but it seems like it's not needed anymore because the PR that this was designed to fix is no longer failing

@sbland

sbland commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

I still get a failed report when I run Linkspector locally with the default config. It's possible the action has a different default which I'll check

@AdrianDAlessandro

Copy link
Copy Markdown
Collaborator

I still get a failed report when I run Linkspector locally with the default config. It's possible the action has a different default which I'll check

Oh right! I haven't tried to run it locally. Which links are failing when you run it locally?

@sbland

sbland commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I still get a failed report when I run Linkspector locally with the default config. It's possible the action has a different default which I'll check

Oh right! I haven't tried to run it locally. Which links are failing when you run it locally?

I used the following command:
docker run --rm -it -v $PWD:/app umbrelladocs/linkspector bash -c 'linkspector check -c /app/.linkspector.yml'

Then I get the output below:


  ❯ Linkspector v0.5.5
  ────────────────────────────────────────────

  README.md
  L118:30  ✘ http://127.0.0.1:8000/  null net::ERR_CONNECTION_REFUSED at http://127.0.0.1:8000/

  ✔ 62 OK  ✘ 3 broken  ◉ 0 skipped  ─  20 files in 9.9s

  ✘ Some hyperlinks are invalid.

@AdrianDAlessandro

Copy link
Copy Markdown
Collaborator

Ok @sbland I think you've uncovered a bug here. I don't think the linkspector action is working. I've just added a link that should make it fail, but it looks like it has not failed. So there is another issue here.

@sbland

sbland commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Issue seems to be that the action isn't loading the config and we are missing the line:
fail_level: any

@sbland sbland self-assigned this Aug 13, 2026
@AdrianDAlessandro
AdrianDAlessandro force-pushed the ci/fix-linkspector-local-links branch from 4eadc86 to 7d440d7 Compare August 14, 2026 10:50
@AdrianDAlessandro

Copy link
Copy Markdown
Collaborator

@sbland I've managed to work all of this out.

On localhost failing locally but not in CI:

  • For some reason, the Linkspector CI action respects the markdown-link-check comments, but the way you are running it locally does not (see check failing in commit 9555a2e)
  • For consistency, I think the config file approach you have put into this PR is the best approach.
  • We do not need to include the config_file parameter in CI (see latest version on this branch)

On the checks appearing to pass even with invalid links:

Issue seems to be that the action isn't loading the config and we are missing the line: fail_level: any

  • Yes, this fail_level is required. See the commits above, I removed and re-added all of the components to make it all make sense.

@AdrianDAlessandro
AdrianDAlessandro merged commit 9e49844 into main Aug 14, 2026
7 checks passed
@AdrianDAlessandro
AdrianDAlessandro deleted the ci/fix-linkspector-local-links branch August 14, 2026 13:21
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

Successfully merging this pull request may close these issues.

2 participants