feat: allow Hangul(korean character) in creating and renaming vfolder#59
feat: allow Hangul(korean character) in creating and renaming vfolder#59
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
+ Coverage 75.04% 75.07% +0.03%
==========================================
Files 19 19
Lines 2500 2504 +4
==========================================
+ Hits 1876 1880 +4
Misses 624 624
☔ View full report in Codecov by Sentry. |
achimnol
left a comment
There was a problem hiding this comment.
Let's add an option to this Trafaret, ascii_only: bool, so that users can opt-in unicode-aware alphabets.
achimnol
left a comment
There was a problem hiding this comment.
Please add the news fragment as well.
| _rx_slug_ascii_only = re.compile(r'^[\w\-_.\s]+$', re.ASCII) | ||
| _rx_slug = re.compile(r'^[\w\-_.\s]+$') |
There was a problem hiding this comment.
It additionally allows whitespaces compared to the previous version.
Please make it to stand out in the news fragment, and reflect that change in the test cases as well.
Also the code has "ascii_only" argument but the fragment says "unicode" mode -- please make them consistent.
There was a problem hiding this comment.
Let's update as follows:
Update the conditions for Slug for existing use cases:
- disallow the characters outside the regex
[\w\-.](no whitespace allowed!) - disallow consecutive dots such as
..,..., ... in any position - disallow zero-length (empty) strings
Add a new validator DirectoryNameComponent for vfolder name validation:
- disallow the characters outside the regex
[\w\s\-.](whitespace allowed!) - disallow consecutive dots such as
..,..., ... in any position - disallow zero-length (empty) strings
After This PR, the user can create the vfolder contains with Hangul(a.k.a korean character).