repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

fix(puk): add http timeouts to prevent hanging on slow network

ea2b9fe00de37b59224aade36cdabf561d5877c3

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

- find-latest-commit: add --max-time 5sec with try/catch fallback
- download-plugin: add --max-time 5sec with 10sec retry
- fix(checkhealth): use luafile print_checkhealth.lua (double vim.schedule
  to wait for deferred config modules)
- add grapple, mini.notify, opencode to puk.plugins.nuon

Changed files (4)

neovim/justfile

Modified
29 29 test-manual:
30 30 nvim -c "set rtp^=." -c "luafile tests/manual/input.lua"
32 +# lint the nvim lua config code
33 +lint:
34 + lua-language-server --check=. --checklevel=Warning
36 +# run nvim healthcheck in console
37 +checkhealth:
38 + @nvim --headless -c "luafile print_checkhealth.lua"
32 40 # run ast-grep refactoring on the neovim configuration
33 41 refac:
34 42 ast-grep scan --interactive

neovim/print_checkhealth.lua

Added
new file mode 100644
1 +-- Runs :checkhealth after all deferred config has loaded, prints to stdout.
2 +-- Double-vim.schedule ensures we run AFTER the first wave of vim.schedule
3 +-- callbacks (deferred modules, options/shell, options/win32, treesitter, etc.)
4 +vim.schedule(function()
5 + vim.schedule(function()
6 + vim.cmd('checkhealth')
7 + local buf = vim.api.nvim_get_current_buf()
8 + local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
9 + for _, line in ipairs(lines) do
10 + io.write(line .. '\n')
11 + end
12 + io.flush()
13 + vim.cmd('qa!')
14 + end)
15 +end)

neovim/puk.nu

Modified
104 104 let feed = generate-commit-feed-url $spec
105 105 let commit = match $spec.source {
106 106 github => {
107 - http get $feed | lines | parse --regex "Commit/(?<commit>[a-z0-9]+)" | first | get commit
107 + try {
108 + http get --max-time 5sec $feed |
109 + lines |
110 + parse --regex "Commit/(?<commit>[a-f0-9]+)" |
111 + first |
112 + get commit
113 + } catch {
114 + print $"Timed out or failed fetching ($spec.name), keeping current commit."
115 + $spec.commit
109 118 codeberg => { 'TODO' },
110 119 srht => { 'TODO' },
168 177 return $archive_path
170 179 let url = generate-download-url $spec
171 - http get --raw $url | save $archive_path
180 + try {
181 + http get --raw --max-time 5sec $url | save $archive_path
182 + } catch {
183 + print $"Download of ($spec.name) timed out, retrying..."
184 + http get --raw --max-time 10sec $url | save $archive_path
172 186 $archive_path

neovim/puk.plugins.nuon

Modified
12 12 github,
13 13 nvim-treesitter/nvim-treesitter,
14 14 main,
15 - "7caec274fd19c12b55902a5b795100d21531391f",
15 + "4916d6592ede8c07973490d9322f187e07dfefac",
17 17 nvim,
18 18 --headless,
53 53 github,
54 54 kylechui/nvim-surround,
55 55 main,
56 - "61319d4bd1c5e336e197defa15bd104c51f0fb29",
56 + "19e39478ccf5fa2eefdb3595af2f2927d0ff2416",
77 77 github,
78 78 "echasnovski/mini.splitjoin",
79 79 main,
80 - "8112e794cbb022b9d4b7af60b64e9896930f1697",
80 + "8bd5a3d581b9f3dd3bc91fe495e210b8b0ee981d",
85 85 github,
86 86 "echasnovski/mini.pick",
87 87 main,
88 - "fe079c2bd894a5ee70b62f23d819620ef40c4949",
88 + "fd7e7efadddcec3f3d7f3b363a99aa44e7286c65",
93 93 github,
94 94 "echasnovski/mini.extra",
95 95 main,
96 - "0ccc67319240cf8712f5f614db50c262eccd9db3",
96 + "ca1932c95c6e757c06d2cc133b87835a01d909dd",
101 101 github,
102 102 "echasnovski/mini.hipatterns",
104 - "2c5dce6dc7443de814d16f7470549811ee86e664",
104 + "a3ffba45e4119917b254c372df82e79f7d8c4aad",
109 109 github,
110 110 "echasnovski/mini.clue",
112 - "3012ba5349b2ef725c5e418a581174edc5c19dc3",
112 + "f8a11789cf34a7bae396dc0f828d06cdb5066793",
117 117 github,
118 118 "echasnovski/mini.bracketed",
120 - "75369c33613b911d1ce304475dc4d30cd255c9ed",
120 + "efb969a6a9583a5d48bfbe36363769351e38f967",
125 125 github,
126 126 "echasnovski/mini.diff",
128 - "ff3cd5e76e812fa18bde0f8126d6f3bb62008c79",
128 + "ab11575a6c147ecfba894d676d0c93e855021d34",
133 133 github,
134 134 "echasnovski/mini.jump2d",
136 - "5a37ec9d1faab7c90e8a85bba83d97ea359b6d84",
136 + "c0df3170873b712b61951781aeee9942a92ba1f1",
141 141 github,
142 142 "echasnovski/mini.move",
144 - "b8ba0b77e91b5f0fe8e014e03f7f59799dec1d96",
144 + "74d140143b1bb905c3d0aebcfc2f216fd237080e",
149 149 github,
150 150 "echasnovski/mini.icons",
152 - "5b9076dae1bfbe47ba4a14bc8b967cde0ab5d77e",
152 + "7fdae2443a0e2910015ca39ad74b50524ee682d3",
181 181 github,
182 182 chrisgrieser/nvim-rulebook,
184 - "5e8b618b8b74f6bb3ae36b3070f5e01b3964102f",
184 + "4c20ae78964cbf25333c0af141f9231c93b27566",
213 213 github,
214 214 mfussenegger/nvim-dap,
215 215 master,
216 - "2a8799ad91a1495c6bdf753f9b2179b3ff0f5bba",
216 + "4f5deb110d9ff8994d96c21df95e2271d11214f9",
221 221 github,
222 222 rcarriga/nvim-dap-ui,
223 223 master,
224 - "f5b6673f374626515401c5bc51b005f784a4f252",
224 + "d9770a55188bb34c2bdce7d90a6151181beb6966",
247 247 master,
248 248 "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6",
250 + ],
252 + grapple,
253 + github,
254 + "cbochs/grapple.nvim",
255 + main,
256 + "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7",
257 + null
258 + ],
260 + "mini.notify",
261 + github,
262 + "echasnovski/mini.notify",
263 + main,
264 + "32d3544b9368c76c562f22027ab25b750647fdf1",
265 + null
266 + ],
268 + opencode,
269 + github,
270 + "nickjvandyke/opencode.nvim",
271 + main,
272 + "fa0a495fa2c229115404cb3c1970578f9c6d2f76",
273 + null