warpnet / salt-lint

A command-line utility that checks for best practices in SaltStack.
https://salt-lint.readthedocs.io/en/latest/
MIT License
154 stars 39 forks source link

Having salt-lint depend on salt adds unneeded dependecies #135

Closed mew1033 closed 4 years ago

mew1033 commented 4 years ago

As it stands right now, salt-lint doesn't really use any big parts of the salt library. However, salt is marked as a dependency, meaning it must be pulled in and installed in its entirety. When creating a docker image to use, adding the salt libraries (including pycrypto and gcc for pycrypto), the size goes from 186MB to 416MB.

I made a PR (#120) to remove salt as a dependency, but it sounds like there are future features in the works that will utilize more of salt core.

What do you think of having a "salt-lint-lite" or something that sacrifices a few features for the benefit of being a much, much lighter package?

mew1033 commented 4 years ago

@roaldnefs Another idea: What about removing the salt dependency from places that don't really need them so that salt-lint can be installed without salt and still work in most cases. Maybe also add a flag like --no-render or something that disables checks that need salt.

So in that case, you could remove the saltcolor dependency (done in part of #120) and only add in salt code in rules that need it. Then salt-lint could be installed with pip install --no-deps salt-lint to avoid getting all of salt.