loganasherjones / yapconf

Yet Another Python Configuration
http://yapconf.readthedocs.io/en/stable/
MIT License
18 stars 4 forks source link

Kebab case #8

Closed loganasherjones closed 6 years ago

loganasherjones commented 6 years ago

This is to address #7

This is basically converting key names to something more sensible on the command-line and in the environment. This will also take into account spaces and the like to at least make the command-line versions of these be semi-predictable. For reference here is what accepting this change will do functionally:

Key Name Old CLI New CLI Old Env New Env
camelCase --camelCase --camel-case CAMELCASE CAMEL_CASE
snake_case --snake_case --snake-case SNAKE_CASE SNAKE_CASE
CamelGetHTTPResponse_code_snake2_dumb name -- CamelGetHTTPResponse_code_snake2_dumb name camel-get-http-response-code-snake2-dumb-name CAMELGETHTTPRESPONSE_CODE_SNAKE2_DUMB NAME CAMEL_GET_HTTP_RESPONSE_CODE_SNAKE2_DUMB_NAME

This does not affect how you access the attributes once they have been loaded, only how they are specified on the command line and in the environment.

codecov-io commented 6 years ago

Codecov Report

Merging #8 into master will increase coverage by 0.28%. The diff coverage is 97.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   95.13%   95.42%   +0.28%     
==========================================
  Files           4        4              
  Lines         576      590      +14     
  Branches      141      141              
==========================================
+ Hits          548      563      +15     
  Misses         12       12              
+ Partials       16       15       -1
Impacted Files Coverage Δ
yapconf/items.py 97.12% <97.29%> (+0.38%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e2acdcc...c3855c0. Read the comment docs.

hazmat345 commented 6 years ago

This looks neat, can it be merged?

loganasherjones commented 6 years ago

I'm working on adding flags that allows you to specify if you want to do formatting for both cli and environment variables.