-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Optional features #224
Optional features #224
Conversation
- 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.
- Some optional features are unnecessary - `console` can pad strings, but it currently needs a patch. And `pad` is no longer needed. - Added preminary support for opt-out `serde` feature. (WIP)
If `serde` is not enabled, `lychee` doesn't support JSON output format. This maybe useful for non-technical users.
github-rs doesn't seem to be actively maintained at this point (last commit in May 2019). |
@mre |
That's true. If we can we should support them with adding that. My feeling is we'll run into other issues with github-rs further down the line. To be honest I don't mind keeping the explicit dependency on ring right now to have M1 support. |
github-rs will not be the big issue because GitHub API is stable, and we only need very minimal API (Token and Repository). The true problem is the rust-native-tls it depends on. This doesn't rely on ring but it is not actively developed. So we can use github-rs for aarch.apple.darwin, and in the long run M1 compatibility should get better. Also hubcaps is not well-maintained. It uses old dependencies which is a serucity risk. |
That's fine with me, even though I'd say depending on two outdated crates is more of a security risk than just one. I'd personally just keep ring as an explicit dependency for now and try to get an updated version of hubcaps out, which would help other downstream crates as well. |
- Added `config_file` and `json_output` as features of `lychee` - `config_file` enables `lychee` to read options from a `toml` config file. - `json_output` enables `lychee` to output in JSON format. - These two features are enabled by default. Turning off these features will cut off dependency on `serde`. It also turns off `lychee-lib`'s dependency on `serde` as well. - `indicatif` is an optional dependency. It's enabled by default but it's hardly useful in CI. - Refactor: - The `lychee::main::run` function is too long. Some of its functionalities are factored out to dedicated functions. - Notably, `Config` now has a bunch of new methods that parses various fields. - Exported `lychee_lib::client::Client` as public struct (with private fields).
There's something wrong with CI. Testing locally doesn't show any problem. |
Humm... no clue what's going on yet. |
With #330 merged, can you rebase your changes on top of |
@lebensterben can you rebase this to take a look at the failing |
@mre |
After some review I concluded that it's much easier to restart a PR... |
console
can pad strings, but it currently needs a patch. Andpad
is no longer needed.
lychee
config_file
enables setting options from a TOML file.json_output
enables outputting in JSON format.indicatif
enables progress bar.Next:
hubcaps
withgithub-rs
to see whether M1 architecture can buildlychee
.