Skip to content

Commit 020690f

Browse files
committed
Remove debug statements, improve doc, simplify code
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent 9b39987 commit 020690f

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

vulnerabilities/importers/apache_tomcat.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ def to_advisories(self, apache_tomcat_advisory_html):
111111
type="maven", namespace="apache", name="tomcat", version=fixed_version
112112
)
113113
]
114-
if fixed_package in affected_packages:
115-
raise ValueError("Bing bong")
116114

117115
advisories.append(
118116
Advisory(

vulnerabilities/importers/istio.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
from vulnerabilities.data_source import Advisory, GitDataSource, Reference
3333
from vulnerabilities.package_managers import GitHubTagsAPI
34-
from vulnerabilities.helpers import contains_alpha
3534

3635
is_release = re.compile(r"^[\d.]+$", re.IGNORECASE).match
3736

@@ -49,8 +48,6 @@ def __enter__(self):
4948

5049
def set_api(self):
5150
asyncio.run(self.version_api.load_api(["istio/istio"]))
52-
# Only keep public releases
53-
self.version_api.cache = list(filter(contains_alpha, self.version_api.cache))
5451

5552
def updated_advisories(self) -> Set[Advisory]:
5653
files = self._added_files.union(self._updated_files)

vulnerabilities/importers/npm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def _versions_to_purls(package_name, versions):
130130

131131
def normalize_ranges(version_range_string):
132132
"""
133-
Splits version range strings with "||" operator into separate ranges
133+
- Splits version range strings with "||" operator into separate ranges.
134+
- Removes spaces between range operator and range operands
135+
- Normalizes 'x' ranges
134136
Example:
135137
>>> z = normalize_ranges(">=6.1.3 < 7.0.0 || >=7.0.3")
136138
>>> assert z == [">=6.1.3,<7.0.0", ">=7.0.3"]

0 commit comments

Comments
 (0)