Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatrin Leinweber <kleinweber@gitlab.com>2023-10-18 15:46:59 +0300
committerKatrin Leinweber <kleinweber@gitlab.com>2023-11-20 18:49:06 +0300
commiteb4e430a05b0e55783757546d9ab9e841c02ae82 (patch)
tree63eb5b21e8a034c6c5e0f61e21ed962e166519f9
parent8fae950d1ac2bd2eeab50fc2107db6dcde1815a1 (diff)
Remove parent folders that diverges from source1723-trim-tmp-path
The error output does not need the entire absolute path, which is of dubious use when pasted from a CI log. It's the relative file path that should be easy to copy-paste.
-rw-r--r--lib/checks/anchors.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/checks/anchors.rb b/lib/checks/anchors.rb
index 7703983d..701c74a2 100644
--- a/lib/checks/anchors.rb
+++ b/lib/checks/anchors.rb
@@ -10,9 +10,11 @@ Nanoc::Check.define(:internal_anchors) do
next unless link.destination_anchor_not_found?
+ parents_path = %r{/.+/(gitlab-docs/)?public/}
+
add_issue <<~ERROR
Broken anchor detected: `##{link.anchor_name}`
- - source file `#{link.source_file}`
+ - source file `#{link.source_file.sub(parents_path, '')}`
- destination `#{link.href}`
ERROR
end