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

cli: add --print-config to print current configuration #858

Closed
1 of 4 tasks
kevinoid opened this issue Nov 11, 2019 · 3 comments · Fixed by #2391
Closed
1 of 4 tasks

cli: add --print-config to print current configuration #858

kevinoid opened this issue Nov 11, 2019 · 3 comments · Fixed by #2391

Comments

@kevinoid
Copy link

It would be great if the commitlint cli provided an option similar to ESLint's --print-config option to print the current configuration.

Expected Behavior

commitlint --print-config

would print the current configuration, after resolving/merging any extends, to stdout as JSON. For example, with .commitlint.config.js

module.exports = {extends: ['@commitlint/config-angular']};

it would print

{
  "rules": {
    "body-leading-blank": [1, "always"],
    "footer-leading-blank": [1, "always"],
    "header-max-length": [2, "always", 72],
    "scope-case": [2, "always", "lower-case"],
    "subject-case": [2, "never", [
      "sentence-case",
      "start-case",
      "pascal-case",
      "upper-case"
    ]],
    "subject-empty": [2, "never"],
    "subject-full-stop": [2, "never", "."],
    "type-case": [2, "always", "lower-case"],
    "type-empty": [2, "never"],
    "type-enum": [
      "build",
      "ci",
      "docs",
      "feat",
      "fix",
      "perf",
      "refactor",
      "revert",
      "style",
      "test"
   ]
  }
}

Current Behavior

I have not seen such an option mentioned.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Context

My current use case is to provide autocompletion of types and scopes from the commitlint configuration while editing commit messages.

Thanks for considering,
Kevin

@escapedcat
Copy link
Member

Hey @kevinoid, sounds like a good idea. Maybe someone is up to help out.

@kevinoid
Copy link
Author

This looks great! Thanks @armano2 and @escapedcat!

@escapedcat
Copy link
Member

All thanks goes to @armano2 ❤️
We'll do a new release soon which will include this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants