-
Notifications
You must be signed in to change notification settings - Fork 7
feat: allow Hangul(korean character) in creating and renaming vfolder #59
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an option to this Trafaret, ascii_only: bool
, so that users can opt-in unicode-aware alphabets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).