From faf873cd867a442dff6da709659720e1f02dc46a Mon Sep 17 00:00:00 2001 From: Jaekwon Bang Date: Wed, 9 Jun 2021 16:58:04 +0900 Subject: [PATCH 1/3] Modify tox.ini to separate release test from normal test --- tox.ini | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tox.ini b/tox.ini index 34cbe79..4f7a786 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,8 @@ skipdist = true install_command = pip install {opts} {packages} basepython= python3.6 whitelist_externals = cat +setenv = + PYTHONPATH=. [flake8] max-line-length = 130 @@ -18,18 +20,26 @@ filterwarnings = ignore::DeprecationWarning [testenv:test_run] deps = - -r{toxinidir}/requirements-dev.txt + -r{toxinidir}/requirements.txt +commands = + fosslight_source -p tests/test_files -j -o test_scan/scan_result + cat test_scan/scan_result.csv + fosslight_convert -p tests/json_result/scan_has_error.json -o test_convert/convert_result2 + fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result + cat test_convert/convert_result.csv + python tests/cli_test.py -setenv = - PYTHONPATH=. +[testenv:release] +deps = + -r{toxinidir}/requirements-dev.txt commands = - fosslight_source -h - fosslight_convert -h - fosslight_source -p tests/test_files -j -o test_scan/scan_result - cat test_scan/scan_result.csv - fosslight_convert -p tests/json_result/scan_has_error.json -o test_convert/convert_result2 - fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result - cat test_convert/convert_result.csv - python tests/cli_test.py - pytest -v --flake8 + fosslight_source -h + fosslight_convert -h + fosslight_source -p tests/test_files -j -o test_scan/scan_result + cat test_scan/scan_result.csv + fosslight_convert -p tests/json_result/scan_has_error.json -o test_convert/convert_result2 + fosslight_convert -p test_scan/scan_result.json -o test_convert/convert_result + cat test_convert/convert_result.csv + python tests/cli_test.py + pytest -v --flake8 From 8f60e89e38d038551c6f7528ddf9a6982f34c4bf Mon Sep 17 00:00:00 2001 From: Jiyeong Seok Date: Tue, 15 Jun 2021 15:36:54 +0900 Subject: [PATCH 2/3] Change OSS report name to FOSSLight report Signed-off-by: Jiyeong Seok --- README.md | 18 +++++++++--------- docs/README_Kor.md | 18 +++++++++--------- src/fosslight_source/_help.py | 2 +- src/fosslight_source/convert_scancode.py | 4 ++-- src/fosslight_source/run_scancode.py | 4 ++-- tests/cli_test.py | 4 ++-- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b020c97..273e3df 100644 --- a/README.md +++ b/README.md @@ -53,22 +53,22 @@ $ pip3 install fosslight_source There are two commands for FOSSLight Scanner. ### 1. fosslight_source -After executing ScanCode, the source code scanner, print the OSS Report. +After executing ScanCode, the source code scanner, print the FOSSLight Report. | Parameter | Argument | Description | | ------------- | ------------- | ------------- | | h | None | Print help message. | | p | String | Path to detect source. | -| j | None | As an output, the result of executing ScanCode in json format other than OSS Report is additionally generated. | +| j | None | As an output, the result of executing ScanCode in json format other than FOSSLight Report is additionally generated. | | o | String | Output file name without file extension. | -#### Ex. Print result to OSS Report and json file +#### Ex. Print result to FOSSLight Report and json file ``` $ fosslight_source -p /home/source_path -j ``` ### 2. fosslight_convert -Converts the result of executing ScanCode in json format into OSS Report format. +Converts the result of executing ScanCode in json format into FOSSLight Report format. | Parameter | Argument | Description | | ------------- | ------------- | ------------- | @@ -76,7 +76,7 @@ Converts the result of executing ScanCode in json format into OSS Report format. | p | String | Path of ScanCode json files. | | o | String | Output file name without file extension. | -#### Ex. Converting scancode json result to OSS report +#### Ex. Converting scancode json result to FOSSLight report ``` $ fosslight_convert -p /home/jsonfile_dir ``` @@ -86,14 +86,14 @@ $ fosslight_convert -p /home/jsonfile_dir ``` $ tree . -├── OSS-Report_2021-05-03_00-39-49.csv -├── OSS-Report_2021-05-03_00-39-49.xlsx +├── FOSSLight-Report_2021-05-03_00-39-49.csv +├── FOSSLight-Report_2021-05-03_00-39-49.xlsx ├── scancode_2021-05-03_00-39-49.json └── fosslight_src_log_2021-05-03_00-39-49.txt ``` -- OSS-Report_[datetime].xlsx : FOSSLight Source result in OSS Report format. -- OSS-Report_[datetime].csv : FOSSLight Source result in csv format. (Except Windows) +- FOSSLight-Report_[datetime].xlsx : FOSSLight Source result in OSS Report format. +- FOSSLight-Report_[datetime].csv : FOSSLight Source result in csv format. (Except Windows) - fosslight_src_log_[datetime].txt : The execution log. - scancode_[datetime].json : The ScanCode result in case of -j option. diff --git a/docs/README_Kor.md b/docs/README_Kor.md index 1ab819f..18128e8 100644 --- a/docs/README_Kor.md +++ b/docs/README_Kor.md @@ -48,21 +48,21 @@ $ pip3 install fosslight_source FOSSLight Scanner에는 하기 두 가지 명령어가 있습니다. ### 1. fosslight_source -Source Code 분석을 실행한 후 OSS Report 형식으로 출력합니다. +Source Code 분석을 실행한 후 FOSSLight Report 형식으로 출력합니다. | Parameter | Argument | Description | | ------------- | ------------- | ------------- | | h | None | Print help message. | | p | String | Path to analyze source. | -| j | None | As an output, the result of executing ScanCode in json format other than OSS Report is additionally generated. | +| j | None | As an output, the result of executing ScanCode in json format other than FOSSLight Report is additionally generated. | | o | String | Output file name without file extension. | -#### Ex. Source Code 분석 후 OSS Report와 json 형태의 ScanCode 결과 출력 +#### Ex. Source Code 분석 후 FOSSLight Report와 json 형태의 ScanCode 결과 출력 ``` $ fosslight_source -p /home/source_path -j ``` ### 2. fosslight_convert -json형태인 ScanCode 결과를 OSS Report 형식으로 변환합니다. +json형태인 ScanCode 결과를 FOSSLight Report 형식으로 변환합니다. | Parameter | Argument | Description | | ------------- | ------------- | ------------- | @@ -70,7 +70,7 @@ json형태인 ScanCode 결과를 OSS Report 형식으로 변환합니다. | p | String | Path of ScanCode json files. | | o | String | Output file name without file extension. | -#### Ex. json 형태의 ScanCode 결과를 OSS Report 형식으로 변환 +#### Ex. json 형태의 ScanCode 결과를 FOSSLight Report 형식으로 변환 ``` $ fosslight_convert -p /home/jsonfile_dir ``` @@ -80,14 +80,14 @@ $ fosslight_convert -p /home/jsonfile_dir ``` $ tree . -├── OSS-Report_2021-05-03_00-39-49.csv -├── OSS-Report_2021-05-03_00-39-49.xlsx +├── FOSSLight-Report_2021-05-03_00-39-49.csv +├── FOSSLight-Report_2021-05-03_00-39-49.xlsx ├── scancode_2021-05-03_00-39-49.json └── fosslight_src_log_2021-05-03_00-39-49.txt ``` -- OSS-Report_[datetime].xlsx : OSS Report형태의 Source Code 분석 결과 -- OSS-Report_[datetime].csv : OSS Report를 csv로 출력한 결과 (Windows 제외) +- FOSSLight-Report_[datetime].xlsx : FOSSLight Report형태의 Source Code 분석 결과 +- FOSSLight-Report_[datetime].csv : FOSSLight Report를 csv로 출력한 결과 (Windows 제외) - fosslight_src_log_[datetime].txt: 실행 로그가 저장된 파일 - scancode_[datetime].json : ScanCode 실행 결과 (fosslight_source명령어에 -j 옵션이 포함된 경우에만 생성) diff --git a/src/fosslight_source/_help.py b/src/fosslight_source/_help.py index 02b0fad..1335b19 100644 --- a/src/fosslight_source/_help.py +++ b/src/fosslight_source/_help.py @@ -25,7 +25,7 @@ _HELP_MESSAGE_CONVERT = """ Usage: fosslight_convert [option1] [option2] ... - FOSSLigtht_convert converts the result of executing ScanCode in json format into OSS Report format. + FOSSLigtht_convert converts the result of executing ScanCode in json format into FOSSLight Report format. Options: Mandatory diff --git a/src/fosslight_source/convert_scancode.py b/src/fosslight_source/convert_scancode.py index e51f8cc..4130a3e 100755 --- a/src/fosslight_source/convert_scancode.py +++ b/src/fosslight_source/convert_scancode.py @@ -55,7 +55,7 @@ def convert_json_to_excel(scancode_json, excel_name): success_to_write, writing_msg = write_excel_and_csv(excel_name, sheet_list) logger.info("Writing excel :" + str(success_to_write) + " " + writing_msg) if success_to_write: - _result_log["OSS Report"] = excel_name + ".xlsx" + _result_log["FOSSLight Report"] = excel_name + ".xlsx" except Exception as ex: success = False @@ -112,7 +112,7 @@ def main(): if output_file_name == "": output_dir = os.getcwd() - oss_report_name = "OSS-Report_" + start_time + oss_report_name = "FOSSLight-Report_" + start_time else: oss_report_name = output_file_name output_dir = os.path.dirname(os.path.abspath(output_file_name)) diff --git a/src/fosslight_source/run_scancode.py b/src/fosslight_source/run_scancode.py index 9bbf75e..81979ef 100755 --- a/src/fosslight_source/run_scancode.py +++ b/src/fosslight_source/run_scancode.py @@ -68,7 +68,7 @@ def run_scan(path_to_scan, output_file_name="", start_time = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') if output_file_name == "": - output_file = "OSS-Report_" + start_time + output_file = "FOSSLight-Report_" + start_time output_json_file = "scancode_" + start_time output_dir = os.getcwd() else: @@ -125,7 +125,7 @@ def run_scan(path_to_scan, output_file_name="", output_file, sheet_list) logger.info("Writing excel :" + str(success_to_write) + " " + writing_msg) if success_to_write: - _result_log["OSS Report"] = output_file + ".xlsx" + _result_log["FOSSLight Report"] = output_file + ".xlsx" except Exception as ex: success = False msg = str(ex) diff --git a/tests/cli_test.py b/tests/cli_test.py index 5897de0..d62d4b2 100755 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -20,12 +20,12 @@ def main(): start_time = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') output_file_name = "" - oss_report_name = "test_result_func_call/result" + fosslight_report_name = "test_result_func_call/result" output_dir = os.path.dirname(os.path.abspath(output_file_name)) logger = init_log(os.path.join(output_dir, "fosslight_src_log_"+start_time+".txt")) - ret = run_scan(path_to_find_bin, oss_report_name, True, -1, True) + ret = run_scan(path_to_find_bin, fosslight_report_name, True, -1, True) logger.warn("[Scan] Result: %s" % (ret[0])) logger.warn("[Scan] Result_msg: %s" % (ret[1])) From 13d7425352b819a1b28f6615f28f2f53f626f291 Mon Sep 17 00:00:00 2001 From: Jiyeong Seok Date: Tue, 15 Jun 2021 15:42:26 +0900 Subject: [PATCH 3/3] Change language link name --- README.md | 2 +- docs/README_Kor.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 273e3df..0d51568 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: Apache-2.0 -->

- [Kor] + [Korean]

diff --git a/docs/README_Kor.md b/docs/README_Kor.md index 18128e8..3b2d23e 100644 --- a/docs/README_Kor.md +++ b/docs/README_Kor.md @@ -1,6 +1,6 @@

- [Eng] + [English]