Skip to content

Commit c85b553

Browse files
authored
Merge branch 'main' into develop
2 parents 55b1430 + 590bc55 commit c85b553

File tree

10 files changed

+141
-23
lines changed

10 files changed

+141
-23
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
commit = True
33
tag = False
44
message = Bump version: {current_version} → {new_version}
5-
current_version = 1.6.12
5+
current_version = 1.7.1
66

77
[bumpversion:file:setup.py]
88
search = '{current_version}'

.github/workflows/pull-request.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,33 @@ name: Pull requests fosslight_scanner
44

55
on:
66
pull_request:
7-
branches: [ main ]
7+
branches:
8+
- '*'
89

910
jobs:
11+
check-commit-message:
12+
name: Check Commit Message
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Get PR Commits
16+
id: 'get-pr-commits'
17+
uses: tim-actions/get-pr-commits@master
18+
with:
19+
token: ${{ secrets.TOKEN }}
20+
21+
- name: Check Subject Line Length
22+
uses: tim-actions/[email protected]
23+
with:
24+
commits: ${{ steps.get-pr-commits.outputs.commits }}
25+
pattern: '^.{0,50}(\n.*)*$'
26+
error: 'Subject too long (max 50)'
27+
- name: Check Body Line Length
28+
if: ${{ success() || failure() }}
29+
uses: tim-actions/[email protected]
30+
with:
31+
commits: ${{ steps.get-pr-commits.outputs.commits }}
32+
pattern: '^.+(\n.{0,72})*$'
33+
error: 'Body line too long (max 72)'
1034
build:
1135
runs-on: ubuntu-latest
1236
strategy:

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
# Changelog
22

