[openstreetmap/openstreetmap-website] Enable erb_lint hard coded string linter (PR #6686)
Andy Allan
notifications at github.com
Wed Jan 7 19:04:10 UTC 2026
@gravitystorm commented on this pull request.
> + " ",
+ " ",
+ " ",
I don't think so. The regexp is running against the erb source code, and so the `/\s/` removes all spaces from the source code. But if the source code contains the literal 6-character sequence ` ` then it will ignore that sequence.
Anyway, all this code is copy-pasted from https://github.com/Shopify/erb_lint/blob/52b6a4df2f83e4cff18738dea2c5b4bf2f59f086/lib/erb_lint/linters/hard_coded_string.rb . I changed the class to inherit from the original i.e. `class CustomHardCodedString < HardCodedString` and then removed everything I could without breaking it. Ideally our linter would just be something like:
```ruby
class CustomHardCodedString < HardCodedString
NO_TRANSLATION_NEEDED << "·"
end
```
...but I couldn't quite figure out how to get it that minimal! So we end up with the constant in full, plus our one-line addition, plus one method that couldn't be inherited cleanly and the `include` without which it breaks too.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6686#discussion_r2669738786
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6686/review/3636400836 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260107/70b5cf38/attachment.htm>
More information about the rails-dev
mailing list