Skip to content

Commit b70e816

Browse files
authored
Merge pull request #141 from fosslight/develop2
Modify 'Analyze path' if input file on lint
2 parents 9d29d89 + 43c6687 commit b70e816

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/fosslight_prechecker/_precheck.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def exclude_untracked_files(path):
4545
cmd_result = [file.replace(path, '', 1) for file in cmd_result]
4646
DEFAULT_EXCLUDE_EXTENSION_FILES.extend(cmd_result)
4747
except Exception as ex:
48-
logger.error(f"Error to get git untracked files : {ex}")
48+
logger.warning(f"Error to get git untracked files : {ex}")
4949

5050

5151
def exclude_gitignore_files(current_path, path):
@@ -66,9 +66,8 @@ def exclude_gitignore_files(current_path, path):
6666
DEFAULT_EXCLUDE_EXTENSION_FILES.extend(cmd_result)
6767
else:
6868
return
69-
7069
except Exception as ex:
71-
logger.error(f"Error to get git ignored files : {ex}")
70+
logger.warning(f"Error to get git ignored files : {ex}")
7271

7372

7473
def exclude_git_related_files(path):
@@ -85,7 +84,7 @@ def exclude_git_related_files(path):
8584
# Restore path
8685
os.chdir(current_path)
8786
except Exception as ex:
88-
logger.error(f"Error to get git related files : {ex}")
87+
logger.warning(f"Error to get git related files : {ex}")
8988

9089

9190
def find_oss_pkg_info_and_exlcude_file(path):
@@ -271,10 +270,11 @@ def dump_error_msg(error_msg: str, exit=False):
271270

272271
def init(path_to_find, output_path, file_list, need_log_file=True):
273272
global logger, _result_log
274-
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_log_pre_{_start_time}.txt"),
275-
need_log_file, logging.INFO, logging.DEBUG, PKG_NAME, path_to_find)
276273
if file_list:
277274
_result_log["File list to check"] = file_list
275+
path_to_find = file_list
276+
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_log_pre_{_start_time}.txt"),
277+
need_log_file, logging.INFO, logging.DEBUG, PKG_NAME, path_to_find)
278278

279279

280280
def get_path_to_find(target_path, _check_only_file_mode):

0 commit comments

Comments
 (0)