Skip to content
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

feat(cli): print-config now can be configured to print a json in stdout #3863

Merged
merged 1 commit into from
Jan 22, 2024
Merged

feat(cli): print-config now can be configured to print a json in stdout #3863

merged 1 commit into from
Jan 22, 2024

Conversation

marcalexiei
Copy link
Contributor

fixes #3819

Description

Now print-config cli option accept 3 possible parameters:

  • '' (empty) - same behaviour of current implementation
  • text - same behaviour of current implementation
  • json - prints a raw json

Motivation and Context

Parse the configuration from stdout

Usage examples

npx commitlint --print-config
npx commitlint --print-config=text

npx commitlint --print-config=json

How Has This Been Tested?

Unit tests have been added to @commitlint/cli/src/cli.test.ts to test all 3 scenarios.
--help test has been updated to match the new behaviour of print-config

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@escapedcat
Copy link
Member

Thanks!

@escapedcat escapedcat merged commit 6381a2d into conventional-changelog:master Jan 22, 2024
4 checks passed
@marcalexiei marcalexiei deleted the feature/print-config-json branch January 22, 2024 09:53
archoleater bot pushed a commit to archoleat/repo-template that referenced this pull request Jan 26, 2024
## [1.7.1](v1.7.0...v1.7.1) (2024-01-26)

### Bug Fixes

* **releaserc:** add more types ([#189](#189)) ([768e9a1](768e9a1))

### Code Refactoring

* **commitlint:** add `rc` file instead `ts` ([#185](#185)) ([6d36a6b](6d36a6b))
* **dependabot:** change intervals ([#181](#181)) ([e856b7e](e856b7e))
* **ecrc:** remove `releaserc` from ignore ([#178](#178)) ([5825c30](5825c30))
* **eslint:** add parser ([#186](#186)) ([dc66475](dc66475))
* **releaserc:** remove default options ([#177](#177)) ([b9fdde9](b9fdde9))
* remove `auto-merge.yml` ([#174](#174)) ([8587ca2](8587ca2))
* remove auto-approve bot ([#180](#180)) ([c3e888a](c3e888a))
* **specs:** rename `__tests__` to `specs` ([#184](#184)) ([f0e77cb](f0e77cb))

### Documentation

* **readme:** add `husky` section ([#187](#187)) ([73cd375](73cd375))

### Miscellaneous Chores

* **deps-dev:** bump @commitlint/cli from 18.4.4 to 18.5.0 ([e7bafc9](e7bafc9))
* **deps-dev:** bump @commitlint/cli from 18.4.4 to 18.5.0 ([#171](#171)) ([849143c](849143c)), closes [#3855](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3855) [#3820](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3820) [#3863](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3863) [#3819](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3819) [conventional-changelog/commitlint#3840](conventional-changelog/commitlint#3840) [conventional-changelog/commitlint#3841](conventional-changelog/commitlint#3841) [conventional-changelog/commitlint#3843](conventional-changelog/commitlint#3843) [conventional-changelog/commitlint#3864](conventional-changelog/commitlint#3864) [conventional-changelog/commitlint#3841](conventional-changelog/commitlint#3841) [conventional-changelog/commitlint#3855](conventional-changelog/commitlint#3855) [conventional-changelog/commitlint#3863](conventional-changelog/commitlint#3863) [#3863](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3863) [#3819](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3819) [#3863](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3863)
* **deps-dev:** bump @commitlint/config-conventional ([2efe80b](2efe80b))
* **deps-dev:** bump @commitlint/config-conventional from 18.4.4 to 18.5.0 ([#173](#173)) ([8555a88](8555a88)), closes [#3855](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3855) [#3820](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3820) [#3863](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3863) [#3819](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/3819) [conventional-changelog/commitlint#3840](conventional-changelog/commitlint#3840) [conventional-changelog/commitlint#3841](conventional-changelog/commitlint#3841) [conventional-changelog/commitlint#3843](conventional-changelog/commitlint#3843) [conventional-changelog/commitlint#3864](conventional-changelog/commitlint#3864) [conventional-changelog/commitlint#3841](conventional-changelog/commitlint#3841) [conventional-changelog/commitlint#3855](conventional-changelog/commitlint#3855) [conventional-changelog/commitlint#3863](conventional-changelog/commitlint#3863)
* **deps-dev:** bump @types/node from 20.11.5 to 20.11.6 ([e3f52f5](e3f52f5))
* **deps-dev:** bump @types/node from 20.11.5 to 20.11.6 ([#179](#179)) ([64e0f6c](64e0f6c))
* **deps-dev:** bump @typescript-eslint/eslint-plugin ([59990aa](59990aa))
* **deps-dev:** bump @typescript-eslint/eslint-plugin from 6.19.0 to 6.19.1 ([#170](#170)) ([573e0fd](573e0fd)), closes [#8235](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/8235) [#8237](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/8237) [#8237](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/8237)
* **deps-dev:** bump @typescript-eslint/parser from 6.19.0 to 6.19.1 ([1e1cc8e](1e1cc8e))
* **deps-dev:** bump @typescript-eslint/parser from 6.19.0 to 6.19.1 ([#172](#172)) ([71e3e2b](71e3e2b)), closes [#8235](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/8235) [#8237](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/8237)
* **deps-dev:** bump husky from 8.0.3 to 9.0.1 ([c3ec6c4](c3ec6c4))
* **deps-dev:** bump husky from 8.0.3 to 9.0.1 ([#182](#182)) ([f79710f](f79710f)), closes [#1333](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/1333) [#1290](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/1290) [#1320](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/1320) [#1282](https://github.com/Conqueror-Site-Builder/conqueror-repo-template/issues/1282)
* **deps:** update ([#188](#188)) ([729596f](729596f))

### Continuous Integration

* add auto-approve bot ([#176](#176)) ([8c3ea59](8c3ea59))
* rename steps ([#175](#175)) ([8699ab2](8699ab2))
* rewrite workflows ([#183](#183)) ([d0a210c](d0a210c))
* sort properties ([#169](#169)) ([7aa251a](7aa251a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

feat: have --print-config output valid JSON data
2 participants