mirror of
https://github.com/neovim/neovim.git
synced 2025-12-07 15:14:04 +00:00
Problem: scripts/check_urls.vim manually matches urls in the help pages and then synchronously checks them via curl/wget/powershell. This is extremely slow (~5 minutes for Nvims runtime on my machine) and prone to errors in how the urls are matched. Solution: - Use Tree-sitter to find the urls in the help pages and `vim.net.request` to check the responses. - Add a `lintdocurls` build task and check it in CI (every Friday). - Reopens a dedicated issue if it finds unreachable URLs. - Drop the old check_urls.vim script.
23 lines
690 B
Lua
Executable File
23 lines
690 B
Lua
Executable File
#!/usr/bin/env -S nvim -l
|
|
|
|
-- Validate vimdoc files on $VIMRUNTIME/doc, and test generating HTML docs.
|
|
-- Checks for duplicate/missing tags, parse errors, and invalid links/urls/spellings.
|
|
-- See also `make lintdoc`.
|
|
--
|
|
-- Usage:
|
|
-- $ nvim -l scripts/lintdoc.lua
|
|
-- $ make lintdoc
|
|
|
|
print('Running lintdoc ...')
|
|
|
|
-- gen_help_html.lua requires helptags to be generated in $VIMRUNTIME/doc.
|
|
-- :helptags also checks for duplicate tags.
|
|
-- 🤢 Load netrw so its tags are generated by :helptags.
|
|
vim.cmd [[ packadd netrw ]]
|
|
vim.cmd [[ helptags ALL ]]
|
|
|
|
require('src.gen.gen_help_html').run_validate(nil, _G.arg[1] ~= nil)
|
|
require('src.gen.gen_help_html').test_gen()
|
|
|
|
print('lintdoc PASSED.')
|