You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add option to pass additional dependencies to hooks #293
I am currently working on implementing this framework and one of the things I am trying to run is eslint. As part of that I have a number of plugins that are in my configuration file. I think that, rather than forcing anyone who is using plugins to create a new hook definition with a corresponding package.json it might be useful to add a global option to pass a list of dependencies in the configuration file.
and have those dependencies installed into the generated environment for that language.
I am going to work on implementing this in my forked repo but would like feedback on whether this is a desired feature or any implementation advice on how best to facilitate this.
My guess is when i have a node hook with additional dependency, you do npm install of the dependency. Instead of doing that can i specify the location where this dependency can be found.
say i have a hook with additional dependency as eslint-google. Now instead of doing npm install eslint-google if it finds a file path let it use it.
The arguments in additional_dependencies are indeed passed to npm install ... -- whatever npm install takes will technically function. It might not be the best idea to include repository-specific state in there as it will be cached for all instances of that hook (with identical configuration).
My idea was to keep my package.json versions of these in sync with what's mentioned in dependency But if you think this is not a good idea i will drop it. Thanks for the info though
Activity
asottile commentedon Nov 18, 2015
Sounds pretty reasonable, how about
additional_dependenciesinstead ofdependencies?This would actually be a nice way to replace the wacky mirrors repos!
blarghmatey commentedon Nov 18, 2015
Yeah, that's reasonable. I'll update. I'm currently working on fixing broken tests and adding some to cover the new functionality.
asottile commentedon Nov 18, 2015
Sounds great 👍
asottile commentedon Nov 23, 2015
Via #295
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Fix appveyor and windows. Resolves #293
Merge pull request #302 from pre-commit/fix_appveyor_and_windows
asottile commentedon Nov 24, 2015
derp, those commits referencing this are incorrect. That should say #294
awebdeveloper commentedon May 7, 2017
@asottile can additional deps be files inside node_modules in case of node instead of a full npm install
asottile commentedon May 7, 2017
I'm not sure what you mean?
awebdeveloper commentedon May 8, 2017
My guess is when i have a node hook with additional dependency, you do
npm installof the dependency. Instead of doing that can i specify the location where this dependency can be found.say i have a hook with additional dependency as
eslint-google. Now instead of doingnpm install eslint-googleif it finds a file path let it use it.asottile commentedon May 8, 2017
I don't think that's how
require(...)works?I think what you're reaching for is a (discouraged)
systemhook.awebdeveloper commentedon May 8, 2017
I aint asking for system hook
Couldn't it copy this folder over to the place. I hope these packages are installed via
npm install? If so i can install a local folderasottile commentedon May 8, 2017
The arguments in
additional_dependenciesare indeed passed tonpm install ...-- whatevernpm installtakes will technically function. It might not be the best idea to include repository-specific state in there as it will be cached for all instances of that hook (with identical configuration).awebdeveloper commentedon May 8, 2017
My idea was to keep my package.json versions of these in sync with what's mentioned in dependency But if you think this is not a good idea i will drop it. Thanks for the info though
Merge pull request pre-commit#293 from pre-commit/dont_match_whitespa…