diff --git a/.coverage.Siva.8283.978516 b/.coverage.Siva.8283.978516 new file mode 100644 index 0000000..19a9256 --- /dev/null +++ b/.coverage.Siva.8283.978516 @@ -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":[]}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 52380cc..9563162 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ html/ latex/ coverage.xml cvedb/ +.DS_Store +nvd-data/nvdcve*.* diff --git a/cvejob/filters/input.py b/cvejob/filters/input.py index 3365ef8..7fd0111 100644 --- a/cvejob/filters/input.py +++ b/cvejob/filters/input.py @@ -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 diff --git a/run-tests.sh b/run-tests.sh index c1335ba..d56a117 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/bash set -e set -x