From 2010f2197b5cac45fe4ffc9d86f1f37394d40e8e Mon Sep 17 00:00:00 2001 From: "John M. Horan" Date: Tue, 6 Feb 2018 11:15:58 -0800 Subject: [PATCH 1/3] Convert README to .rst #53 Signed-off-by: John M. Horan --- README.md | 53 -------------------------- README.rst | 90 ++++++++++++++++++++++++++++++++++++++++++++ src/deltacode/cli.py | 6 +-- 3 files changed, 93 insertions(+), 56 deletions(-) delete mode 100644 README.md create mode 100644 README.rst diff --git a/README.md b/README.md deleted file mode 100644 index b3b4138d..00000000 --- a/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Deltacode -Travis CI Status: ![travis-icon](https://travis-ci.com/nexB/deltacode.svg?token=XLgwFRMFsRd6Szjm55tE&branch=develop) - -### About: -`deltacode` is a simple command line utility that leverages the power of -[scancode-toolkit](https://github.com/nexB/scancode-toolkit) to determine file-level -differences between two codebases. - -### How to use: -In order to calculate these differences (i.e. 'deltas'), the user must have two individual -scancode scan files, with the `--info` scan option at minimum. - -For example: -``` -$ pip install scancode-toolkit -$ scancode --info ~/postgresql-9.6/ ~/psql-9.6-fileinfo.json -$ scancode --info ~/postgresql-10.0/ ~/psql-10.0-fileinfo.json -``` - -Once you have the two codebase scans, simply install/configure deltacode, and run it -on the two scans: -``` -$ source configure -(deltacode) $ deltacode --help - -Usage: deltacode [OPTIONS] - - This script identifies the changes that need to be made to the 'old' scan - file (-o or -old) in order to generate the 'new' scan file (-n or -new). - The results are written to a .csv file (-c or -csv-file) or a .json file - (-j or -json-file) at a user-designated location. If no file option is - selected, the JSON results are printed to the console. - -Options: - -h, --help Show this message and exit. - -n, --new PATH Identify the path to the "new" scan file [required] - -o, --old PATH Identify the path to the "old" scan file [required] - -c, --csv-file PATH Identify the path to the .csv output file - -j, --json-file PATH Identify the path to the .json output file - -(deltacode) $ deltacode -n ~/psql-10.0-fileinfo.json -o ~/psql-9.6-fileinfo.json -j ~/psql-10.0-psql-9.6.5-delta.json -``` - -# Problems? -Open an [issue](https://www.github.com/nexb/deltacode/issues). - -### Notes: -* `deltacode` also collects statistical information, like # of files and other percentages. Currently, this output is not present in the `csv` output - -### Future TODOs/additions: -* Use `copyright` information from scans to identify changes in copyright holders or dates for attribution. -* Detect package or file changes that are only a version change for the same package or file. -* Determine whether some added/removed files or packages are actually cases where the files or packages were moved. diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..cf215435 --- /dev/null +++ b/README.rst @@ -0,0 +1,90 @@ +========= +Deltacode +========= + + +--------------+----------------------------------------------------------------------------------------------+ + | **Branch** | **Linux (Travis)** | + +--------------+----------------------------------------------------------------------------------------------+ + | develop |.. image:: https://travis-ci.com/nexB/deltacode.svg?token=9MXbiHv3xZxwT2egFxby&branch=develop | + | | :target: https://travis-ci.com/nexB/deltacode | + +--------------+----------------------------------------------------------------------------------------------+ + +About: +====== + +``deltacode`` is a simple command line utility that leverages the power +of `scancode-toolkit `_ to determine file-level differences between two +codebases. + +How to use: +=========== + +In order to calculate these differences (i.e. 'deltas'), the user must have two individual +scancode scan files, with the ``--info`` scan option at minimum. + +For example:: + + $ pip install scancode-toolkit + $ scancode --info ~/postgresql-9.6/ ~/psql-9.6-fileinfo.json + $ scancode --info ~/postgresql-10.0/ ~/psql-10.0-fileinfo.json + + + +Once you have the two codebase scans, simply install/configure +deltacode, and run it on the two scans:: + + $ source configure + (deltacode) $ deltacode --help + + Usage: deltacode [OPTIONS] + + Identify the changes that need to be made to + the 'old' scan file (-o or --old) in order to + generate the 'new' scan file (-n or --new). + Write the results to a .csv file (-c or --csv- + file) or a .json file (-j or --json-file) at a + user-designated location. If no file option + is selected, print the JSON results to the + console. + + Options: + -h, --help Show this message and + exit. + -n, --new PATH Identify the path to + the "new" scan file + [required] + -o, --old PATH Identify the path to + the "old" scan file + [required] + -c, --csv-file PATH Identify the path to + the .csv output file + -j, --json-file FILENAME Identify the path to + the .json output file + -a, --all-delta-types Include unmodified + files as well as all + changed files in the + .json or .csv output. + If not selected, only + changed files are + included. + + (deltacode) $ deltacode -n ~/psql-10.0-fileinfo.json -o ~/psql-9.6-fileinfo.json -j ~/psql-10.0-psql-9.6-delta.json + +========= +Problems? +========= + +Open an `issue `_. + +Notes: +====== + +- ``deltacode`` also collects statistical information, like # of files and other percentages. Currently, this output is not present in the ``csv`` output + +Future TODOs/additions: +======================= + +- Use ``copyright`` information from scans to identify changes in copyright holders or dates for attribution. +- Detect package or file changes that are only a version change for the same package or file. +- Determine whether some added/removed files or packages are actually cases where the files or packages were moved. + diff --git a/src/deltacode/cli.py b/src/deltacode/cli.py index 475ba7aa..9167fef6 100644 --- a/src/deltacode/cli.py +++ b/src/deltacode/cli.py @@ -92,9 +92,9 @@ def write_json(deltacode, outfile, all_delta_types=False): def cli(new, old, csv_file, json_file, all_delta_types): """ Identify the changes that need to be made to the 'old' - scan file (-o or -old) in order to generate the 'new' scan file (-n or - -new). Write the results to a .csv file (-c or -csv-file) or a - .json file (-j or -json-file) at a user-designated location. If no file + scan file (-o or --old) in order to generate the 'new' scan file (-n or + --new). Write the results to a .csv file (-c or --csv-file) or a + .json file (-j or --json-file) at a user-designated location. If no file option is selected, print the JSON results to the console. """ # retrieve the option selections From 73fcc93f666ae264fea7e2b5b649fa4bf8a7e8a5 Mon Sep 17 00:00:00 2001 From: Steven Esser Date: Tue, 6 Feb 2018 12:18:46 -0800 Subject: [PATCH 2/3] Fix codeblock formatting #53 Signed-off-by: Steven Esser --- README.rst | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/README.rst b/README.rst index cf215435..4326c315 100644 --- a/README.rst +++ b/README.rst @@ -33,41 +33,27 @@ For example:: Once you have the two codebase scans, simply install/configure deltacode, and run it on the two scans:: - $ source configure (deltacode) $ deltacode --help - Usage: deltacode [OPTIONS] - Identify the changes that need to be made to - the 'old' scan file (-o or --old) in order to - generate the 'new' scan file (-n or --new). - Write the results to a .csv file (-c or --csv- - file) or a .json file (-j or --json-file) at a - user-designated location. If no file option - is selected, print the JSON results to the - console. + Identify the changes that need to be made to the 'old' scan file (-o or + --old) in order to generate the 'new' scan file (-n or --new). Write the + results to a .csv file (-c or --csv-file) or a .json file (-j or --json- + file) at a user-designated location. If no file option is selected, print + the JSON results to the console. Options: - -h, --help Show this message and - exit. - -n, --new PATH Identify the path to - the "new" scan file - [required] - -o, --old PATH Identify the path to - the "old" scan file - [required] - -c, --csv-file PATH Identify the path to - the .csv output file - -j, --json-file FILENAME Identify the path to - the .json output file - -a, --all-delta-types Include unmodified - files as well as all - changed files in the - .json or .csv output. - If not selected, only - changed files are - included. - + -h, --help Show this message and exit. + -n, --new PATH Identify the path to the "new" scan file + [required] + -o, --old PATH Identify the path to the "old" scan file + [required] + -c, --csv-file PATH Identify the path to the .csv output file + -j, --json-file FILENAME Identify the path to the .json output file + -a, --all-delta-types Include unmodified files as well as all changed + files in the .json or .csv output. If not + selected, only changed files are included. + (deltacode) $ deltacode -n ~/psql-10.0-fileinfo.json -o ~/psql-9.6-fileinfo.json -j ~/psql-10.0-psql-9.6-delta.json ========= From 95391f4273783b64c51bbd1316daa32069e4d6fa Mon Sep 17 00:00:00 2001 From: Steven Esser Date: Tue, 6 Feb 2018 12:25:38 -0800 Subject: [PATCH 3/3] Update MANIFEST files to reflect new filename #53 Signed-off-by: Steven Esser --- MANIFEST.in | 8 ++++---- etc/release/MANIFEST.in.release | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 95a1d3c0..a6fb0d71 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,15 +2,15 @@ graft src graft etc graft thirdparty -graft tests +recursive-exclude thirdparty/dev * +prune tests -prune src/deltacode.egg-info +include deltacode.ABOUT include AUTHORS.rst include CHANGELOG.rst -include README.md +include README.rst include apache-2.0.LICENSE -include deltacode.ABOUT include NOTICE include MANIFEST.in include setup.py diff --git a/etc/release/MANIFEST.in.release b/etc/release/MANIFEST.in.release index 02fcf6be..a6fb0d71 100644 --- a/etc/release/MANIFEST.in.release +++ b/etc/release/MANIFEST.in.release @@ -9,7 +9,7 @@ prune tests include deltacode.ABOUT include AUTHORS.rst include CHANGELOG.rst -include README.md +include README.rst include apache-2.0.LICENSE include NOTICE include MANIFEST.in