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
Finding extra package.json files #45
Comments
what if i added a config field to package.json so you could do something like
and any packages found in the 'build' directory (which would be a direct child of the current directory, i'd just use |
That sounds like a great solution. Thank you! |
This solution would only be suboptimal. Since I git-validate is used to create modules that configure your project to use hooks, the module can't know upfront what to ignore. |
My suggestion to look for package.json: local projects;
projects=$(find . -maxdepth 1 -name package.json -print 2>/dev/null)
if [[ $? -ne 0 ]]; then
projects=$(find . -not -iwholename '*node_modules*' -not -iwholename '*bower_components*' -maxdepth 3 -name package.json -print 2>/dev/null)
fi
if [[ $? -ne 0 ]]; then
projects=$(find . -not -ipath '*node_modules*' -not -ipath '*bower_components*' -maxdepth 3 -name package.json -print 2>/dev/null)
fi If you don't find a package.json at the root level continue to dig deeper. |
thinking about using thoughts? |
noting that i'll still filter out |
@nlf Any update on this issue? |
In my project we run all the code through a build process that dumps the output into a
build
directory off the project root. This directory is happily git ignored and all.However, if I'm reading it right, because
find
is recursive (https://github.com/nlf/git-validate/blob/master/bin/validate.sh#L339), it picks up this otherpackage.json
and tries to run the validations from within that build directory. This leads to failures due to missing dependencies, which I expect. I don't want to run the validations against the build directory.I'm not entirely sure what the best approach to fixing this would be. I assume there's a reason why
max-depth
of 1 wouldn't be appropriate, but at the same time, I'd rather not delete my build just to lint my project. I'm not sure this is even a "bug" withgit-validate
.Do you have any guidance on this? I'd hate to add another config file to the project's root. I suppose I could move the build directory outside of the project, but I like everything being self-contained as well.
The text was updated successfully, but these errors were encountered: