Releases: Tazinho/snakecase
Releases · Tazinho/snakecase
Long standing issues
snakecase 0.11.0 (25.05.19)
Changes in 0.10.0 and 0.10.0.9000
New functionality:
- abbreviations: Abbreviations are now ...
- ... matched case-insensitive inside of groups of connected lower/upper case sequences.
- ... consistently formatted according to the supplied case.
- ... formatted exactly as supplied for the cases title, mixed, lower and upper camel.
- ... protected from the parsing. This means that
- special characters in abbreviations don't need to be taken care of anymore. The formatting of digits or special characters like hyphens, colons etc. will be formatted as specified.
- parsing_option:
- new parsing option 3 parses "SOmeNIceSTUFf".
- parsing options starting with a minus (-1, -2, -3) don't interprete non-alphanumeric characters as word boundaries. E.g. "This.text" will stay "This.text" in upper camel case.
- cases
- title: New case which should be especially useful for automatic generation of proper labels within graphics or business reports. Builds up on sentence case which is wrapped within
tools::toTitleCase()
. - random: New case, which will randomly convert letters into upper or lower case.
- title: New case which should be especially useful for automatic generation of proper labels within graphics or business reports. Builds up on sentence case which is wrapped within
- numerals: new alignment option
"tight"
which allows to suppress all underscores between numerals and letters. - sep_out:
sep_out
gets proper vectorization. In case oflength(sep_out) > 1
differing substrings are connected by the (possibly) differing elements ofsep_out
. Therefore,sep_out
gets accordingly shortened or the last element ofsep_out
gets recycled to match the number of needed separators for each element ofstring
. - UTF8 Conversion: Input is now always converted to UTF-8 and returned as UTF8. Also the
transliterations
argument is now aware of non-UTF8 encoded input.
Infrastructure:
- CII best practices badge: Achieved the criteria for the best practices badge. Current status is under https://bestpractices.coreinfrastructure.org/de/projects/2475
- R Version: Increase from 3.1 to 3.2 regarding the usage of
tools::toTitleCase()
insideto_title_case()
. - Vignettes: The blog article "Introducing the snakecase package" was added as a vignette.
- Documentation: The readme, the examples and the function documentation were updated according to the new functionality.
- Resolve CRAN notes:
- Tests: Skip
to_any_case()
tests (janitor-pkg-tests, transliterations and complex strings) when platform charset is not UTF-8 to resolve CRAN notification regarding character encoding. - Vignettes: Build the package with new version of knitr to resolve CRAN notification regarding vignette encoding.
- Tests: Skip
More options
snakecase 0.9.2
- cases: added
to_sentence_case()
(same as snake, but first letter is uppercase and default sep_out is space). - numerals: added
numerals
argument to all caseconverters includingto_any_case()
to format the alignment of digits (middle
,left
,right
,asis
). Thereforeparsing_option
nr 4 might be removed in later releases, as it is the same asparsing_option = 1
andnumerals = "asis"
. - transliterations: When named character elements are supplied as part of
transliterations
, anyting that mateches the name is replaced by the corresponding value. - attributes are now preserved (not only names as before)
Beginner friendly
sep_in
: Change default from NULL
to "[^[:alnum:]]"
. This will make it easier for beginners and in general also faster to modify cases from strings like names(iris)
. Updated the regarding sections in the vignette, docu and readme.
Roundup
- parsing_options:
- old parsing_options 3 and 4 are replaced now by new
- parsing_option 3, which suppreses case conversion around alpha numerics
- parsing_option 4, which introduces less formatting of numerals in the output,
and leaves them very close to the way that they appeared in the input strings.
- abbreviations:
- they work now more consistent with cases like lower- and upper camel case
- new converters:
- to_swap_case is new. Within to_any_case this conversion can be called also via
case = "flip"
.
- to_swap_case is new. Within to_any_case this conversion can be called also via
- removed deprecated arguments
replace_special_characters
, which is now calledtransliterations
preprocess
, which is now calledsep_in
postprocess
, which is now calledsep_out
- removed dependencies:
- purrr and magrittr are not longer dependencies
- stringr is the only dependency now (including stringi of course).
Interface simplifications
- reordering of the arguments of all
to_xxx_case()
functions - renaming
preprocess
tosep_in
,postprocess
tosep_out
,replace_special_characters
totransliterations
. Ols names are deprecated. - removed
protect
argument
CRAN update
to_xxx_case()
shortcuts are now exact wrappers aroundto_any_case()
protect
is deprecated after changing implementation and setting a reosonable default- added
abbreviations
argument case
"none" is now a lot more general for formatting- added abbreviation specific behaviour for mixed case
- new
parsing_option
5, which suppresses conversion after ., @, etc - renamig of:
to_small
/to_big_camel_case
have been renamed toto_lower
/to_upper_camel_case
. The old names are and will still be supported into_any_case()
parsingoption
toparsing_option
- introduced rule that
parsing_option
<= 0 suppresses parsing from now on - lots of additional tests and smaller bugfixes
- several documentation updates including help, examples, readme and vignette
Preserve names attribute
- Changes since last CRAN submission include:
to_any_case()
and allto_xxx_case()
shortcuts now preserve the names attribute, which can be especially handy to integrate snakecase within programmatic ggplot wrappers to automatically convert labels of a plot.
snakecase on CRAN now
Functions
to_any_case()
:- has a highly modular and logical internal design
- arguments:
string
,case
,preprocess
,protect
,replace_special_characters
,postprocess
,prefix
,postfix
,unique_sep
andempty_fill
- vectorised over string, pre-/postprocess, pre-/postfix and protect arguments
- groups of digits are not separated in between. Digits, which are not direct next to each other, will be split via "_" in both camel case versions. Otherwise information would be lost and also the consistency rules in the readme wouldn't hold in this case.
to_parsed_case_internal()
- does the preprocessing and parsing and simplifies all other functions.
- shortcuts:
to_snake_case()
,to_small_camel_case()
,to_big_camel_case()
,to_screaming_snake_case()
andto_parsed_case()
, which are equivalent toto_any_case(string, case)
.
Documentation
- githubpage contains a readme (including a logo and badges for cran status, codecoverage etc.), which describes the usage and also the design philosophy
- added a vignette
- added documentation and examples for all functions
Tests
- added systematic tests
- added integrated tests on linux via travis.ci and on windows via appveyor