Skip to content

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
@marcalexiei marcalexiei deleted the feature/print-config-json branch January 22, 2024 09:53
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