doc/development/documentation/testing/links.md
For testing:
haml-lint, eslint, and rubocop.To run the relative link test locally, you can either:
To check the links on a single project:
lychee --offline --include-fragments <doc_directory>, where <doc_directory> is the directory that contains
documentation to check. For example: lychee --offline --include-fragments doc.To check links on the entire GitLab documentation site:
docs-gitlab-com clone. You can
run make clone-docs-projects to clone any projects you don't have in that location.docs-gitlab-com directory.hugo, which builds the GitLab Docs site.lychee --offline public to check links.To test documentation links from GitLab code files locally, you can run:
eslint: For frontend (.js and .vue) files.rubocop: For .rb and .haml files.eslint testsOpen the gitlab directory in a terminal window.
Run:
scripts/frontend/lint_docs_links.mjs
If you receive an error the first time you run this test, run yarn install, which
installs the dependencies for GitLab, and try again.
rubocop testsOpen the gitlab directory in a terminal window.
To run the check on all Ruby files:
rubocop --only Gitlab/DocumentationLinks/Link
To run the check on a single Ruby file:
rubocop --only Gitlab/DocumentationLinks/Link path/to/ruby/file.rb