Skip to content

Commit

Permalink
Merge bitcoin#30380: lint: Ignore files ignored by git in the Markdow…
Browse files Browse the repository at this point in the history
…n Link Checker

dea7afd lint: remove unneeded trailing line fix (willcl-ark)
4d94254 lint: ignore files ignored by git in mlc (willcl-ark)

Pull request description:

  Updating to MLC v0.18.0 includes a new feature which will ignore all files ignored by git: `mlc --gitignore`.

  This helps avoid false-positives flagged by this linter in non-project files, such as a developer might expect to have in their working directory (e.g. guix-builds, python venvs, etc.)

Top commit has no ACKs.

Tree-SHA512: 1752448e0c85abd3c73570a17cc69294de2248d7773c6499833ae33806f6c03f3f345261aa7b855a557b45982fbdcb8190e758d087c43b4fb0254fbb39173432
  • Loading branch information
fanquake committed Jul 3, 2024
2 parents 173ab0c + dea7afd commit 3714692
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 2 additions & 6 deletions test/lint/test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ fn lint_markdown() -> LintResult {
"--offline",
"--ignore-path",
md_ignore_path_str.as_str(),
"--gitignore",
"--root-dir",
".",
])
Expand All @@ -419,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::<Vec<&str>>()
.join("\n");
Err(format!(
r#"
One or more markdown links are broken.
Expand All @@ -433,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 => {
Expand Down

0 comments on commit 3714692

Please sign in to comment.