Skip to content

Commit

Permalink
formatters: new conga formatter, renamed formatters for consistency. (t…
Browse files Browse the repository at this point in the history
…alonhub#1355)

previously:
 - SLASH_SEPARATED includes a prefix slash, unlike other *_SEPARATED.

now:
 - renamed SLASH_SEPARATED to ALL_SLASHES
 - added new SLASH_SEPARATED matching *_SEPARATED behavior.
 - added new command `conga` (for 'conga line') for SLASH_SEPARATED.
  • Loading branch information
chrisosaurus authored and jaresty committed Apr 15, 2024
1 parent 4c2b1cf commit 9ce5c5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/text/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def every_word(word_func):
"SPACE_SURROUNDED_STRING": (SEP, surround(" ")),
"DOT_SEPARATED": words_with_joiner("."),
"DOT_SNAKE": (NOSEP, lambda i, word, _: "." + word if i == 0 else "_" + word),
"SLASH_SEPARATED": (NOSEP, every_word(lambda w: "/" + w)),
"ALL_SLASHES": (NOSEP, every_word(lambda w: "/" + w)),
"SLASH_SEPARATED": words_with_joiner("/"),
"CAPITALIZE_FIRST_WORD": (
SEP,
first_vs_rest(lambda w: title_case()(0, w, True)),
Expand All @@ -180,7 +181,8 @@ def every_word(word_func):
"kebab": "DASH_SEPARATED",
"packed": "DOUBLE_COLON_SEPARATED",
"padded": "SPACE_SURROUNDED_STRING",
"slasher": "SLASH_SEPARATED",
"slasher": "ALL_SLASHES",
"conga": "SLASH_SEPARATED",
"smash": "NO_SPACES",
"snake": "SNAKE_CASE",
"string": "SINGLE_QUOTED_STRING",
Expand Down

0 comments on commit 9ce5c5a

Please sign in to comment.