Commit graph

95 commits

Author SHA1 Message Date
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