about summary refs log tree commit diff
path: root/src/tools/linkchecker/main.rs
AgeCommit message (Collapse)AuthorLines
2025-09-08fix partial urlencoded link supportnixxo-12/+1
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs - added tests urlecoding provided by https://crates.io/crates/urlencoding
2025-07-28add --link-targets-dir flag to linkcheckerPietro Albini-25/+52
2025-07-28add an argument parser to linkcheckerPietro Albini-5/+46
2025-03-13bump html5ever to 0.28klensy-12/+12
see https://github.com/servo/html5ever/pull/548
2025-01-11Add bstr files to linkchecker since they have a Deref to sliceJosh Triplett-0/+23
The Deref brings in the documentation from slice, so it has the same issue as slice.
2024-12-30chore: fix typosHoru-1/+1
2024-10-15linkchecker: add a reminder on broken links to add new/renamed pages to ↵许杰友 Jieyou Xu (Joe)-0/+11
SUMMARY.md for mdBooks
2024-08-24update the doc comment on lintchecker b/c it parses html nowbinarycat-2/+4
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+6
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-05add `new_range_api` for RFC 3550Peter Jaszkowiak-0/+2
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the assertion is unlikely to be a problem in practice. This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum. Currently the iterators are just wrappers around the old range types, and most other trait impls delegate to the old rage types as well. Also includes an `.iter()` shorthand for `.clone().into_iter()`
2024-06-15fix build with html5ever bumpklensy-1/+1
2024-04-28Remove direct dependencies on lazy_static, once_cell and byteorderGeorge Bateman-5/+7
The functionality of all three crates is now available in the standard library.
2024-02-08Switch linkchecker to use html5ever for html parsing.Eric Huss-194/+231
The existing regex-based HTML parsing was just too primitive to correctly handle HTML content. Some books have legitimate `href="…"` text which should not be validated because it is part of the text, not actual HTML.
2023-08-06linkchecker: Remove unneeded FIXME about intra-doc linksMartin Nordholts-1/+0
It was added by 77971 but the adder proposed in that PR that the added code is a good fallback to have in case rustdoc gets buggy, and I agree. So remove the FIXME.
2023-05-14Appease lintsLucasFA-19/+16
A warning about an unnecessary drop used to appear when running the linkchecker. Also some clippy warnings
2022-11-03Remove reference from the intra-doc link checker.Eric Huss-24/+10
2022-11-03Move intra-doc link checks to a separate function.Eric Huss-6/+17
2022-08-29Ignore mailto links in linkcheckerJethro Beekman-0/+1
2022-07-25Fix some broken link fragments.Eric Huss-5/+0
2022-03-09Also take in account mdbook redirect in linkcheckerLoïc BRANSTETT-7/+13
2022-02-11linkchecker: fix panic on directory symlinksSimon Chopin-2/+3
In Debian and Ubuntu, there are some patches that change the rustc/fonts directory to a symlink to the system fonts. This triggers a latent bug in linkchecker, as the DirEntry filetype isn't a dir but later on the file itself, when opened, is one, triggering an unreachable!() clause. This patch fixes the situation by using std::fs::metadata, which goes through symlinks. I'd have added a test case but `tidy` doesn't seem to like symlinks, and moreover I'm not sure how Git deals with symlinks on Windows. Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
2021-10-22docs: Escape brackets to satisfy the linkcheckerNoah Lev-0/+2
My change to use `Type::def_id()` (formerly `Type::def_id_full()`) in more places caused some docs to show up that used to be missed by rustdoc. Those docs contained unescaped square brackets, which triggered linkcheck errors. This commit escapes the square brackets and adds this particular instance to the linkcheck exception list.
2021-09-12Fix linkcheck issuesJoshua Nelson-0/+26
Most of these are because alloc uses `#[lang_item]` to define methods, but core documents primitives before those methods are available. - Fix rustdoc-js-std test For some reason this change made CStr not show up in the results for `str,u8`. Since it still shows up for str, and since it wasn't a great match for that query anyway, I think this is ok to let slide. - Add test that all primitives can be linked to - Enable `doc(primitive)` in `core` as well - Add linkcheck exception specifically for Windows Ideally this would be done automatically by the linkchecker by replacing `\\` with forward slashes, but this PR is already a ton of work ... - Don't forcibly fail linkchecking if there's a broken intra-doc link on Windows Previously, it would exit with a hard error if a missing file had `::` in it. This changes it to report a missing file instead, which allows adding an exception.
2021-08-06Fix typo -- "The" -> "They"await Marsha-1/+1
I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
2021-06-09linkchecker: Fix bug where fragment errors printed the wrong path.Eric Huss-1/+1
2021-06-01Replace h3 and h4 containing invalid DOMGuillaume Gomez-1/+1
2021-05-24Optimize linkchecker by caching all filesystem access.Eric Huss-172/+214
This should improve performance 2-3x depending on the system.
2021-05-22linkchecker: Organize state into a struct, and add report.Eric Huss-208/+257
Moves all the state into a struct so it doesn't need to be passed around as much. Also adds a report showing how long it took and what it found. This includes a minor change: a failure to load a file is now an error, instead of being ignored. This should only happen if there is a permission error or some other shenanigans going on.
2021-04-04Bump cfgsMark Rousskov-2/+0
2021-03-10remove slice linkcheck exceptionsFrançois Mockers-5/+0
2021-02-09Stabilize str_split_onceJacob Pratt-1/+1
2021-01-17Remove unused linkcheck exceptionsJoshua Nelson-10/+1
2020-12-07Dogfood 'str_split_once() with linkcheckerEric Arellano-5/+8
2020-10-15Deny broken intra-doc links in linkcheckerJoshua Nelson-0/+62
Since rustdoc isn't warning about these links, check for them manually.
2020-09-13Ignore rustc_private items from std docsLzu Tao-0/+10
Apply suggestions from code review Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-09-04Auto merge of #75207 - dylni:add-slice-check-range, r=KodrAusbors-0/+1
Add `slice::check_range` This method is useful for [`RangeBounds`] parameters. It's even been [rewritten](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/src/librustc_data_structures/sorted_map.rs#L214) [many](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/library/alloc/src/vec.rs#L1299) [times](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/library/core/src/slice/mod.rs#L2441) in the standard library, sometimes assuming that the bounds won't be [`usize::MAX`]. For example, [`Vec::drain`] creates an empty iterator when [`usize::MAX`] is used as an inclusive end bound: ```rust assert!(vec![1].drain(..=usize::max_value()).eq(iter::empty())); ``` If this PR is merged, I'll create another to use it for those methods. [`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html [`usize::MAX`]: https://doc.rust-lang.org/std/primitive.usize.html#associatedconstant.MAX [`Vec::drain`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain
2020-08-23linkcheckr: fix clippy::redundant_static_lifetimes and ↵Matthias Krüger-7/+7
clippy::single_char_pattern
2020-08-06Fix links againdylni-0/+1
2020-07-18primitive impls are weirdManish Goregaokar-1/+1
2020-07-18Update src/tools/linkchecker/main.rsManish Goregaokar-0/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-07-18Add explicit exception list to linkcheckerManish Goregaokar-22/+40
2020-07-18Use intra-doc links on HashMapManish Goregaokar-1/+0
2020-07-18Use intra-doc links in alloc::StringManish Goregaokar-5/+1
2020-07-10Avoid "whitelist"Tamir Duberstein-3/+3
Other terms are more inclusive and precise.
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-2/+0
2020-04-26linkchecker: fix typo in main.rsUjjwal Sharma-1/+1
2020-01-01Cleanup linkchecker whitelistOliver Middleton-20/+9
linkchecker is no longer run on the compiler docs so they can be removed from the whitelist.
2019-12-22Format the worldMark Rousskov-83/+85
2019-10-21Remove `InternedString`.Nicholas Nethercote-1/+0
By using `LocalInternedString` instead for the few remaining uses.
2019-09-23Add `#![deny(warnings)]` to internal toolsAlex Crichton-0/+2