From e00cdbf1aefca49a307186ca8b72dd7f88c993d2 Mon Sep 17 00:00:00 2001 From: Matthias Endler Date: Sun, 21 Feb 2021 16:33:33 +0100 Subject: [PATCH] example.com -> example.org --- .github/workflows/links.yml | 6 +-- README.md | 2 +- fixtures/TEST.md | 8 ++-- fixtures/TEST_HTML5.html | 8 ++-- fixtures/TEST_HTML5_CUSTOM_ELEMENTS.html | 6 +-- fixtures/TEST_HTML5_LOWERCASE_DOCTYPE.html | 2 +- fixtures/TEST_HTML5_MALFORMED_LINKS.html | 6 +-- fixtures/TEST_HTML5_MINIFIED.html | 2 +- src/bin/lychee/options.rs | 2 +- src/bin/lychee/stats.rs | 10 ++--- src/extract.rs | 48 +++++++++++----------- src/uri.rs | 12 +++--- 12 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index a1820d3..bd088d5 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - + - name: Link Checker uses: lycheeverse/lychee-action@master with: - args: --exclude https://example.com/README.md - + args: --exclude 'https://example.org/README.md' + - name: Create Issue From File uses: peter-evans/create-issue-from-file@v2 with: diff --git a/README.md b/README.md index f6c53d6..80676e1 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ OPTIONS: ARGS: ... The inputs (where to get links to check from). These can be: files (e.g. `README.md`), file globs - (e.g. `"~/git/*/README.md"`), remote URLs (e.g. `https://example.com/README.md`) or standard + (e.g. `"~/git/*/README.md"`), remote URLs (e.g. `https://example.org/README.md`) or standard input (`-`). Prefix with `--` to separate inputs from options that allow multiple arguments [default: README.md] ``` diff --git a/fixtures/TEST.md b/fixtures/TEST.md index 81eff74..90c7f5c 100644 --- a/fixtures/TEST.md +++ b/fixtures/TEST.md @@ -16,10 +16,10 @@ Some more complex formatting to test that Markdown parsing works. [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/) Test HTTP and HTTPS for the same site. -http://example.com -https://example.com +http://example.org +https://example.org https://www.peerlyst.com/posts/a-list-of-static-analysis-tools-for-c-c-peerlyst -test@example.com -mailto:test2@example.com +test@example.org +mailto:test2@example.org diff --git a/fixtures/TEST_HTML5.html b/fixtures/TEST_HTML5.html index f9ff015..b6ae28d 100644 --- a/fixtures/TEST_HTML5.html +++ b/fixtures/TEST_HTML5.html @@ -2,13 +2,13 @@ - + Test - + @@ -16,8 +16,8 @@ Hello world. - Link in body + Link in body -
+
diff --git a/fixtures/TEST_HTML5_CUSTOM_ELEMENTS.html b/fixtures/TEST_HTML5_CUSTOM_ELEMENTS.html index c9464c2..31ede82 100644 --- a/fixtures/TEST_HTML5_CUSTOM_ELEMENTS.html +++ b/fixtures/TEST_HTML5_CUSTOM_ELEMENTS.html @@ -3,8 +3,8 @@ - - - + + + diff --git a/fixtures/TEST_HTML5_LOWERCASE_DOCTYPE.html b/fixtures/TEST_HTML5_LOWERCASE_DOCTYPE.html index 1418934..58ae7b3 100644 --- a/fixtures/TEST_HTML5_LOWERCASE_DOCTYPE.html +++ b/fixtures/TEST_HTML5_LOWERCASE_DOCTYPE.html @@ -3,6 +3,6 @@ - Link in body + Link in body diff --git a/fixtures/TEST_HTML5_MALFORMED_LINKS.html b/fixtures/TEST_HTML5_MALFORMED_LINKS.html index 76c2061..ee40f66 100644 --- a/fixtures/TEST_HTML5_MALFORMED_LINKS.html +++ b/fixtures/TEST_HTML5_MALFORMED_LINKS.html @@ -3,8 +3,8 @@ - Malformed link - Malformed link - Valid link + Malformed link + Malformed link + Valid link diff --git a/fixtures/TEST_HTML5_MINIFIED.html b/fixtures/TEST_HTML5_MINIFIED.html index 84c8673..4651593 100644 --- a/fixtures/TEST_HTML5_MINIFIED.html +++ b/fixtures/TEST_HTML5_MINIFIED.html @@ -1 +1 @@ -
+
diff --git a/src/bin/lychee/options.rs b/src/bin/lychee/options.rs index 5227d0e..f72b941 100644 --- a/src/bin/lychee/options.rs +++ b/src/bin/lychee/options.rs @@ -83,7 +83,7 @@ macro_rules! fold_in { pub(crate) struct LycheeOptions { /// The inputs (where to get links to check from). /// These can be: files (e.g. `README.md`), file globs (e.g. `"~/git/*/README.md"`), - /// remote URLs (e.g. `https://example.com/README.md`) or standard input (`-`). + /// remote URLs (e.g. `https://example.org/README.md`) or standard input (`-`). /// Prefix with `--` to separate inputs from options that allow multiple arguments. #[structopt(name = "inputs", default_value = "README.md")] raw_inputs: Vec, diff --git a/src/bin/lychee/stats.rs b/src/bin/lychee/stats.rs index de53eaa..43ffb23 100644 --- a/src/bin/lychee/stats.rs +++ b/src/bin/lychee/stats.rs @@ -116,17 +116,17 @@ mod test_super { fn test_stats() { let mut stats = ResponseStats::new(); stats.add(Response { - uri: website("http://example.com/ok"), + uri: website("http://example.org/ok"), status: Status::Ok(http::StatusCode::OK), source: Input::Stdin, }); stats.add(Response { - uri: website("http://example.com/failed"), + uri: website("http://example.org/failed"), status: Status::Failed(http::StatusCode::BAD_GATEWAY), source: Input::Stdin, }); stats.add(Response { - uri: website("http://example.com/redirect"), + uri: website("http://example.org/redirect"), status: Status::Redirected(http::StatusCode::PERMANENT_REDIRECT), source: Input::Stdin, }); @@ -135,12 +135,12 @@ mod test_super { Input::Stdin, vec![ Response { - uri: website("http://example.com/failed"), + uri: website("http://example.org/failed"), status: Status::Failed(http::StatusCode::BAD_GATEWAY), source: Input::Stdin, }, Response { - uri: website("http://example.com/redirect"), + uri: website("http://example.org/redirect"), status: Status::Redirected(http::StatusCode::PERMANENT_REDIRECT), source: Input::Stdin, }, diff --git a/src/extract.rs b/src/extract.rs index a5be89e..b6f7202 100644 --- a/src/extract.rs +++ b/src/extract.rs @@ -289,7 +289,7 @@ mod test { #[test] fn test_non_markdown_links() { let input = - "https://endler.dev and https://hello-rust.show/foo/bar?lol=1 at test@example.com"; + "https://endler.dev and https://hello-rust.show/foo/bar?lol=1 at test@example.org"; let links: HashSet = extract_links(&InputContent::from_string(input, FileType::Plaintext), None) .into_iter() @@ -299,7 +299,7 @@ mod test { let expected = [ website("https://endler.dev"), website("https://hello-rust.show/foo/bar?lol=1"), - Uri::Mail("test@example.com".to_string()), + Uri::Mail("test@example.org".to_string()), ] .iter() .cloned() @@ -330,11 +330,11 @@ mod test { .collect(); let expected_links = [ - website("https://example.com/head/home"), - website("https://example.com/css/style_full_url.css"), + website("https://example.org/head/home"), + website("https://example.org/css/style_full_url.css"), // the body links wouldn't be present if the file was parsed strictly as XML - website("https://example.com/body/a"), - website("https://example.com/body/div_empty_a"), + website("https://example.org/body/a"), + website("https://example.org/body/div_empty_a"), ] .iter() .cloned() @@ -348,21 +348,21 @@ mod test { let input = load_fixture("TEST_HTML5.html"); let links: HashSet = extract_links( &InputContent::from_string(&input, FileType::Html), - Some(Url::parse("https://example.com").unwrap()), + Some(Url::parse("https://example.org").unwrap()), ) .into_iter() .map(|r| r.uri) .collect(); let expected_links = [ - website("https://example.com/head/home"), - website("https://example.com/images/icon.png"), - website("https://example.com/css/style_relative_url.css"), - website("https://example.com/css/style_full_url.css"), - website("https://example.com/js/script.js"), + website("https://example.org/head/home"), + website("https://example.org/images/icon.png"), + website("https://example.org/css/style_relative_url.css"), + website("https://example.org/css/style_full_url.css"), + website("https://example.org/js/script.js"), // the body links wouldn't be present if the file was parsed strictly as XML - website("https://example.com/body/a"), - website("https://example.com/body/div_empty_a"), + website("https://example.org/body/a"), + website("https://example.org/body/div_empty_a"), ] .iter() .cloned() @@ -381,7 +381,7 @@ mod test { .map(|r| r.uri) .collect(); - let expected_links = [website("https://example.com/body/a")] + let expected_links = [website("https://example.org/body/a")] .iter() .cloned() .collect(); @@ -400,11 +400,11 @@ mod test { .collect(); let expected_links = [ - website("https://example.com/"), - website("https://example.com/favicon.ico"), + website("https://example.org/"), + website("https://example.org/favicon.ico"), website("https://fonts.externalsite.com"), - website("https://example.com/docs/"), - website("https://example.com/forum"), + website("https://example.org/docs/"), + website("https://example.org/forum"), ] .iter() .cloned() @@ -424,7 +424,7 @@ mod test { .collect(); let expected_links = [Uri::Website( - Url::parse("https://example.com/valid").unwrap(), + Url::parse("https://example.org/valid").unwrap(), )] .iter() .cloned() @@ -444,10 +444,10 @@ mod test { .collect(); let expected_links = [ - website("https://example.com/some-weird-element"), - website("https://example.com/even-weirder-src"), - website("https://example.com/even-weirder-href"), - website("https://example.com/citations"), + website("https://example.org/some-weird-element"), + website("https://example.org/even-weirder-src"), + website("https://example.org/even-weirder-href"), + website("https://example.org/citations"), ] .iter() .cloned() diff --git a/src/uri.rs b/src/uri.rs index 5834a5e..9e2b271 100644 --- a/src/uri.rs +++ b/src/uri.rs @@ -74,16 +74,16 @@ mod test { fn test_uri_from_str() { assert!(matches!(Uri::try_from(""), Err(_))); assert_eq!( - Uri::try_from("http://example.com").unwrap(), - website("http://example.com") + Uri::try_from("http://example.org").unwrap(), + website("http://example.org") ); assert_eq!( - Uri::try_from("mail@example.com").unwrap(), - Uri::Mail("mail@example.com".to_string()) + Uri::try_from("mail@example.org").unwrap(), + Uri::Mail("mail@example.org".to_string()) ); assert_eq!( - Uri::try_from("mailto:mail@example.com").unwrap(), - Uri::Mail("mail@example.com".to_string()) + Uri::try_from("mailto:mail@example.org").unwrap(), + Uri::Mail("mail@example.org".to_string()) ); }