https://codeberg.org/forgejo/forgejo/pulls/12283
Someone asking you to write a test for new code and then making this blog in response is just so pathetic.
https://codeberg.org/forgejo/forgejo/pulls/12283
Someone asking you to write a test for new code and then making this blog in response is just so pathetic.
per the response: "I'm not sure what kind of test would you like me to write for this change, as it's simply adding 4 quotes"
- <a class="item muted sidebar-item-link" href=${$(this).data('href')}>
+ <a class="item muted sidebar-item-link" href="${$(this).data('href')}">
I know zero about this code path, but suppose it's expected that `${$(this).data('href')}` is already a properly quoted value, like `"https://example.com"`. Then the first line expands to: <a class="item muted sidebar-item-link" href="https://example.com">
and the second expands to: <a class="item muted sidebar-item-link" href=""https://example.com"">
which would have all kinds of room for mischief. Or suppose the template engine auto-quotes values that it injects, so the quotes aren't necessary at all, which is a pretty common approach. The point is that you don't randomly want to throw quotes into HTML or single quotes into SQL just for giggles. You have to write tests demonstrating that the existing common use cases still work after the change, even if it's simply adding 4 quotes. foo onclick
the following shouldn't render: <a class="item muted sidebar-item-link" href=foo onclick>
The following should: <a class="item muted sidebar-item-link" href="foo onclick">One way is for the PR maker to signal their own attention to detail/effort/commitment by jumping through the (quite reasonable) hoop of writing a test.
Is this extra effort? Yes. But if your motivation in opening the PR in the first place is genuinely to improve the world, then do the slightly harder thing that actually improves the world given the constraints on maintainer attention it operates under, not the thing that is slightly easier for you but leaves your contribution indistinguishable from the sea of slop out there.