From 4d942547a8155cca4fe2f68afccdb822a174ab1a Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Tue, 2 Jul 2024 21:16:03 +0100 Subject: [PATCH 1/2] lint: ignore files ignored by git in mlc Updating to MLC v0.18.0 includes a new feature which will ignore all files ignored by git: `--gitignore`. This helps avoid false-positives flagged by this linter in non-project files, such as a developer might expect to have in their directory (e.g. guix-builds, python venvs, etc.) --- ci/lint/04_install.sh | 2 +- test/lint/test_runner/src/main.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 87e3a8fa9b1..550c7b8c920 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -58,7 +58,7 @@ curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_ tar --xz -xf - --directory /tmp/ mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ -MLC_VERSION=v0.16.3 +MLC_VERSION=v0.18.0 MLC_BIN=mlc-x86_64-linux curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc" chmod +x /usr/bin/mlc diff --git a/test/lint/test_runner/src/main.rs b/test/lint/test_runner/src/main.rs index 9c35898c1f1..cb8f3031e2e 100644 --- a/test/lint/test_runner/src/main.rs +++ b/test/lint/test_runner/src/main.rs @@ -410,6 +410,7 @@ fn lint_markdown() -> LintResult { "--offline", "--ignore-path", md_ignore_path_str.as_str(), + "--gitignore", "--root-dir", ".", ]) From dea7afd5e4c2fda7def2e06cfc44dbd617d7cdc2 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 3 Jul 2024 11:14:01 +0100 Subject: [PATCH 2/2] lint: remove unneeded trailing line fix --- test/lint/test_runner/src/main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/lint/test_runner/src/main.rs b/test/lint/test_runner/src/main.rs index cb8f3031e2e..2ba58a6da2b 100644 --- a/test/lint/test_runner/src/main.rs +++ b/test/lint/test_runner/src/main.rs @@ -420,11 +420,6 @@ fn lint_markdown() -> LintResult { Ok(output) if output.status.success() => Ok(()), Ok(output) => { let stderr = String::from_utf8_lossy(&output.stderr); - let filtered_stderr: String = stderr // Filter out this annoying trailing line - .lines() - .filter(|&line| line != "The following links could not be resolved:") - .collect::>() - .join("\n"); Err(format!( r#" One or more markdown links are broken. @@ -434,7 +429,7 @@ Relative links are preferred (but not required) as jumping to file works nativel Markdown link errors found: {} "#, - filtered_stderr + stderr )) } Err(e) if e.kind() == ErrorKind::NotFound => {