Skip to content

Commit

Permalink
cve can be in any language of the repo, not necessarily, the top one
Browse files Browse the repository at this point in the history
  • Loading branch information
Siva Kumar authored and msrb committed Mar 27, 2019
1 parent 6213b33 commit 5051a09
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions .coverage.Siva.8283.978516
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!coverage.py: This is a private format, don't read it directly!{"lines":{"/Users/sadhikar/Documents/Work/cvejob/cvejob/version_utils.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/config.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/version.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/cpe2pkg.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/utils.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/filters/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/filters/input.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/versions/version_identifier.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/versions/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/identifiers/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/identifiers/naive.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/identifiers/nvdtoolkit.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/outputs/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/outputs/victims.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/selectors/__init__.py":[],"/Users/sadhikar/Documents/Work/cvejob/cvejob/selectors/basic.py":[]}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ html/
latex/
coverage.xml
cvedb/
.DS_Store
nvd-data/nvdcve*.*
10 changes: 2 additions & 8 deletions cvejob/filters/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,11 @@ def is_supported_gh_language(owner, repo):
if response.status_code != 200:
return False

top_lang = ''
top_lang_bytes = 0
langs = response.json()
for lang, lang_bytes in langs.items():
if lang_bytes > top_lang_bytes:
top_lang_bytes = lang_bytes
top_lang = lang

lang_group = (Config.ecosystem, *self.lang_groups.get(Config.ecosystem, []))

if top_lang and top_lang.lower() in lang_group:
# if repo languages list contain the language for which the job is being run
if (set(x.lower() for x in langs) & set(y.lower() for y in lang_group)):
return True
return False

Expand Down
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/bin/bash

set -e
set -x
Expand Down

0 comments on commit 5051a09

Please sign in to comment.