Last active
May 4, 2020 15:52
-
-
Save jayczech23/21c923a0a44ae7eb77a532c6974721e1 to your computer and use it in GitHub Desktop.
Run python Linter with a minimum passing score
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Wrapper for Pylint to | |
specify a minimum Pylint | |
score required to pass | |
'static_analysis' job. | |
""" | |
import sys | |
from pylint import lint | |
THRESHOLD = 8 | |
if len(sys.argv) < 2: | |
raise ArgumentError('Module/Package to evaluate needs to be first argument') | |
run = lint.Run([sys.argv[1]], do_exit=False) | |
score = run.linter.stats['global_note'] | |
if score < THRESHOLD: | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment