Last active
August 6, 2020 02:33
-
-
Save atroche/cc795746e4cfff3f9d1bd2ea0f684390 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import re, sys, os | |
def main(): | |
# example: | |
# feat(apikey): added the ability to add api key to configuration | |
pattern = r'(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*' | |
filename = sys.argv[1] | |
ss = open(filename, 'r').read() | |
m = re.match(pattern, ss) | |
if m == None: raise Exception("conventional commit validation failed") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment