Skip to content

Commit

Permalink
Merge pull request #119 from fosslight/remove_prechkr
Browse files Browse the repository at this point in the history
Remove prechecker
  • Loading branch information
dd-jy authored Sep 6, 2024
2 parents 51420c2 + e2bc299 commit e3eb633
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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
Expand All @@ -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"
]

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand All @@ -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,
Expand Down

0 comments on commit e3eb633

Please sign in to comment.