Skip to content

Commit b5fa60c

Browse files
Merge pull request #125 from fosslight/dev_sorting
Sort the result by file and exclude attributes
2 parents 16ec508 + 730758f commit b5fa60c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/fosslight_source/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def create_report_file(_start_time, scanned_result, license_list, scanoss_result
168168
output_file = f"fosslight_report_src_{_start_time}"
169169

170170
if scanned_result:
171-
scanned_result = sorted(scanned_result, key=lambda row: (''.join(row.licenses)))
171+
scanned_result = sorted(scanned_result, key=lambda row: (row.exclude, row.file))
172172

173173
if selected_scanner == 'scancode' or output_extension == _json_ext:
174174
sheet_list[SCANOSS_SHEET_NAME] = []

tests/test_files/test/temp.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-FileCopyrightText: Copyright 2022 LG Electronics Inc.
3+
* SPDX-License-Identifier: Apache-2.0
4+
* DownloadLocation: https://github.com/browserify/acorn-node
5+
*/
6+
#include <iostream>
7+
8+
int main()
9+
{
10+
std::cout << "Hello, world!" << std::endl;
11+
return 0;
12+
}

0 commit comments

Comments
 (0)