gray icon indicating copy to clipboard operation
gray copied to clipboard

Add support for per folder rules

Open sodul opened this issue 3 years ago • 0 comments

It would be good to be able to tune the rules to be different in some subfolders while still be compatible with a single pre-commit hook.

The use case is that we have a mono repo where most of our python code will run with Python 3.10. As such we want to take advantage of the newer Python 3.10 syntax and other improvements.

Unfortunately in some of that repo we have some test scripts and lambdas that need to run with older versions of Python. AWS Lambdas got support for 3.9 only recently and it will probably be months before 3.10 support is available. The testing scripts are meant to run on various OS versions and some of them only have python 3.6 available.

I suppose a workaround would be to wrap gray to 'exclude' the directories with code older than the versions picked for the majority of the code base, and that will be addressed in #11, but supporting different rules per folder would be very convenient.

sodul avatar Feb 23 '22 20:02 sodul