mirror of
https://github.com/adulau/git-vuln-finder.git
synced 2024-11-22 01:57:08 +00:00
Added language detection
This commit is contained in:
parent
a75ecdbc87
commit
26edaab198
2 changed files with 3 additions and 0 deletions
|
@ -1 +1,2 @@
|
|||
gitpython
|
||||
langdetect
|
||||
|
|
|
@ -16,6 +16,7 @@ import json
|
|||
import sys
|
||||
import argparse
|
||||
import typing
|
||||
from langdetect import detect as langdetect
|
||||
|
||||
parser = argparse.ArgumentParser(description = "Finding potential software vulnerabilities from git commit messages.", epilog = "More info: https://github.com/cve-search/git-vuln-finder")
|
||||
parser.add_argument("-v", help="increase output verbosity", action="store_true")
|
||||
|
@ -81,6 +82,7 @@ def summary(commit, branch, pattern):
|
|||
else:
|
||||
potential_vulnerabilities[rcommit.hexsha] = {}
|
||||
potential_vulnerabilities[rcommit.hexsha]['message'] = rcommit.message
|
||||
potential_vulnerabilities[rcommit.hexsha]['language'] = langdetect(rcommit.message)
|
||||
potential_vulnerabilities[rcommit.hexsha]['commit-id'] = rcommit.hexsha
|
||||
potential_vulnerabilities[rcommit.hexsha]['summary'] = rcommit.summary
|
||||
potential_vulnerabilities[rcommit.hexsha]['stats'] = rcommit.stats.total
|
||||
|
|
Loading…
Reference in a new issue