Commit graph

194 commits

Author SHA1 Message Date
Matthias
4630216c30 Add description for max-cache-age flag 2022-01-14 16:55:56 +01:00
Matthias
ac490f9c53
Add caching functionality (v2) (#443)
A while ago, caching was removed due to some issues (see #349).
This is a new implementation with the following improvements:

 * Architecture: The new implementation is decoupled from the collector, which was a major issue in the last version.    Now the collector has a single responsibility: collecting links. This also avoids race-conditions when running multiple collect_links instances, which probably was an issue before.
* Performance: Uses DashMap under the hood, which was noticeably faster than Mutex<HashMap> in my tests.
* Simplicity: The cache format is a CSV file with two columns: URI and status. I decided to create a new struct called CacheStatus for serialization, because trying to serialize the error kinds in Status turned out to be a bit of a nightmare and at this point I don't think it's worth the pain (and probably isn't idiomatic either).

This is an optional feature. Caching only gets used if the `--cache` flag is set.
2022-01-14 15:25:51 +01:00
Matthias
92b939eb2f
Update README.md 2022-01-13 13:11:55 +01:00
Matthias
3b060c80dc
Update README.md 2022-01-10 21:03:30 +01:00
Matthias
0645177b84
Bump version (#450) 2022-01-10 01:38:46 +01:00
Matthias
21f3160b71
Make retries configurable; align constants (#446)
Using the same default values for the library and the
binary now but tweaked the values a bit for slightly faster performance.
2022-01-07 01:03:10 +01:00
Matthias
9f8e496a8d
Add Azure/ResourceModules 2021-12-20 22:50:19 +01:00
Matthias
a795f2bf3f
Change usage examples (#429) 2021-12-18 00:28:08 +01:00
Matthias
d80b9b8e6a
Update docs (#428)
Add more lychee users, update usage instructions, fix typos
2021-12-17 02:00:28 +01:00
Matthias
18c606d2e8
Fix docs badge 2021-12-16 20:47:35 +01:00
Matthias
ec03c8d0f7
Update README.md 2021-12-03 12:23:43 +01:00
Erik Rigtorp
7d92609ff2
Muffet supports recursively checking links (#403) 2021-11-23 13:32:07 +01:00
Matthias
591cbdbebb
Add support for .lycheeignore file #308 (#402)
This is similar to files like .gitignore and .dockerignore
and gets merged into exclude_files
2021-11-23 01:39:53 +01:00
Matthias
30a0fd3856
Bump version to 0.8.1 (#396) 2021-11-18 00:59:28 +01:00
Matthias
b97fda34d0
Add support for different output formats (compact, detailed, markdown) (#375) 2021-11-18 00:44:48 +01:00
Matthias
ed0efcd4f8 Prepare release 2021-10-28 00:34:48 +02:00
Matthias
b48292be4a
Move to debian/bullseye:slim as base image (#370) 2021-10-26 19:50:53 +02:00
Matthias
a5240c1851
Add link to Github action in marketplace 2021-10-14 23:32:31 +02:00
MichaIng
b648b5e914
Imply "localhost" when loopback IPs are excluded (#351)
as "localhost" is usually mapped via "hosts" file to a loopback IP address.

Resolves: https://github.com/lycheeverse/lychee/issues/319

Signed-off-by: MichaIng <micha@dietpi.com>
2021-10-06 11:33:23 +02:00
Daniel Doubrovkine (dB.)
df12f31f83
Fix: typo. (#350) 2021-10-02 23:53:14 +02:00
Matthias
712bdfa8cb
Make inputs required (show help if not provided) (#329) 2021-09-16 16:40:38 +02:00
Matthias
21ea0fd033
Add support for tokio-console (#318)
This allows troubleshooting and improving async Rust code.
It is an optional feature that is still
experimental (but can be quite helpful)
2021-09-12 18:10:23 +02:00
Matthias
a1acf7b0d0 Reintegrate master 2021-09-09 01:49:25 +02:00
Matthias
f3fe46a4d6 Merge branch 'master' of github.com:lycheeverse/lychee into local-files 2021-09-08 00:35:41 +02:00
Matthias
0c5dcf3aa3 whoops 2021-09-07 01:05:41 +02:00
Matthias
8353ab1071 Update docs 2021-09-07 00:53:42 +02:00
Paweł Romanowski
8fd34a7367
Add no check (dump links only) flag (#99) 2021-09-06 16:10:48 +02:00
Matthias
9163066a6b Reintegrate master 2021-09-06 15:23:10 +02:00
Matthias
b7c129c431 Fix resolving absolute paths
The previous solution didn't resolve to absolute paths
and rather removed things like `.` and `..`.
2021-09-06 15:20:18 +02:00
Matthias
185645ac81 Update docs 2021-09-06 15:15:05 +02:00
Lucius Hu
80b8a856ac
Add new flag --require-https (#195) 2021-09-04 03:21:54 +02:00
Daniel Doubrovkine (dB.)
f866abef61
Fix publish workflow (#309) 2021-09-04 01:49:29 +02:00
Matthias
a7c1eae115 Bump version to 0.7.1 2021-09-03 19:35:36 +02:00
Matthias
96c80c3647 Add changes made by @dblock in #304 2021-09-03 19:18:39 +02:00
dblock
dcee4a1058 Added support for --exclude-file. 2021-09-03 16:29:57 +02:00
Matthias
ef65067625
Use HTTPS links 2021-09-03 02:03:39 +02:00
Matthias
d36548417e
Make configuration file easier to find 2021-09-01 14:30:34 +02:00
Matthias
a72f2f6ace
Mention epub checking 2021-07-14 16:03:48 +02:00
YAKSH BARIYA
6ef121d3eb
docs: lychee is also available on Termux (#274) 2021-07-05 01:45:32 +02:00
Matthias
434ffacd30
Mention examples folder 2021-04-30 16:33:37 +02:00
Matthias
9f75f28d3d
Add example folder (#241) 2021-04-30 13:33:24 +02:00
Matthias
12c6f0496c
fix line break 2021-04-26 18:28:29 +02:00
Matthias
164e1aea7e
Add support for multiple schemes (#237) 2021-04-26 18:24:54 +02:00
Matthias
7a8bac9ac5
Update README.md 2021-04-24 19:08:57 +02:00
Matthias
952dc6a04c
Reorder sections 2021-04-24 16:23:36 +02:00
Matthias
38d162e238
Fix syntax 2021-04-24 16:04:56 +02:00
Matthias
5621a2946a
Add Arch installation instructions 2021-04-24 16:04:17 +02:00
Matthias
dfc0c16a2e
Add NixOS 2021-04-24 15:53:51 +02:00
Matthias
d3e6abed90
Extend installation instructions and move them up 2021-04-24 15:33:25 +02:00
Matthias
f7f9485be0
Bump version to 0.7 (#229) 2021-04-17 13:41:00 +02:00
Lucius Hu
f64213d58c
More refactor (#225)
- Major changes in `lychee-lib::filter` module:
  - Fields in `Excludes` except the `RegexSet` is now moved to `Filter`.
  - `Filter` contains `Option<Excludes>` and `Option<Includes>`, which are
    wrapper struct of `RegexSet` instead of `Option<RegexSet>`. As a result
    the code now looks cleaner.
  - Factored out some filtering logics to dedicated functions.
    - It's possible to write tests for those functions in addition to tests
      for the `Filter` struct.
  - Added docs to `Filter::is_excluded` and reorgnized the code.
- placed `derive_builder` by `typed_builder`:
  - The internal interface very ugly, as admitted by the author, but we no
    longer have nested `Option`s like before.
  - As a result, the `Client` building is much easier to read.
  - Main benefit of `typed_builder` is, the arguments feeded to builder is
    checked at compile time instead of run-time.
- Fixed a bug in `lychee::tests::usage` and `lychee-lib::stats::test`.
  - Now it will clear environment variable which would otherwise cause an
    issue if `GITHUB_TOKEN` is set.
- Updated dependencies.

Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
2021-04-16 20:25:22 +02:00
Matthias
cb512dbf2e
Fix link to ClientBuilder documentation after refactor 2021-04-16 00:53:06 +02:00
Matthias
3ed06da829
Update link to docs 2021-04-15 12:42:37 +02:00
Lucius Hu
228e5df6a3
Major refactor of codebase (#208)
- The binary component and library component are separated as two
  packages in the same workspace.
  - `lychee` is the binary component, in `lychee-bin/*`.
  - `lychee-lib` is the library component, in `lychee-lib/*`.
  - Users can now install only the `lychee-lib`, instead of both
    components, that would require fewer dependencies and faster
    compilation.
  - Dependencies for each component are adjusted and updated. E.g.,
    no CLI dependencies for `lychee-lib`.
  - CLI tests are only moved to `lychee`, as it has nothing to do
    with the library component.
- `Status::Error` is refactored to contain dedicated error enum,
  `ErrorKind`.
  - The motivation is to delay the formatting of errors to strings.
    Note that `e.to_string()` is not necessarily cheap (though
    trivial in many cases). The formatting is no delayed until the
    error is needed to be displayed to users. So in some cases, if
    the error is never used, it means that it won't be formatted at
    all.
- Replaced `regex` based matching with one of the following:
  - Simple string equality test in the case of 'false positivie'.
  - URL parsing based test, in the case of extracting repository and
    user name for GitHub links.
  - Either cases would be much more efficient than `regex` based
    matching. First, there's no need to construct a state machine for
    regex. Second, URL is already verified and parsed on its creation,
    and extracting its components is fairly cheap. Also, this removes
    the dependency on `lazy-static` in `lychee-lib`.
- `types` module now has a sub-directory, and its components are now
  separated into their own modules (in that sub-directory).
- `lychee-lib::test_utils` module is only compiled for tests.
- `wiremock` is moved to `dev-dependency` as it's only needed for
  `test` modules.
- Dependencies are listed in alphabetical order.
- Imports are organized in the following fashion:
  - Imports from `std`
  - Imports from 3rd-party crates, and `lychee-lib`.
  - Imports from `crate::*` or `super::*`.
- No glob import.
- I followed suggestion from `cargo clippy`, with `clippy::all` and
  `clippy:pedantic`.

Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
2021-04-15 01:24:11 +02:00
Matthias
72c01df6fb
Merge "failed" status into "error" status (#191)
I think that the separation between Status::Failed and Status::Error is a
bit misleading. It was easier to implement, but from a user's perspective
they are more or less the same: something unexpected happened.
So I merged both into one: Status::Error. Still not 100% happy with the
semantics, but it's an improvement I'd say.
2021-03-28 17:20:03 +02:00
Matthias
2d724c2d38
Don't format help output as shell script in README.md 2021-03-17 02:07:05 +01:00
Matthias
52853a961b
Use new svg logo 2021-03-15 23:27:42 +01:00
trevyn
1d4171328e
fix typo "continuos" -> "continuous" (#175) 2021-03-11 11:17:06 +01:00
Matthias
46263298fe
Update README.md 2021-03-04 16:01:09 +01:00
Matthias
a7168951c1
Enabled progress bar is the default now 2021-02-24 12:19:12 +01:00
Matthias Endler
2272ad1a48 Show progress bar by default (can be disabled with --no-progress) 2021-02-21 17:19:32 +01:00
Matthias Endler
e00cdbf1ae example.com -> example.org 2021-02-21 16:33:33 +01:00
Matthias Endler
fe5cea1de3 Add doc-comment tests 2021-02-18 11:14:00 +01:00
Matthias Endler
16cd67331a Add simple, standalone client
Adds a new function `lychee::check()`, which removes
a lot of boilerplate for simple cases. Adjusted the code,
tests, and documentation.
The downside is that `check` now returns a Result, so
we have to use `?` to get to the response. That's because
we have to account for the case where the given string is
not a valid URI.
2021-02-18 01:32:48 +01:00
Matthias Endler
737f6d3c3b Update help message 2021-02-17 13:54:41 +01:00
Matthias Endler
54e1d3e078 Simplify tests 2021-02-16 00:35:59 +01:00
Matthias
0b148bf5e6
Exclude e-mails from being checked (#137)
This can be useful in CI environments where SMTP is not allowed.
2021-02-10 11:58:04 +01:00
Paweł Romanowski
4d5b98978c
Mention GitHub Action in README.md (#135)
Also mention GitHub token in TROUBLESHOOTING.md
2021-02-08 12:18:50 +01:00
Matthias
8cc6d59587
Be more explicit about license in docs 2021-02-02 14:32:19 +01:00
Matthias
a50c04fffe
Add hint about separating inputs from options with -- (fixes #113) (#119) 2021-01-17 17:01:06 +01:00
Matthias Endler
e1faccf330 Update version 2021-01-09 02:06:05 +01:00
Matthias
d93662dc22
Use lychee namespace in lib examples and link to docs 2021-01-08 10:52:10 +01:00
Matthias Endler
419492f366 Mention recursion support 2021-01-07 00:42:39 +01:00
Matthias Endler
f0fa7eb73f Add JSON output feature 2021-01-07 00:37:42 +01:00
Paweł Romanowski
3d6f65820e
Test that cli parameters / usage are in sync in README.md (#95)
This makes it impossible to have diverged --help and README.md
2021-01-04 22:26:43 +01:00
Matthias
35509984ba
Formatting 2020-12-15 19:17:26 +01:00
Matthias
01f70bdc0a
Mention lychee itself as a user 2020-12-15 00:46:42 +01:00
Matthias
25e15500a7
Fix link 2020-12-15 00:43:45 +01:00
Matthias
497971a4a2
Remove duplicate entry in comparison table 2020-12-15 00:42:54 +01:00
Matthias
12f6c62f92
Add new lychee users 2020-12-14 11:38:10 +01:00
Matthias
60eb3ce31b
Mention binary releases in README.md 2020-12-12 00:28:56 +01:00
anarcat
a332582c65
linkchecker supports HTML files (#67)
* linkchecker supports HTML files

Not sure if that's an omission or of I missed something, but I believe that checking local `.html` files works in linkchecker.

* linkchecker also supports Markdown files

... with the `markdowncheck` plugin.
2020-12-05 21:34:34 +01:00
Paweł Romanowski
0167502d8d
Update GitHub token info, add my repo as user (#66) 2020-12-04 22:42:10 +01:00
Matthias
b7ab4abb0d
Make lychee usable as a library #13 (#46)
This splits up the code into a `lib` and a `bin`
to make the runtime usable from other crates.

Co-authored-by: Paweł Romanowski <pawroman@pawroman.dev>
2020-12-04 10:44:31 +01:00
Matthias
b6dbf038d0
fix typo 2020-12-03 15:09:44 +01:00
Matthias
096b372bee
Mention official Docker image 2020-12-03 00:05:31 +01:00
Paweł Romanowski
1f787613d4
Add support for reading from stdin and make input handling more robust (closes #26)
* Adds a `skip_missing` flag
* Adds an `Input` enum to handle different types of inputs
2020-12-02 23:28:37 +01:00
Paweł Romanowski
e197012e7a
Update troubleshooting guide, add .editorconfig (#60) 2020-12-02 23:07:52 +01:00
Matthias
37f2621d85
Add contributing guidelines and create missing issues 2020-12-01 01:19:41 +01:00
Matthias
d2e349cb29
Add link to troubleshooting guide 2020-12-01 00:32:37 +01:00
Matthias
883f638857
Revamp documentation 2020-11-25 10:22:03 +01:00
Matthias
8025a2eedb
Formatting 2020-11-23 13:10:32 +01:00
Matthias
1474ae802b
Update README.md 2020-11-09 12:12:57 +01:00
Matthias
a7673562d7
Fix formatting 2020-11-09 11:49:32 +01:00
Matthias
22c70cd85c
Use different icons for feature comparison (#32)
Taken from https://github.com/getzola/zola
2020-11-09 11:46:45 +01:00
Matthias
f7a1fcdf70
Update README.md 2020-11-06 00:22:14 +01:00
Paweł Romanowski
326683f4eb
Make GITHUB_TOKEN optional (#22)
* Make GITHUB_TOKEN optional

This also makes the token possible to pass in from CLI args.

* Add missing test fixture file

* Normalize exit codes and GitHub checking behavior

The exit code is now defined as 1 for unexpected or config errors,
and 2 for link check failures.

GitHub checking behavior has been tweaked to generate errors if
a GitHub-specific check cannot be performed because of a missing
token.

* Remove short flag for github token
2020-10-26 23:31:31 +01:00
Matthias
ac79314c03
Mention support for basic auth by @FabianBG 2020-10-26 09:25:00 +01:00
Matthias
f0e4c3adc1
Add support for include patterns (#23)
In one or more `include` arguments are specified, only check the URLs that match the patterns.
In case `exclude` arguments are also
specified, make an exception from the
excluded URLs if they also match the
`include` patterns.
2020-10-25 13:41:06 +01:00
Matthias
6463372799
Mention support for relative urls 2020-10-21 13:03:55 +02:00