feat: regex for counter validation#497
Conversation
|
@benoit74 please take a look, suggest some additional testcases if necessary as well :) |
|
I really doubt you took any inspiration for bad mimetype values from openzim/libzim#1000, please take a closer look |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
=======================================
Coverage 27.68% 27.68%
=======================================
Files 26 26
Lines 2348 2348
Branches 1282 1282
=======================================
Hits 650 650
Misses 1257 1257
Partials 441 441 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@benoit74 I went through the convo again, the regex remains unchanged but is now validated by more test cases right from the issue. Also, I agree with you on stripping the MIME type params. Please take a look at this, and I can open an issue, make a pr for counterHandler.h ? |
|
@kelson42 I feel like a more experience C++ person should review this as well, who?
You mean in libzim right? Yes, please propose a PR as well. We should deploy both zim-tools and libzim changes in a coordinated manner if we do not want to many failures in zimcheck due to libzim not cleaning things correctly |
veloman-yunkan
left a comment
There was a problem hiding this comment.
Thanks for the contribution! It looks good to me, but I chose to outline possible ways to improve it just in case. Please feel free to leave the PR as is.
|
@veloman-yunkan please take a look, the changes should be up. Also @benoit74, I don't think this is the right place for it but I just noticed that : The documentation here, mentions this exact bug as well.
For the string "में" (Hindi): Do you think this is worth the rewrite? Seems like only one function should be modified. |
|
I've opened #498 for the grapheme issue |
veloman-yunkan
left a comment
There was a problem hiding this comment.
Also please squash all your changes so that this PR consists of a single commit.
Signed-off-by: Pranavjeet-Naidu <pranavjeetnaidu@gmail.com>
1892417 to
5c62ae5
Compare
|
@veloman-yunkan I've added the tests and squashed as well, please take a look |
|
@Pranavjeet-Naidu Thank you very much for your succesfuly merged PR! |
Solves #473
The added regex also has tests that validate it, have been run locally and verified.
( inspiration taken from openzim/libzim#1000 as well ).
I didn't notice a contributions.md so please let me know if any changes in formatting are needed.