Skip to content

Commit f08be0e

Browse files
author
Orlando Barrera II
committed
Removed -1 ftom sarif
1 parent ed6696e commit f08be0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

socketsecurity/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '1.0.44'
2+
__version__ = '1.0.45'

socketsecurity/core/messages.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def find_line_in_file(packagename: str, packageversion: str, manifest_file: str)
8282
needle_key = f'"{found_key}":' # e.g. "node_modules/axios":
8383
needle_version = f'"version": "{packageversion}"'
8484
lines = raw_text.splitlines()
85-
best_line = -1
85+
best_line = 1
8686
snippet = None
8787

8888
for i, line in enumerate(lines, start=1):
@@ -97,10 +97,10 @@ def find_line_in_file(packagename: str, packageversion: str, manifest_file: str)
9797
else:
9898
return 1, f'"{found_key}": {found_info}'
9999
else:
100-
return -1, f"{packagename} {packageversion} (not found in {manifest_file})"
100+
return 1, f"{packagename} {packageversion} (not found in {manifest_file})"
101101

102102
except (FileNotFoundError, json.JSONDecodeError):
103-
return -1, f"Error reading {manifest_file}"
103+
return 1, f"Error reading {manifest_file}"
104104

105105
# ----------------------------------------------------
106106
# 2) Text-based / line-based manifests

0 commit comments

Comments
 (0)