filiph / linkcheck

Fast link checker
https://pub.dartlang.org/packages/linkcheck
MIT License
403 stars 51 forks source link

Option to show only broken links #75

Closed ggrossetie closed 3 years ago

ggrossetie commented 3 years ago

Hello! 👋🏻

Thanks for creating this really amazing and fast tool!

I think it would be great if we could make the output less verbose when there are broken links. Here's an example when a single link is broken:

$ linkcheck --skip-file ignore-links.txt :8000 
Done crawling.                   

http://localhost:8000/developer/spark/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/architecture/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/aura/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/configuration/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/faq/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/gds/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/neo4j-cluster/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/overview/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/python/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/quick-java-example/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/quickstart/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)
- (585:13) 'Reading' => http://localhost:8000/developer/spark/quickstart/reading (HTTP 404)

http://localhost:8000/developer/spark/reading/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/types/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

http://localhost:8000/developer/spark/writing/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)

Errors. Checked 2086 links, 17 destination URLs (49 ignored), 15 have redirect(s), 1 has error(s), 0 have warnings.

As you can see the output is quite verbose considering that only one link is broken:

http://localhost:8000/developer/spark/quickstart/
- (44:6) => http://localhost:8000/ (HTTP 200)
  - redirect path:
    - http://localhost:8000/ (302)
    - /developer/spark (301)
    - /developer/spark/ (200)
- (585:13) 'Reading' => http://localhost:8000/developer/spark/quickstart/reading (HTTP 404)

I would expect something like:

$ linkcheck --skip-file ignore-links.txt :8000 
Done crawling.                   

http://localhost:8000/developer/spark/quickstart/
- (585:13) 'Reading' => http://localhost:8000/developer/spark/quickstart/reading (HTTP 404)

Errors. Checked 2086 links, 17 destination URLs (49 ignored), 15 have redirect(s), 1 has error(s), 0 have warnings.

I tried to use the --[no-]show-redirects flag but as far as I understand it only affects the summary/stats:

Errors. Checked 2086 links, 17 destination URLs (49 ignored), 15 have redirect(s), 1 has error(s), 0 have warnings.
Errors. Checked 2086 links, 17 destination URLs (49 ignored), 1 has error(s), 0 have warnings.

Thanks!

ggrossetie commented 3 years ago

It seems that this issue is already fixed on the master branch:

$ linkcheck --skip-file ignore-links.txt :8000 
Done crawling.                   

http://localhost:8000/developer/spark/quickstart/
- (585:13) 'Reading' => http://localhost:8000/developer/spark/quickstart/reading (HTTP 404)

Errors. Checked 2086 links, 17 destination URLs (49 ignored), 1 has error(s), 0 have warnings.

@filiph do you plan to create a release for the https://github.com/filiph/linkcheck/releases/tag/v2.0.16 tag (and attach binaries)?

ggrossetie commented 3 years ago

Alternatively, could you please describe how binaries were generated on the https://github.com/filiph/linkcheck/releases/tag/v2.0.15%2B1 release? Thanks!

ggrossetie commented 3 years ago

A new release is available!