Skip to content

Preset support missing #8

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

Closed
jmendiara opened this issue Jul 15, 2016 · 4 comments
Closed

Preset support missing #8

jmendiara opened this issue Jul 15, 2016 · 4 comments

Comments

@jmendiara
Copy link

jmendiara commented Jul 15, 2016

While trying to use jshint preset:

$ conventional-changelog-lint -e -p jshint
/Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/distribution/cli.js:163
        throw error;
        ^

Error: Cannot find module 'conventional-changelog-jshint'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/distribution/library/get-preset.js:11:16
    at next (native)
    at step (/Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/distribution/library/get-preset.js:7:191)
    at /Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/distribution/library/get-preset.js:7:451
    at new Promise (/Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/node_modules/babel-polyfill/node_modules/core-js/modules/es6.promise.js:197:7)
    at /Users/javier/Documents/Proyectos/conventest/node_modules/conventional-changelog-lint/distribution/library/get-preset.js:7:99

After installing the module conventional-changelog-jshint (it's not in the doc that this should be done) it seems it's still using the angular one.

$ conventional-changelog-lint -e -p jshint
⧗   input: [[CHORE]] Dependencies setup
✖   message may not be empty [subject-empty]
✖   message may not end with full stop [subject-full-stop]
✖   type may not be empty [type-empty]
✖   type must be one of ["chore", "docs", "feat", "fix", "perf", "refactor", "style", "test"] [type-enum]
✖   found 4 problems, 0 warnings
@marionebl
Copy link
Contributor

marionebl commented Jul 15, 2016

Hey @jmendiara,

thanks for your report! I added a documentation label because the distinction between conventional-changelog presets and shareable conventional-changelog-lint configuration appears to be unclear and/or difficult.

By default the angular preset and shareable config is used. When specifying the -p flag you change the preset setting but leave the shareable config setting alone.

The distinction between them is:

  1. Presets are fed into conventional-changelog and are solely used to provide the necessary parsing patterns for the strings in commit messages.
  2. Shareable configs hold the rule definitions for the actual linting. You can find documentation about supported rules here: https://github.com/marionebl/conventional-changelog-lint/blob/master/documentation/rules.md#rules

This means in order to fully support the jshint commit message convention you'll have to:

  1. Create a (shareable) conventional-changelog-configuration. This could be a shareable npm package or a local .conventional-changelog-lintrc file. See conventional-changelog-lint-config-angular for reference.
  2. If using a shareable npm package, you'll have to install it and specify it with the -x --extends flag. .conventional-changelog-lintrc is picked up automatically.

@jmendiara
Copy link
Author

Thank you for the clarification and your work!

Just some feedback: It'd be nice to have the same API/installation process than conventional-changelog-cli: just install this module and conventional-changelog-lint -e -p jshint just works for the supported conventional-changelog presets (as it already does for angular)

easy installation + easy setup = happy devs && high adoption 😄

@marionebl
Copy link
Contributor

I plan to remove the default angular shareable config in the next release and won't include additional configurations in the core install – that would put the burden to actually define and maintain these on me although I am not using them. I'd favor an approach where it is easy to grasp what the actual problem is. So

  1. Providing neither .rules in .conventional-changelog-lintrc nor .extends via cli will yield an error about missing configuration
  2. Providing .extends while the extended config is not in package.json will yield an error containing copy-and-pasteable install instructions

@marionebl marionebl mentioned this issue Jul 8, 2017
26 tasks
@marionebl
Copy link
Contributor

This should be clarified now as preset is no user-facing option as of version 3.

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

No branches or pull requests

2 participants