Skip to content

Add yaml support for config #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

danvergara
Copy link
Contributor

@danvergara danvergara commented Dec 8, 2020

Description

As mentioned in #314 , this PR add yaml support for configuration

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

Replace a TOML config file with a YAML config file with no side effects, (of course, passing the same arguments).

Steps to Test This Pull Request

  1. Run the tests
  2. Activate the virtual environment provided by the project/Poetry
  3. Since the yaml files are supported for configuration, try to add a new file called .cz.yaml or cz.yaml to customize Commitizen.

Additional context

Related to #314

@codecov
Copy link

codecov bot commented Dec 8, 2020

Codecov Report

Merging #315 (c09f377) into master (5486075) will increase coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
+ Coverage   96.97%   97.17%   +0.19%     
==========================================
  Files          33       35       +2     
  Lines         926      991      +65     
==========================================
+ Hits          898      963      +65     
  Misses         28       28              
Flag Coverage Δ
unittests 97.17% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/cli.py 97.50% <100.00%> (+0.13%) ⬆️
commitizen/commands/init.py 91.66% <100.00%> (+0.36%) ⬆️
commitizen/config/__init__.py 100.00% <100.00%> (ø)
commitizen/config/json_config.py 100.00% <100.00%> (ø)
commitizen/config/yaml_config.py 100.00% <100.00%> (ø)
commitizen/defaults.py 100.00% <100.00%> (ø)

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 57fe0ea...c09f377. Read the comment docs.

@woile
Copy link
Member

woile commented Dec 8, 2020

Mmmm I'm not a big fan of yaml. I don't want to support a format that is kind of weird 😅
What do you think @Lee-W ?

@danvergara
Copy link
Contributor Author

danvergara commented Dec 8, 2020

Hi @woile. I'm adding this, because my team (golang developers) ask edfor this. As Go developers we are more familiar with yaml. But it's ok, just let me know and I can address and solve another issue.

@Lee-W
Copy link
Member

Lee-W commented Dec 9, 2020

Mmmm I'm not a big fan of yaml. I don't want to support a format that is kind of weird 😅
What do you think @Lee-W ?

I'm neutral to this. I did not use YAML that much. But one of my friends (Golang developer as well haha) did ask me whether we'll have YAML support.

@danvergara danvergara marked this pull request as ready for review December 9, 2020 06:15
@woile
Copy link
Member

woile commented Dec 9, 2020

Nice, okay then there's at least some demand.
@danvergara I'll ask you to squash the commits into just a feat, something like feat: add yaml as a config option.
Otherwise I can do it, just let me know.

Thanks for the contribution 🎉

@danvergara
Copy link
Contributor Author

@woile sure, I can do that.

314

feat(config): add support for the new class YAMLConfig at the root of the confi internal package

314

test(test_config): add test support for the class YAMLConfig

314

fix(YAMLConfig): add a TypeError exception to handle in _parse_settings method

feat(init): add support for yaml config file at init

314

test(tests): add test functions to test YAMLConfig class at init and customization

314

docs(docs): add instructions on how to define yaml config files

314
@danvergara danvergara force-pushed the add-yaml-support-for-config branch from 1e1405a to c09f377 Compare December 10, 2020 05:00
@woile woile merged commit 514ff61 into commitizen-tools:master Dec 10, 2020
@Lee-W Lee-W mentioned this pull request Feb 24, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants