Skip to content

Commit c713f97

Browse files
authored
Merge pull request #9 from fosslight/develop
Change the parameters related to the scanner path
2 parents e61093d + 9baf0e2 commit c713f97

File tree

6 files changed

+14
-25
lines changed

6 files changed

+14
-25
lines changed

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tox
22
pytest
33
pytest-cov
4+
flake8==3.9.2
45
pytest-flake8

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ xlrd
55
openpyxl
66
progress
77
pyyaml
8-
fosslight_util>=1.3.1
8+
fosslight_util>=1.3.3
99
fosslight_dependency>=3.7.3

src/fosslight_scanner/_get_input.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ def get_input_mode():
3939
_PYTHON_VERSION = sys.version_info[0]
4040

4141
_input_path_msg = "Please enter the path to analyze:"
42-
_additional_msg = "\n(Enter if it is the same as "\
43-
+ "the source code analysis path)"
4442

4543
url_to_analyze = ""
4644
src_path = ""
@@ -53,18 +51,10 @@ def get_input_mode():
5351
2. Local source path\n"):
5452
success, url_to_analyze = get_input("Enter the link to analyze:", "")
5553
else:
56-
# 1. FOSSLight Source
57-
if ask_to_run("1. Do you want to analyze the source code? (y/n)"):
58-
success, src_path = get_input(_input_path_msg, "")
54+
success, src_path = get_input(_input_path_msg, "")
55+
dep_path = src_path
5956

60-
if src_path == "":
61-
_additional_msg = ""
62-
63-
# 2. FOSSLight Dependency
64-
if ask_to_run("3. Do you want to analyze the dependency? (y/n)"):
65-
success, dep_path = get_input(
66-
_input_path_msg + _additional_msg, src_path)
67-
success, dep_arguments = get_input(
68-
"Please enter arguments for dependency analysis:", "")
57+
success, dep_arguments = get_input(
58+
"Please enter arguments for dependency analysis:", "")
6959

7060
return src_path, dep_path, dep_arguments, url_to_analyze

src/fosslight_scanner/_help.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
-h\t\t\t\t\t Print help message
1616
-r\t\t\t\t\t Keep raw data
1717
-t\t\t\t\t\t Hide the progress bar
18-
-s <source_path>\t\t\t Path to analyze source
18+
-p <source_path>\t\t\t Path to analyze source, dependency
1919
-w <link>\t\t\t\t Link to be analyzaed can be downloaded by wget or git clone
2020
-o <output>\t\t\t\t Output directory or file
21-
-d <dependency_path> \t\t\t Path to analyze dependencies
22-
-d <dependency_path> -a <additional_arg> (Using with -d option) Additional arguments for running dependency analysis"""
21+
-d <dependency_argument> \t\t\t Additional arguments for running dependency analysis"""
2322

2423

2524
def print_help_msg():

src/fosslight_scanner/fosslight_scanner.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,11 @@ def main():
214214
for opt, arg in opts:
215215
if opt == "-h":
216216
print_help_msg()
217-
elif opt == "-s":
217+
elif opt == "-p":
218218
src_path = arg
219-
_cli_mode = True
220-
elif opt == "-d":
221219
dep_path = arg
222220
_cli_mode = True
223-
elif opt == "-a":
221+
elif opt == "-d":
224222
dep_arguments = arg
225223
elif opt == "-w":
226224
_cli_mode = True

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ norecursedirs = test_result_*
2424
[testenv:test_run]
2525
commands =
2626
fosslight -h
27-
rm -rf test_result_*
28-
fosslight -o test_result_local_path -s tests -d tests
27+
rm -rf test_result_local_path
28+
rm -rf test_result_wget
29+
fosslight -o test_result_local_path -p tests
2930
fosslight -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
3031

3132
[testenv:release]
@@ -34,6 +35,6 @@ deps =
3435

3536
commands =
3637
fosslight -h
37-
fosslight -o test_result_local_path -s tests -d tests
38+
fosslight -o test_result_local_path -p tests
3839
fosslight -o test_result_wget -w "https://github.com/LGE-OSS/example.git"
3940
pytest -v --flake8

0 commit comments

Comments
 (0)