Skip to content

Commit 73fb651

Browse files
authored
Merge pull request #43 from fosslight/temp_prechecker
Change FL Reuse to FL Prechecker
2 parents b024ec4 + ef917ab commit 73fb651

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SPDX-License-Identifier: Apache-2.0
1111

1212
**FOSSLight Scanner** performs open source analysis after downloading the source by passing a link that can be cloned by wget or git. Instead, open source analysis can be performed for the local source path. The output result is generated in [FOSSLight Report][or] format.
1313

14-
- **[FOSSLight Reuse][re]** Check whether the [source code's copyright and license writing rules][rule] are complied with.
14+
- **[FOSSLight Prechecker][re]** Check whether the [source code's copyright and license writing rules][rule] are complied with.
1515
- **[FOSSLight Source Scanner][s]** Extract license and copyright in the source code using [ScanCode][sc].
1616
- **[FOSSLight Dependency Scanner][d]** Extract dependency and OSS information from the package manager's manifest file.
1717
- **[FOSSLight Binary Scanner][flbin]** Find binary and print OSS information.
@@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
2121
[sc]: https://github.com/nexB/scancode-toolkit
2222
[or]: https://fosslight.org/fosslight-guide-en/learn/2_fosslight_report.html
2323
[flbin]: https://github.com/fosslight/fosslight_binary_scanner
24-
[re]: https://github.com/fosslight/fosslight_reuse
24+
[re]: https://github.com/fosslight/fosslight_prechecker
2525
[rule]: https://oss.lge.com/guide/process/osc_process/1-identification/copyright_license_rule.html
2626

2727
## Contents
@@ -65,7 +65,7 @@ Mode
6565
source Run FOSSLight Source
6666
dependency Run FOSSLight Dependency
6767
binary Run FOSSLight Binary
68-
reuse Run FOSSLight Reuse
68+
prechecker Run FOSSLight Prechecker
6969
all Run all scanners
7070
```
7171
Options:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ beautifulsoup4
99
fosslight_util>=1.4.1
1010
fosslight_dependency>=3.7.4
1111
fosslight_binary>=4.0.7
12-
fosslight_reuse>=2.2.1
12+
fosslight_prechecker>=3.0.1

src/fosslight_scanner/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
source\t\t Run FOSSLight Source
1717
dependency\t\t Run FOSSLight Dependency
1818
binary\t\t Run FOSSLight Binary
19-
reuse\t\t Run FOSSLight Reuse
19+
prechecker\t\t Run FOSSLight Prechecker
2020
all\t\t\t Run all scanners
2121
compare\t\t Compare two FOSSLight reports in yaml format
2222

src/fosslight_scanner/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def main():
1212
parser = ArgumentParser(description='FOSSLight Scanner', prog='fosslight_scanner', add_help=False)
13-
parser.add_argument('mode', nargs='?', help='source| dependency| binary| reuse| all| compare', default="all")
13+
parser.add_argument('mode', nargs='?', help='source| dependency| binary| prechecker| all| compare', default="all")
1414
parser.add_argument('--path', '-p', help='Path to analyze (In compare mode, two FOSSLight reports',
1515
dest='path', nargs='+', default="")
1616
parser.add_argument('--wget', '-w', help='Link to be analyzed', type=str, dest='link', default="")

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from fosslight_util.timer_thread import TimerThread
2121
import fosslight_util.constant as constant
2222
from fosslight_util.output_format import check_output_format
23-
from fosslight_reuse._fosslight_reuse import run_lint as reuse_lint
23+
from fosslight_prechecker._precheck import run_lint as prechecker_lint
2424
from .common import (copy_file, call_analysis_api,
2525
overwrite_excel, extract_name_from_link)
2626
from fosslight_util.write_excel import merge_excels
@@ -99,7 +99,7 @@ def run_dependency(path_to_analyze, output_file_with_path, params=""):
9999

100100

101101
def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
102-
run_src=True, run_bin=True, run_dep=True, run_reuse=True,
102+
run_src=True, run_bin=True, run_dep=True, run_prechecker=True,
103103
remove_src_data=True, result_log={}, output_file="",
104104
output_extension="", num_cores=-1, db_url="",
105105
default_oss_name="", url=""):
@@ -128,15 +128,15 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
128128
output_files = {"SRC": "FL_Source.xlsx",
129129
"BIN": "FL_Binary.xlsx",
130130
"BIN_TXT": "FL_Binary.txt",
131-
"DEP": "FL_Dependency.xlsx",
132-
"REUSE": "FL_Reuse.yaml"}
133-
if run_reuse:
134-
output_reuse = os.path.join(_output_dir, output_files["REUSE"])
135-
success, result = call_analysis_api(src_path, "Reuse Lint",
136-
-1, reuse_lint,
131+
"DEP": f"FL_Dependency{output_extension}",
132+
"PRECHECKER": "FL_Prechecker.yaml"}
133+
if run_prechecker:
134+
output_prechecker = os.path.join(_output_dir, output_files["PRECHECKER"])
135+
success, result = call_analysis_api(src_path, "Prechecker Lint",
136+
-1, prechecker_lint,
137137
abs_path, False,
138-
output_reuse)
139-
success_file, copied_file = copy_file(output_reuse, output_path)
138+
output_prechecker)
139+
success_file, copied_file = copy_file(output_prechecker, output_path)
140140
if success_file:
141141
temp_output_fiiles.append(copied_file)
142142

@@ -316,13 +316,13 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
316316
run_src = False
317317
run_bin = False
318318
run_dep = False
319-
run_reuse = False
319+
run_prechecker = False
320320
remove_downloaded_source = False
321321
if output_path == "":
322322
output_path = _executed_path
323323

324-
if mode == "reuse":
325-
run_reuse = True
324+
if mode == "prechecker" or mode == "reuse":
325+
run_prechecker = True
326326
elif mode == "binary" or mode == "bin":
327327
run_bin = True
328328
elif mode == "source" or mode == "src":
@@ -333,7 +333,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
333333
run_src = True
334334
run_bin = True
335335
run_dep = True
336-
run_reuse = True
336+
run_prechecker = True
337337

338338
if src_path == "" and url_to_analyze == "":
339339
src_path, dep_arguments, url_to_analyze = get_input_mode()
@@ -350,7 +350,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
350350

351351
if src_path != "":
352352
run_scanner(src_path, dep_arguments, output_path, keep_raw_data,
353-
run_src, run_bin, run_dep, run_reuse,
353+
run_src, run_bin, run_dep, run_prechecker,
354354
remove_downloaded_source, {}, output_file,
355355
output_extension, num_cores, db_url,
356356
default_oss_name, url_to_analyze)

0 commit comments

Comments
 (0)