[openstreetmap/openstreetmap-website] Fix new Herb warning (PR #6914)

Marco Roth notifications at github.com
Thu Mar 19 16:23:50 UTC 2026


marcoroth left a comment (openstreetmap/openstreetmap-website#6914)

Hey @hlfan and @gravitystorm, the idea was that we can provide some hints to developers to signal that they have duplicated/identical code across all branches and that there might be an opportunity for a refactoring.

If we can 100% detect that there is duplicated code that can be moved out of a conditional without any side effects we mark it as "warning" and provide an autofix for it. 

But for the cases where we cannot automatically rewrite it we record it as a hint and show that in the editor with a subtle "hint". These hints shouldn't fail the build, but should at least visually tell you that there is potential for deduplication.

For context, here is how the hints look in VS Code:

<img width="2000" height="812" alt="CleanShot 2026-03-19 at 17 21 35 at 2x" src="https://github.com/user-attachments/assets/0a2c4f57-6090-493b-a714-41c1a96e7937" />


I understand that some of these might be a bit too aggressive, so I'm happy to hear what you would expect, as the idea is to help and steer people to write better views, not to annoy them with Linter warnings.

Do you expect the hints to just show up in the IDE and not in the lint CLI output? I'm more than happy to adjust the current approach, as Herb is a community-driven project. Thank you! 🙌🏼 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6914#issuecomment-4091433473
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6914/c4091433473 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260319/f6636973/attachment.htm>


More information about the rails-dev mailing list