diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6512931..0d9dabd 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -29,6 +29,7 @@ jobs: pip install tox - name: Run Tox run: | + tox -e release_flake8 tox -e release reuse: runs-on: ubuntu-latest diff --git a/src/fosslight_android/android_binary_analysis.py b/src/fosslight_android/android_binary_analysis.py index 6ae76c0..0145821 100755 --- a/src/fosslight_android/android_binary_analysis.py +++ b/src/fosslight_android/android_binary_analysis.py @@ -15,7 +15,6 @@ # Parsing NOTICE from bs4 import BeautifulSoup import subprocess -# For tlsh comparison import tlsh import hashlib # For checking repository name @@ -31,12 +30,9 @@ get_path_by_using_find ) from .check_package_file import check_packaging_files -from .check_notice_file import ( - run_notice_html_checklist, +from .check_notice_file import ( find_bin_in_notice, - read_notice_file, - create_additional_notice, - divide_notice_files_by_binary + read_notice_file ) from ._binary_db_controller import get_oss_info_from_db from ._common import ( @@ -891,8 +887,7 @@ def main(): # Print the result result_log["Output Directory"] = python_script_dir try: - #str_final_result_log = yaml.safe_dump(result_log, allow_unicode=True, sort_keys=True) - str_final_result_log = yaml.safe_dump(result_log, allow_unicode=True) + str_final_result_log = yaml.safe_dump(result_log, allow_unicode=True, sort_keys=True) logger.info(str_final_result_log) except Exception as ex: logger.warning(f"Failed to print result log. : {ex}") diff --git a/src/fosslight_android/check_notice_file.py b/src/fosslight_android/check_notice_file.py index 2a8a26f..50dfa33 100644 --- a/src/fosslight_android/check_notice_file.py +++ b/src/fosslight_android/check_notice_file.py @@ -96,29 +96,12 @@ def find_files_by_extension(path): return files -#def read_notice_file(notice_file_path, notice_html_file): def read_notice_file(notice_file_path): final_notice_file = {} # NOTICE.html need to be skipped the errors related to decode encodings = ["latin-1", "utf-8", "utf-16"] notice_files = [] - - ''' - if notice_html_file != "": - notice_files = notice_html_file.split(",") - else: - if os.path.isfile(notice_file_path): - notice_files.append(notice_file_path) - if notice_file_path.endswith(".html") or notice_file_path.endswith(".xml") or notice_file_path.endswith(".txt"): - notice_file_path = os.path.dirname(notice_file_path) - - if os.path.isdir(notice_file_path): - additional_notice_files = find_files_by_extension(notice_file_path) - if len(additional_notice_files) > 0: - notice_files.extend(additional_notice_files) - notice_files = list(set(notice_files)) - ''' - + if os.path.isfile(notice_file_path): notice_files.append(notice_file_path) if notice_file_path.endswith(".html") or notice_file_path.endswith(".xml") or notice_file_path.endswith(".txt"):