Closed
Description
Description
Hello,
When we use linters on our projects (Ansible projects), so with yammlint and ansible-lint, there is an error concerning the indentation of the .cz.yaml
file
Instead of being for example :
commitizen:
name: cz_jira
version: 1.0.0
version_files:
- commitizen/__version__.py
- pyproject.toml
It should be :
---
commitizen:
name: cz_jira
version: 1.0.0
version_files:
- commitizen/__version__.py
- pyproject.toml
https://github.com/commitizen-tools/commitizen/blob/master/tests/test_cz_customize.py#L105
With each bump, the file is "badly" indented again for the linters
Sincerely,
Steps to reproduce
- install yamllint (
pip install yamllint
)
(venv) xxx@xxxx:~/workspace/tmp/commitizen$ yamllint --version
yamllint 1.28.0
- Create
.yamllint
file with this content :
---
# Based on ansible-lint config
extends: default
- Create
.cz.yaml
file with this content :
commitizen:
name: cz_jira
version: 1.0.0
version_files:
- commitizen/__version__.py
- pyproject.toml
- Run yamllint
(venv) xxx@xxxx:~/workspace/tmp/commitizen$ yamllint .
./.cz.yaml
1:1 warning missing document start "---" (document-start)
5:3 error wrong indentation: expected 4 but found 2 (indentation)
6:19 error no new line character at the end of file (new-line-at-end-of-file)
- Fix it with
.cz.yaml
---
commitizen:
name: cz_jira
version: 1.0.0
version_files:
- commitizen/__version__.py
- pyproject.toml
Current behavior
It does not respect the yaml linters
Desired behavior
Include yamllint in ci to always have a generated .cz.yaml
or cz.yaml
file compatible with linters
Screenshots
No response
Environment
(venv) xxx@xxxx:~/workspace/tmp/commitizen$ python --version
Python 3.8.12
(venv) xxx@xxxx:~/workspace/tmp/commitizen$ python3 -c "import platform; print(platform.system())"
Linux