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

2.0.0 broken #49

Closed
omichelsen opened this issue Mar 12, 2015 · 10 comments
Closed

2.0.0 broken #49

omichelsen opened this issue Mar 12, 2015 · 10 comments
Assignees
Labels

Comments

@omichelsen
Copy link

After the update my config (which I just set up successfully yesterday) has broken.

My package.json looks like this:

{
    "scripts": {
      "lint": "jshint Gruntfile.js server.js app/ config/"
    },
    "pre-commit": ["lint"]
}

But the generated .validate.json looks like this:

{
  "scripts": {
    "lint": "jshint ."
  },
  "pre-commit": ["lint", "validate", "test"]
}

Furthermore there is no way to stay on version 1.0.7, since you basically added the core dependency as *. This is pretty bad versioning.

Hope you will be able to fix it, because this means I have to remove your package and/or find another way to setup my pre-commits 👎

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

I don't follow, how is this broken? The .validate.json file only provides defaults, your package.json should override them without issue. Is this not the case?

@omichelsen
Copy link
Author

No, I tried making an empty project, added the pre-commit config to package.json and ran npm install precommit-hook.

It generated the .validate.json that you see above.

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

This is expected. The .validate.json file isn't generated based on your package.json, it is a static file provided by the precommit-hook package. It provides a way of configuring default behavior for the hook without having to modify your project's existing files.

The configuration within that file is defaults only, and if you have configuration in your package.json (which you do) that will be used instead. In your case .validate.json simply becomes an extra file, which you can delete if you would prefer.

You're right, though, that the version for git-validate in the package.json should not have been *, that slipped through when I was testing and will be fixed.

@nlf nlf added the question label Mar 12, 2015
@nlf nlf self-assigned this Mar 12, 2015
@omichelsen
Copy link
Author

In that case I don't understand the wording in your readme:

A .validate.json file will also be created and leveraged by git-validate in order to run your scripts.

That sounds to me like it will be generated and used for running the scripts?

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

You're right, that's misleading. I'll clarify the documentation.

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

Does this make more sense?

A .validate.json file will also be created to provide defaults to git-validate in order to run your scripts. This configuration is only used if you have not specified your own configuration in package.json.

@omichelsen
Copy link
Author

Much clearer 👍

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

Closed via 25f1240

@nlf nlf closed this as completed Mar 12, 2015
@omichelsen
Copy link
Author

I experienced a lot of errors running my pre-commit hook after the update, but I guess that must've been something else. I can't recreate that in my test project.

Thanks :)

@nlf
Copy link
Owner

nlf commented Mar 12, 2015

Happy to help, feel free to open new issues if you run across anything you can reproduce :)

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

No branches or pull requests

2 participants