Skip to content

Silence Ruby 4 plate regex warnings - #4

Merged
rameerez merged 2 commits into
mainfrom
fix/ruby-4-plate-regex
Aug 25, 2026
Merged

rameerez merged 2 commits into
mainfrom
fix/ruby-4-plate-regex

Conversation

@rameerez

Copy link
Copy Markdown
Collaborator

Summary

  • canonicalize two redundant character-class repeat shapes produced when lenient plate matching removes separators
  • prevent Ruby 4 nested-repeat warnings without changing the accepted language
  • add a corpus-wide regression test that compiles every derived lenient regex and rejects nested-repeat warnings
  • reconcile README model counts with the shipped 14k+ dataset

Verification

  • bundle exec rake test: 192 tests, 211,038 assertions, 0 failures/errors/skips
  • line coverage 96.2%, branch coverage 80.63%
  • full VehiclesDB web CI no longer emits the plate-regex warnings when using this commit

rameerez and others added 2 commits August 25, 2026 22:44
The README drive-by in the previous commit replaced an accurate ~17k
model count with 14k+ (the shipped dataset has 16,948 models) and left
a third spot reading ~17k, so the docs contradicted themselves. All
three now say ~17k.

The nested-repeat guard test audited filter_map(&:regex), but production
compiles strip_separators(regex_strict || regex) — 427 series have a
strict variant the test never exercised. It now audits the same source
production uses.

Also: the warning fires on every Ruby since 3.1, not only Ruby 4, so
the comments stop claiming otherwise; and the assertion is restructured
so it adds no new RuboCop offense on top of the file's pre-existing
baseline.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015jjKjr2ajZ4etdoMN6eC6k
@rameerez
rameerez merged commit 3bb4c79 into main Aug 25, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant