Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prechecker #119

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove prechecker
Signed-off-by: jiyeong.seok <[email protected]>
dd-jy committed Sep 6, 2024

Verified

This commit was signed with the committer’s verified signature.
lucasssvaz Lucas Saavedra Vaz
commit e2bc299ae1f6f67bc6ab656ea98ccaea625d605e
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -7,5 +7,4 @@ beautifulsoup4
fosslight_util>=2.0.0
fosslight_source>=2.0.0
fosslight_dependency>=4.0.0
fosslight_binary>=5.0.0
fosslight_prechecker==3.0.27
fosslight_binary>=5.0.0
22 changes: 4 additions & 18 deletions src/fosslight_scanner/fosslight_scanner.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@
from fosslight_util.timer_thread import TimerThread
import fosslight_util.constant as constant
from fosslight_util.output_format import check_output_format
from fosslight_prechecker._precheck import run_lint as prechecker_lint
from fosslight_util.cover import CoverItem
from fosslight_util.oss_item import ScannerItem
from fosslight_util.output_format import write_output_file
@@ -51,7 +50,7 @@
_executed_path = ""
SRC_DIR_FROM_LINK_PREFIX = "fosslight_src_dir_"
SCANNER_MODE = [
"all", "compare", "reuse", "prechecker", "binary",
"all", "compare", "binary",
"bin", "src", "source", "dependency", "dep"
]

@@ -152,14 +151,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
if success:
output_files = {"SRC": f"fosslight_src_{_start_time}{output_extension}",
"BIN": f"fosslight_bin_{_start_time}{output_extension}",
"DEP": f"fosslight_dep_{_start_time}{output_extension}",
"PRECHECKER": f"fosslight_lint_{_start_time}.yaml"}
if run_prechecker:
output_prechecker = os.path.join(_output_dir, output_files["PRECHECKER"])
success, result = call_analysis_api(src_path, "Prechecker Lint",
-1, prechecker_lint,
abs_path, False, output_prechecker,
exclude_path=path_to_exclude)
"DEP": f"fosslight_dep_{_start_time}{output_extension}"}

if run_src:
try:
@@ -397,27 +389,21 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
run_src = False
run_bin = False
run_dep = False
run_prechecker = False
remove_downloaded_source = False

if "all" in mode_list or (not mode_list):
run_src = True
run_bin = True
run_dep = True
run_prechecker = False
if "prechecker" in mode_list or "reuse" in mode_list:
run_prechecker = True
else:
if "prechecker" in mode_list or "reuse" in mode_list:
run_prechecker = True
if "binary" in mode_list or "bin" in mode_list:
run_bin = True
if "source" in mode_list or "src" in mode_list:
run_src = True
if "dependency" in mode_list or "dep" in mode_list:
run_dep = True

if run_dep or run_src or run_bin or run_prechecker:
if run_dep or run_src or run_bin:
if src_path == "" and url_to_analyze == "":
src_path, dep_arguments, url_to_analyze = get_input_mode(_executed_path, mode_list)

@@ -439,7 +425,7 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format

if src_path != "":
run_scanner(src_path, dep_arguments, output_path, keep_raw_data,
run_src, run_bin, run_dep, run_prechecker,
run_src, run_bin, run_dep, '',
remove_downloaded_source, {}, output_file,
output_extension, num_cores, db_url,
default_oss_name, default_oss_version, url_to_analyze,