-
-
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
include more information in the JSON output #268
Comments
It consumes more memory if you'd want to store the status of successful links. |
Probably in combination with |
Thanks for the feature request @eyarz. About the implementation, we'd have to create a lychee/lychee-bin/src/stats.rs Lines 25 to 35 in 7e49772
and save the URL in add here:
lychee/lychee-bin/src/stats.rs Line 43 in 7e49772
and skip the field serialization with a // Use a method to decide whether the field should be skipped.
#[serde(skip_serializing_if = "Verbosity::High")]
success: Vec<String, String>, |
In my opinion, everything should be included in the JSON output (including redirects). BTW, my use case is that we are using lychee with this Awesome Kubernetes project and I want to run another validation (github projects are not archived) on the passing links. |
Did you see #271? It might be an alternative which could cover more use cases. In your situation you could filter the GitHub links with grep then and check if they are archived. Lychee exits with a non-zero exit code in case of errors, in which case your CI would fail as expected. lychee --output raw | grep github.com | <check github link> |
I guess this (#271) will also help me with my use case. |
regarding extending the JSON format, would be feasible to track the lines of each occurrence like: {
"total": 68,
"successful": 67,
"failures": 1,
"timeouts": 0,
"redirects": 0,
"excludes": 0,
"errors": 0,
"fail_map": {
"docs/README.md": [
{
"url": "https://semaphoreci.com/ramitsurana/awesome-kubernetes",
"status": "Failed: HTTP status client error (404 Not Found) for url (https://semaphoreci.com/ramitsurana/awesome-kubernetes)",
"lines": [13]
}
]
}
} ? I'm thinking on writing a GitHub Workflow that will open an issue listing every line that has a dead link (to maintain repos |
line no cannot be easily added since the AST strangely doesn't record the raw line/column number. https://docs.rs/markup5ever_rcdom/latest/markup5ever_rcdom/enum.NodeData.html |
if we use https://github.com/tree-sitter/tree-sitter-html plus some more effort we can have a highly efficient parser with line/column number though. |
that would be great. Unfortunately, I didn't know Rust so I can't help you guys :/ |
I was just going to file an issue for reporting line numbers -- that I can click an open in text editor, like an error in a python program -- but I see this here. Line numbers would indeed be welcome. |
See #480, which will be the first step towards making line numbers possible. @untitaker fyi. |
I think we can build this into html5gum and it's going to be easier than html5ever (because I'm more familiar with the codebase), but if we go with the external-stream hack that gives you approximate line number and is probably just as easy with html5gum/html5ever. But I haven't done much investigation on that front. |
👍 |
More granular verbosity levels have been asked for repeatedly. To enable that we're moving to [env_logger] and [clap-verbosity-flag] to provide more flexible verbosity settings. Also tackles #661, #709 Lays the groundwork for tackling #268 https://github.com/rust-cli/env_logger https://github.com/clap-rs/clap-verbosity-flag
More granular verbosity levels have been asked for repeatedly. To enable that we're moving to [env_logger] and [clap-verbosity-flag] to provide more flexible verbosity settings. Also tackles #661, #709 Lays the groundwork for tackling #268 https://github.com/rust-cli/env_logger https://github.com/clap-rs/clap-verbosity-flag
More granular verbosity levels have been asked for repeatedly. To enable that we're moving to [env_logger] and [clap-verbosity-flag] to provide more flexible verbosity settings. Also tackles #661, #709 Lays the groundwork for tackling #268 https://github.com/rust-cli/env_logger https://github.com/clap-rs/clap-verbosity-flag
More granular verbosity levels have been asked for repeatedly. To enable that we're moving to [env_logger] and [clap-verbosity-flag] to provide more flexible verbosity settings. Also tackles #661, #709 Lays the groundwork for tackling #268 https://github.com/rust-cli/env_logger https://github.com/clap-rs/clap-verbosity-flag
Took a while but extended stats (successful and excluded requests) are in |
Today, the JSON output only prints (only) detailed information about the links that failed:
It will be better if JSON output will also include detailed information about the other links ("successful", "timeouts", etc.).
I'm not a Rust developer, so before I try to figure out how I can help with that, is this something that we will be accepted if will open a PR?
The text was updated successfully, but these errors were encountered: