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

Load config-conventional in absence of user configuration #260

Open
marionebl opened this issue Jan 31, 2018 · 5 comments
Open

Load config-conventional in absence of user configuration #260

marionebl opened this issue Jan 31, 2018 · 5 comments

Comments

@marionebl
Copy link
Contributor

In the lieu of a "zero configuration" movement in the wider JS tooling community we should evaluate if the inital obligatory configuration step for commitlint could be omitted.

Expected Behavior

  • Load @commitlint/config-conventional if no user configuration was found
  • Do not merge user configuration onto @commitlint/config-conventional if found

Current Behavior

  • No configuration is loaded if no user configuration is provided
  • Running commitlint without configuration lets every commit message pass

Considerations

  • Should be considered a breaking change, consumers might depend on the "pass through" behaviour of unconfigured commitlint
@marionebl marionebl changed the title Install and load config-conventional by default Load config-conventional in absence of user configuration Jan 31, 2018
@marionebl
Copy link
Contributor Author

@escapedcat
Copy link
Member

I think this can be closed in favour of #48 . And as you pointed out with #107 commitlints now throws an error on missing config.

@byCedric
Copy link
Member

Yes, I'd also like this, especially when we are using the GitHub Actions. I tested a bare-minimum setup for actions, and well, with this change we can actually use it on every type of repository. I mean for GoLang, Ruby or other projects this could be great!

@byCedric
Copy link
Member

I've got a couple of edge cases here I think. What should happen if...

  1. ... the user doesn't provide any configuration (not through CLI or config/package files).
  2. ... the user only provides rules/formatters/flags in configuration.
  3. ... the user only provides rules/formatters/flags in cli.

I think case 1 is fairly simple, it should load conventional config. But cases 2 and 3 might be a bit harder. The way I see it, the conventional should only load for option 1 and 3. When the user specifies a configuration, it should not change that by any means. But might be that some users expect this anyway. But that could be fixed by good documentation of course.

@byCedric
Copy link
Member

byCedric commented Mar 24, 2019

Ok, got something working for @commitlint/load. Just to check on some assumptions I made.

  1. Is it ok to load it in this package? I mean, that's the place where we can differentiate "no config provided at all" as opposed to "no extends found, add conventional" (in @commitlint/cli.

  2. When I load @commitlint/config-conventional in @commitlint/load it throws an error that it could not find this package. Even after I add this as a dependency of the load package. I guess my only plausible solution for this is creating an absolute/relative path to the nested conventional package in node_modules, or am I missing something else?

@byCedric byCedric self-assigned this May 25, 2019
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.

3 participants