fossology / atarashi

Atarashi scans for license statements in open source software, focusing on text statistics. Designed to work stand-alone and with FOSSology.
http://fossology.github.io/atarashi
GNU General Public License v2.0
26 stars 23 forks source link

Feature added : Scanning of directories (Issue #77) #82

Closed SinghShreya05 closed 3 years ago

SinghShreya05 commented 3 years ago
  1. Made changes in atarashii.py file
  2. Added a "scandir" function
  3. Added a "--scandir" in ArgumentParser

This is with respect to issue #77. Please review the PR. @hastagAB @Kaushl2208

SinghShreya05 commented 3 years ago
  1. Checked whether "inputFile" is either a file or a directory.
  2. If it's a directory, every file inside the directory or sub-directories will be scanned and for each file "atarashii_runner" will be called.
  3. Each result will be printed as they come and will be stored in JSON.
  4. Every change is made in the "atarashii.py" file itself.

This is with respect to issue #77. Please review @GMishx

SinghShreya05 commented 3 years ago
  1. Corrected Indentation from 4 to 2 spaces.
  2. Fixed printing of output of each scan as the result comes.
  3. Fixed formatting of JSON output to get the desired format.

Kindly review it @GMishx

GMishx commented 3 years ago

Tried running the code, got following error:

$ atarashi -a Ngram -s BigramCosineSim atarashi/libs/
Traceback (most recent call last):
  File "/atarashi/.venv/bin/atarashi", line 33, in <module>
    sys.exit(load_entry_point('atarashi', 'console_scripts', 'atarashi')())
  File "/atarashi/atarashi/atarashii.py", line 153, in main
    for dirpath, dirnames, filenames in os.walk(filepath):
NameError: name 'filepath' is not defined
SinghShreya05 commented 3 years ago
  1. Implemented json.dumps() instead of simple print.
  2. The array generated contains "," between two objects.
SinghShreya05 commented 3 years ago
  1. Removed "dirresult" variable from the main function.
  2. Changed the argparse input "inputFile" to "inputPath" and the help message as well. Please review it.
GMishx commented 3 years ago

@SinghShreya05 , since we try to keep our git history clean and this PR adds a single feature (which can not be divided into multiple commits), can you please squash the commits into single commit before we can merge it?

SinghShreya05 commented 3 years ago

@GMishx I have created a new branch "feat/scandirectory" and sent a new pull request with just one commit. I'm closing this PR.

Kaushl2208 commented 3 years ago

@SinghShreya05, That's not how this works. He will need to review and test the functionality again. It will cost more time and energy. Try squashing the commits for the PR which is approved.