Skip to content

Commit bc13c65

Browse files
committed
Modify result file name format
1 parent c8482e3 commit bc13c65

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/fosslight_oss_pkg/_convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def convert_report(base_path, output_name, format, need_log_file=True):
2323
oss_yaml_files = []
2424
file_option_on = False
2525
output_report = ""
26-
now = datetime.now().strftime('%Y%m%d_%H-%M-%S')
26+
now = datetime.now().strftime('%y%m%d_%H%M')
2727

2828
success, msg, output_path, output_name, output_extension = check_output_format(output_name, format, CUSTOMIZED_FORMAT_FOR_PRECHECKER)
2929

30-
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_prechecker_log_{now}.txt"),
30+
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_log_{now}.txt"),
3131
need_log_file, logging.INFO, logging.DEBUG, _PKG_NAME, base_path)
3232
if success:
3333
if output_path == "":
@@ -40,7 +40,7 @@ def convert_report(base_path, output_name, format, need_log_file=True):
4040
if output_name != "":
4141
output_report = os.path.join(output_path, output_name)
4242
else:
43-
output_report = os.path.join(os.path.abspath(output_path), f"FOSSLight-Report_{now}")
43+
output_report = os.path.join(os.path.abspath(output_path), f"fosslight_report_{now}")
4444
else:
4545
logger.error(f"Format error - {msg}")
4646
sys.exit(1)

src/fosslight_prechecker/_add.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ def add_content(target_path="", input_license="", input_copyright="", output_pat
345345
else:
346346
output_path = os.path.abspath(output_path)
347347

348-
now = datetime.now().strftime('%Y%m%d_%H-%M-%S')
349-
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_prechecker_add_log_{now}.txt"),
348+
now = datetime.now().strftime('%y%m%d_%H%M')
349+
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_log_{now}.txt"),
350350
need_log_file, logging.INFO, logging.DEBUG, PKG_NAME, path_to_find)
351351

352352
if not os.path.isdir(path_to_find):

src/fosslight_prechecker/_precheck.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def dump_error_msg(error_msg: str, exit=False):
198198

199199
def init(path_to_find, output_path, file_list, need_log_file=True):
200200
global logger, _result_log
201-
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_prechecker_log_{_start_time}.txt"),
201+
logger, _result_log = init_log(os.path.join(output_path, f"fosslight_log_{_start_time}.txt"),
202202
need_log_file, logging.INFO, logging.DEBUG, PKG_NAME, path_to_find)
203203
if file_list:
204204
_result_log["File list to check"] = file_list
@@ -242,7 +242,7 @@ def run_lint(target_path, disable, output_file_name, format='', need_log_file=Tr
242242
report = ProjectReport()
243243
result_item = ResultItem()
244244
success = False
245-
_start_time = datetime.now().strftime('%Y%m%d_%H-%M-%S')
245+
_start_time = datetime.now().strftime('%y%m%d_%H%M')
246246

247247
try:
248248
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

src/fosslight_prechecker/_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ def create_result_file(output_file_name, format='', _start_time=""):
199199
result_file = f"{output_file}{output_extension}"
200200
else:
201201
if output_extension == '.yaml' or output_extension == "":
202-
result_file = f"FOSSLight_Prechecker_{_start_time}.yaml"
202+
result_file = f"fosslight_lint_{_start_time}.yaml"
203203
elif output_extension == '.html':
204-
result_file = f"FOSSLight_Prechecker_{_start_time}.html"
204+
result_file = f"fosslight_lint_{_start_time}.html"
205205
elif output_extension == '.xml':
206-
result_file = f"FOSSLight_Prechecker_{_start_time}.xml"
206+
result_file = f"fosslight_lint_{_start_time}.xml"
207207
else:
208208
logger.error("Not supported file extension")
209209

0 commit comments

Comments
 (0)