3+
## v1.7.1 (22/07/2022)
4+
## Changes
5+
## 🐛 Hotfixes
6+
7+
- Change FL Reuse to FL Prechecker @bjk7119 (#43)
8+
9+
---
10+
11+
## v1.7.0 (22/07/2022)
12+
## Changes
13+
## 🚀 Features
14+
15+
- Add compare mode @dd-jy (#38)
16+
17+
## 🔧 Maintenance
18+
19+
- Replace 'y' option to 'p' option. @dd-jy (#41)
20+
- Fix scanner support format and not to create csv. @dd-jy (#40)
21+
- Print message when comparison rows are over 100. @dd-jy (#39)
22+
23+
---
24+
25+
## v1.6.15 (06/07/2022)
26+
## Changes
27+
## 🐛 Hotfixes
28+
29+
- Modify reuse input parameter @bjk7119 (#37)
30+
31+
---
32+
33+
## v1.6.14 (19/05/2022)
34+
## Changes
35+
## 🚀 Features
36+
37+
- Run fosslight_source without installing it @soimkim (#34)
38+
- Add a Dockerfile @soimkim (#35)
39+
40+
## 🐛 Hotfixes
41+
42+
- Fix a bug where part of the output file is not created without the -o option @soimkim (#36)
43+
44+
---
45+
46+
## v1.6.13 (11/04/2022)
47+
## Changes
48+
## 🐛 Hotfixes
49+
50+
- Fix an errors when parsing with path @soimkim (#33)
51+
- Fix an error that occur when downloading link @soimkim (#30)
52+
53+
## 🔧 Maintenance
54+
55+
- Add a commit message checker @soimkim (#31)
56+
57+
---
58+
359
## v1.6.12 (28/03/2022)
460
## 🐛 Hotfixes
561

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2022 LG Electronics Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
FROM ubuntu:20.04
4+
5+
RUN apt-get update && apt-get install sudo -y
6+
RUN ln -sf /bin/bash /bin/sh
7+
8+
COPY . /app
9+
WORKDIR /app
10+
11+
ENV DEBIAN_FRONTEND=noninteractive
12+
13+
RUN apt-get -y install build-essential
14+
RUN apt-get -y install python3 python3-distutils python3-pip python3-dev
15+
RUN apt-get -y install python3-intbitset python3-magic
16+
RUN apt-get -y install libxml2-dev
17+
RUN apt-get -y install libxslt1-dev
18+
RUN apt-get -y install libhdf5-dev
19+
RUN apt-get -y install bzip2 xz-utils zlib1g libpopt0
20+
RUN apt-get -y install gcc-10 g++-10
21+
RUN pip3 install --upgrade pip
22+
RUN pip3 install .
23+
RUN pip3 install dparse
24+
25+
ENTRYPOINT ["/usr/local/bin/fosslight"]

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SPDX-License-Identifier: Apache-2.0
1111

1212
**FOSSLight Scanner** performs open source analysis after downloading the source by passing a link that can be cloned by wget or git. Instead, open source analysis can be performed for the local source path. The output result is generated in [FOSSLight Report][or] format.
1313

14-
- **[FOSSLight Reuse][re]** Check whether the [source code's copyright and license writing rules][rule] are complied with.
14+
- **[FOSSLight Prechecker][re]** Check whether the [source code's copyright and license writing rules][rule] are complied with.
1515
- **[FOSSLight Source Scanner][s]** Extract license and copyright in the source code using [ScanCode][sc].
1616
- **[FOSSLight Dependency Scanner][d]** Extract dependency and OSS information from the package manager's manifest file.
1717
- **[FOSSLight Binary Scanner][flbin]** Find binary and print OSS information.
@@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
2121
[sc]: https://github.com/nexB/scancode-toolkit
2222
[or]: https://fosslight.org/fosslight-guide-en/learn/2_fosslight_report.html
2323
[flbin]: https://github.com/fosslight/fosslight_binary_scanner
24-
[re]: https://github.com/fosslight/fosslight_reuse
24+
[re]: https://github.com/fosslight/fosslight_prechecker
2525
[rule]: https://oss.lge.com/guide/process/osc_process/1-identification/copyright_license_rule.html
2626

2727
## Contents
@@ -35,6 +35,7 @@ SPDX-License-Identifier: Apache-2.0
3535
- [Ex 1. Local Source Analysis](#ex-1-local-source-analysis)
3636
- [Ex 2. Download Link and analyze](#ex-2-download-link-and-analyze)
3737
- [📁 Result](#-result)
38+
- [🐳 How to run using Docker](#-how-to-run-using-docker)
3839
- [👏 How to report issue](#-how-to-report-issue)
3940
- [📄 License](#-license)
4041

@@ -64,7 +65,7 @@ Mode
6465
source Run FOSSLight Source
6566
dependency Run FOSSLight Dependency
6667
binary Run FOSSLight Binary
67-
reuse Run FOSSLight Reuse
68+
prechecker Run FOSSLight Prechecker
6869
all Run all scanners
6970
```
7071
Options:
@@ -111,6 +112,17 @@ $ tree
111112
- FOSSLight_Report-[datetime].xlsx : OSS Report format file that outputs source code analysis, binary analysis, and dependency analysis results.
112113
- fosslight_raw_data_[datetime] directory: Directory in which raw data files are created as a result of analysis
113114

115+
## 🐳 How to run using Docker
116+
1. Build image using Dockerfile.
117+
```
118+
$docker build -t fosslight .
119+
```
120+
2. Run with the image you built.
121+
ex. Output: /Users/fosslight_source_scanner/test_output, Path to be analyzed: tests/test_files
122+
```
123+
$docker run -it -v /Users/fosslight_source_scanner/test_output:/app/output fosslight -p tests/test_files -o output
124+
```
125+
114126
## 👏 How to report issue
115127

116128
Please report any ideas or bugs to improve by creating an issue in [fosslight_scanner repository][cl].

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ beautifulsoup4
99
fosslight_util>=1.4.1
1010
fosslight_dependency>=3.7.4
1111
fosslight_binary>=4.0.7
12-
fosslight_reuse>=2.2.1
12+
fosslight_prechecker>=3.0.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if __name__ == "__main__":
1616
setup(
1717
name='fosslight_scanner',
18-
version='1.6.12',
18+
version='1.7.1',
1919
package_dir={"": "src"},
2020
packages=find_packages(where='src'),
2121
description='FOSSLight Scanner',

src/fosslight_scanner/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
source\t\t Run FOSSLight Source
1717
dependency\t\t Run FOSSLight Dependency
1818
binary\t\t Run FOSSLight Binary
19-
reuse\t\t Run FOSSLight Reuse
19+
prechecker\t\t Run FOSSLight Prechecker
2020
all\t\t\t Run all scanners
2121
compare\t\t Compare two FOSSLight reports in yaml format
2222

src/fosslight_scanner/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def main():
1212
parser = ArgumentParser(description='FOSSLight Scanner', prog='fosslight_scanner', add_help=False)
13-
parser.add_argument('mode', nargs='?', help='source| dependency| binary| reuse| all| compare', default="all")
13+
parser.add_argument('mode', nargs='?', help='source| dependency| binary| prechecker| all| compare', default="all")
1414
parser.add_argument('--path', '-p', help='Path to analyze (In compare mode, two FOSSLight reports',
1515
dest='path', nargs='+', default="")
1616
parser.add_argument('--wget', '-w', help='Link to be analyzed', type=str, dest='link', default="")

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from fosslight_util.timer_thread import TimerThread
2121
import fosslight_util.constant as constant
2222
from fosslight_util.output_format import check_output_format
23-
from fosslight_reuse._fosslight_reuse import run_lint as reuse_lint
23+
from fosslight_prechecker._precheck import run_lint as prechecker_lint
2424
from .common import (copy_file, call_analysis_api,
2525
overwrite_excel, extract_name_from_link,
2626
merge_yamls)
@@ -100,7 +100,7 @@ def run_dependency(path_to_analyze, output_file_with_path, params=""):
100100

101101

102102
def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
103-
run_src=True, run_bin=True, run_dep=True, run_reuse=True,
103+
run_src=True, run_bin=True, run_dep=True, run_prechecker=True,
104104
remove_src_data=True, result_log={}, output_file="",
105105
output_extension="", num_cores=-1, db_url="",
106106
default_oss_name="", url=""):
@@ -130,14 +130,15 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
130130
"BIN": f"FL_Binary{output_extension}",
131131
"BIN_TXT": "FL_Binary.txt",
132132
"DEP": f"FL_Dependency{output_extension}",
133-
"REUSE": "FL_Reuse.yaml"}
134-
if run_reuse:
135-
output_reuse = os.path.join(_output_dir, output_files["REUSE"])
136-
success, result = call_analysis_api(src_path, "Reuse Lint",
137-
-1, reuse_lint,
133+
134+
"PRECHECKER": "FL_Prechecker.yaml"}
135+
if run_prechecker:
136+
output_prechecker = os.path.join(_output_dir, output_files["PRECHECKER"])
137+
success, result = call_analysis_api(src_path, "Prechecker Lint",
138+
-1, prechecker_lint,
138139
abs_path, False,
139-
output_reuse)
140-
success_file, copied_file = copy_file(output_reuse, output_path)
140+
output_prechecker)
141+
success_file, copied_file = copy_file(output_prechecker, output_path)
141142
if success_file:
142143
temp_output_fiiles.append(copied_file)
143144

@@ -323,13 +324,13 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
323324
run_src = False
324325
run_bin = False
325326
run_dep = False
326-
run_reuse = False
327+
run_prechecker = False
327328
remove_downloaded_source = False
328329
if output_path == "":
329330
output_path = _executed_path
330331

331-
if mode == "reuse":
332-
run_reuse = True
332+
if mode == "prechecker" or mode == "reuse":
333+
run_prechecker = True
333334
elif mode == "binary" or mode == "bin":
334335
run_bin = True
335336
elif mode == "source" or mode == "src":
@@ -340,7 +341,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
340341
run_src = True
341342
run_bin = True
342343
run_dep = True
343-
run_reuse = True
344+
run_prechecker = True
344345

345346
if src_path == "" and url_to_analyze == "":
346347
src_path, dep_arguments, url_to_analyze = get_input_mode()
@@ -357,7 +358,7 @@ def run_main(mode, path_arg, dep_arguments, output_file_or_dir, file_format, url
357358

358359
if src_path != "":
359360
run_scanner(src_path, dep_arguments, output_path, keep_raw_data,
360-
run_src, run_bin, run_dep, run_reuse,
361+
run_src, run_bin, run_dep, run_prechecker,
361362
remove_downloaded_source, {}, output_file,
362363
output_extension, num_cores, db_url,
363364
default_oss_name, url_to_analyze)

0 commit comments

Comments
 (0)