sebdah/git-pylint-commit-hook

Add legacy code improvement feature

Opened this issue · 2 comments

In environments with legacy code, there can be many python scripts of quite bad quality.
If the git hook expects a quality e.g. of 8.0, the motivation to fix a file which e.g. started with 2.0 is quite low - especially if a developer only changed a single line.

An optional mode where the commit hook compares the result with the previously commit state, and the check is considered successful in case the code is at least x.y points better than before (or better than the classic threshold), would motivate a developer to improve the file to the required degree.

I

This is a feature request for which I cannot provide a Pull Request. If the feature seems useful to you, I may be able to work on this with some guidance what needs to be done .

To me that sounds like a pretty useful thing. An alternate approach would be better is that you'd be able to set thresholds per file for example or maybe per package?

I'm not actively using Python nor this hook, but if you need any direction, feel free to ask here.