Commit 6385b78
authored
builtin: fix
* builtin: fix camel_to_snake() underscore placement in uppercase runs
When an uppercase run transition to a lowercase letter, the underscore
was placed after the run instead of before its last letter:
HTMLParser => html_parser (was: htmlp_arser)
XMLToJSON => xml_to_json (was: xmlt_o_json)
getHTTPSURL => get_https_url (was: get_httpsu_rl)
LastNName => last_n_name (was: last_nn_ame)
The fix shifts the last uppercase character forward one slot and inserts
'_' before it, treating the last uppercase of a run as the start of the
next word, Python's inflection, and libraries.
Update existing test expectations and identifier cases.
* fix: fix identation
* fix: fix camel_to_snake regression for uppercase runs followed by digits
* fix(builtin): split acronym boundary in camel_to_snake
* v fmt
* fix: adjust examples for correct doc generation
* feat: handle http2_server edge casecamel_to_snake underscore placement in uppercase runs (#26634)1 parent 2f13152 commit 6385b78
2 files changed
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2167 | 2167 | | |
2168 | 2168 | | |
2169 | 2169 | | |
2170 | | - | |
| 2170 | + | |
2171 | 2171 | | |
2172 | 2172 | | |
2173 | 2173 | | |
| |||
2844 | 2844 | | |
2845 | 2845 | | |
2846 | 2846 | | |
2847 | | - | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
2848 | 2850 | | |
2849 | 2851 | | |
2850 | 2852 | | |
| |||
2858 | 2860 | | |
2859 | 2861 | | |
2860 | 2862 | | |
| 2863 | + | |
2861 | 2864 | | |
2862 | 2865 | | |
2863 | 2866 | | |
| |||
2884 | 2887 | | |
2885 | 2888 | | |
2886 | 2889 | | |
| 2890 | + | |
2887 | 2891 | | |
2888 | 2892 | | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
2889 | 2909 | | |
2890 | 2910 | | |
2891 | 2911 | | |
2892 | 2912 | | |
2893 | | - | |
| 2913 | + | |
2894 | 2914 | | |
2895 | 2915 | | |
2896 | 2916 | | |
| |||
2905 | 2925 | | |
2906 | 2926 | | |
2907 | 2927 | | |
| 2928 | + | |
2908 | 2929 | | |
2909 | 2930 | | |
2910 | 2931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
| 1670 | + | |
1670 | 1671 | | |
1671 | 1672 | | |
1672 | 1673 | | |
| |||
1677 | 1678 | | |
1678 | 1679 | | |
1679 | 1680 | | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1680 | 1684 | | |
1681 | 1685 | | |
1682 | 1686 | | |
| |||
0 commit comments