-
-
Notifications
You must be signed in to change notification settings - Fork 249
Update Docs with Changes in Wiki #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2766963
Update Roadmap and other pages from Wiki
AyanSinhaMahapatra 807b440
Add Plugin Section and Other Minor Changes
AyanSinhaMahapatra a90c859
Update from Deltacode Wiki GSOC19 Report
AyanSinhaMahapatra 0021286
Add GSOC 2019 Final Report Porting to Python 3 from wiki
AyanSinhaMahapatra b26698a
Add "How to add a Post-Scan Plugin" Tutorial from Scancode Wiki
AyanSinhaMahapatra e980fe1
Add more help on stdout
AyanSinhaMahapatra 80cdc3f
Add stdout fix
AyanSinhaMahapatra 9cc37b1
Add gsoc19_final_report fix
AyanSinhaMahapatra c27a0e7
Add post-scan-plugin fix for plugin types
AyanSinhaMahapatra ebe950b
Fix Doc8 Style Errors
AyanSinhaMahapatra 562f966
Add requested change in ABCD.rst
AyanSinhaMahapatra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| Google Summer of Code 2019 - Final report | ||
| ========================================= | ||
|
|
||
| **Project: Approximately similar file detection in DeltaCode** | ||
| -------------------------------------------------------------- | ||
|
|
||
| **Arnav Mandal <arnav.mandal1234@gmail.com>** | ||
|
|
||
| Project Overview | ||
| ---------------- | ||
|
|
||
| DeltaCode is a tool to compare and report scan differences. It takes JSON files as an input which | ||
| is the output of ScanCode-toolkit as well. When comparing files, it only uses the exact comparison. | ||
| By exact comparison, I mean it compares the hash value of the files. The output of DeltaCode is a | ||
| JSON/CSV file which includes the details of the scan such as delta score, delta count, etc. The | ||
| goal of this project is to improve the usefulness of the delta by also finding files that are | ||
| mostly the same (e.g. quasi or near duplicates) vs. files that are completely different. After this | ||
| project, DeltaCode would be able to detect similar files in a directory approximately. | ||
|
|
||
| Requirements of the project | ||
| --------------------------- | ||
|
|
||
| - Provided two files using ScanCode-toolkit, the new near-duplicate detection should return the | ||
| distance between the two files. | ||
| - The code should be seamlessly integrated with ScanCode-toolkit. It should be highly configurable | ||
| by the maintainers. | ||
| - The strictness of near-duplicates should be noted and adjusted by a threshold variable. | ||
|
|
||
| The Project | ||
| ----------- | ||
|
|
||
| - Addition of new fingerprint plugin in the ScanCode Toolkit. | ||
| - Implementation and integration of the fingerprint generation algorithm in the ScanCode Toolkit | ||
| codebase. | ||
| - Implementation of distance finding algorithm between the files and process them further in the | ||
| DeltaCode codebase. | ||
| - Integration of fingerprint field in the JSON file to compare the deltas and provide them with | ||
| appropriate scores. | ||
| - Make changes to old unit tests and addition of new unit tests in ScanCode Toolkit as well as | ||
| DeltaCode. | ||
|
|
||
| I have completed all the tasks that were in the scope of this GSoC project. | ||
|
|
||
| Pull Requests | ||
| ------------- | ||
|
|
||
| - https://github.com/nexB/scancode-toolkit/pull/1576 [Closed] (something went wrong while rebasing) | ||
| - https://github.com/nexB/scancode-toolkit/pull/1651 [Merged] | ||
| - https://github.com/nexB/deltacode/pull/128 [Merged] | ||
|
|
||
| Links | ||
| ----- | ||
|
|
||
| .. | ||
| [Org Link] https://summerofcode.withgoogle.com/organizations/6118953540124672/ | ||
| [Project Link] https://summerofcode.withgoogle.com/projects/#6422961651712000 | ||
|
|
||
| - `Project Details <https://summerofcode.withgoogle.com/organizations/6118953540124672/>`_ | ||
| - `Proposal <https://docs.google.com/document/d/1XGUH4Ogovc8ZTt_bjZc7ML75E1NrhTlAtelckESpSGA/edit?usp=sharing>`_ | ||
| - `ScanCode Toolkit <https://github.com/nexB/scancode-toolkit>`_ | ||
| - `DeltaCode <https://github.com/nexB/deltacode>`_ | ||
|
|
||
| ------------ | ||
|
|
||
| I’ve had a wonderful time during these three months and have learned plenty of things. I would | ||
| really like to thank `@pombredanne <https://github.com/pombredanne>`_, | ||
| `@majurg <https://github.com/majurg>`_, and `@JonoYang <https://github.com/JonoYang>`_ for their | ||
| constant support throughout the journey. From good job claps to nit-picky constructive | ||
| code-reviews, I enjoyed every bit of this GSoC project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
102 changes: 102 additions & 0 deletions
102
docs/source/scancode-toolkit/contribute/gsoc19_final_report.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| Google Summer of Code 2017 - Final report | ||
| ========================================= | ||
|
|
||
| Project: **scancode-toolkit** to Python 3 | ||
| ----------------------------------------- | ||
|
|
||
| **Owner:** `Abhishek Kumar <https://github.com/Abhishek-Dev09>`_ | ||
|
|
||
| **Mentor:** `Philippe Ombredanne <https://github.com/pombredanne>`_ | ||
|
|
||
| Overview | ||
| -------- | ||
|
|
||
| **Problem:** Since Python 2.7 will retire in few months and will not be maintained any longer. | ||
|
|
||
| **Solution:** `Scancode <https://github.com/nexB/scancode-toolkit/>`__ needs to be ported to | ||
| python 3 and all test suites must pass on both version of Python. The main difference that | ||
| makes Python 3 better than Python 2.x is that the support for unicode is greatly improved in | ||
| Python 3. This will also be useful for scancode as scancode has users in more than 100 languages | ||
| and it's easy to translate strings from unicode to other languages. | ||
|
|
||
| **Objective**: To make scancode-toolkit installable on on Python 3.6 and higher, as presently it | ||
| installs with Python 2.7 only. | ||
|
|
||
| Implementation | ||
| -------------- | ||
|
|
||
| - It was started in development mode(editable mode) and then it was moved to work in virtual | ||
| environments. | ||
| - I have worked module by module according to the order of hierarchy of modules. For example :All | ||
| module is dependent on commoncode, so it must be ported first. In this way we have created the | ||
| Porting order: | ||
|
|
||
| 1. commoncode | ||
| 2. plugincode | ||
| 3. typecode | ||
| 4. extractcode | ||
| 5. textcode | ||
| 6. scancode basics (some tests are integration tests and will have to wait to be ported) | ||
| 7. formattedcode, starting with JSON (some tests are integration tests and will have to wait | ||
| to be ported) | ||
| 8. cluecode | ||
| 9. licensedcode | ||
| 10. packagedcode (depends on licensecode) | ||
| 11. summarycode | ||
| 12. fixup the remaining bits and tests | ||
|
|
||
| After porting each module, I have marked these modules as ported ``scanpy3`` with help of | ||
| **conffest** plugin (created by `@pombredanne <https://github.com/pombredanne>`_). **Conffest** | ||
| plugin is heart of this project. Without this, it was very difficult to do. Dependencies was fixed | ||
| at the time of porting the module where it was used. | ||
|
|
||
| Challenging part of Project | ||
| --------------------------- | ||
|
|
||
| It is very difficult to deal with paths on different operating systems.The issue is around | ||
| macOS/Windows/Linux. The first two OS handle unicode paths comfortably on Python 2 and 3 but not | ||
| completely on macOS Mojave because its filesystem encoding is APFS. Linux paths are bytes and | ||
| os.listdir is broken on Python 2. As a result you can only sanely handle Linux paths as bytes | ||
| on Python 2. But on Python 3 path seems to be corrected as ``unicode`` on Linux. | ||
|
|
||
| For more details visit here : | ||
|
|
||
| - https://vstinner.github.io/painful-history-python-filesystem-encoding.html | ||
| - `jaraco/path.py#130 <https://github.com/jaraco/path.py/issues/130>`__ | ||
|
|
||
| We came with various Solution: | ||
|
|
||
| - To use pathlib which generally handle paths correctly across platforms. And for backports we use | ||
| pathlib 2. But this solution also fails because pathlib 2 does not work as expected wrt unicode | ||
| vs bytes. And os.listdir also doesn't work properly. | ||
|
|
||
| - To use `path.py <https://pypi.org/project/path.py/>`__ which handles the paths across all the | ||
| platforms even on macOS Mojave . | ||
|
|
||
| - Use ``bytes`` on linux and python 3 and ``unicode`` everywhere. | ||
|
|
||
| We choose the third solution because it is most fundamental and simple and easy to use. | ||
|
|
||
| Project was tracked in this ticket `nexB/scancode-toolkit#295 <https://github.com/nexB/scancode-toolkit/issues/295>`__ | ||
|
|
||
| **Project link :** `Port Scancode to Python 3 <https://summerofcode.withgoogle.com/organizations/6118953540124672/>`__ | ||
|
|
||
| .. | ||
| [Org Link] https://summerofcode.withgoogle.com/organizations/6118953540124672/ | ||
| [Project Link] https://summerofcode.withgoogle.com/projects/#5969926387400704 | ||
|
|
||
| **My contribution :** `List of Commits <https://github.com/nexB/scancode-toolkit/commits?author=Abhishek-Dev09>`__ | ||
|
|
||
| **Note :** Please give your feedback `here <https://github.com/nexB/scancode-toolkit/issues/295>`_ | ||
|
|
||
| Outcome | ||
| ------- | ||
|
|
||
| Now we have liftoff on Python 3 . We are able to run basic scans without errors on develop branch. | ||
| You check it by running ``scancode -clipeu samples/ --json-pp - -n4`` . | ||
|
|
||
| At last I would like to thanks my Mentor **@pombredanne** aka | ||
| `Philippe Ombredanne <https://github.com/pombredanne>`__ . He has helped lot in completing this | ||
| project. He is very supportive and responsive. I have learned a lot from him. By his encouragement | ||
| and motivation, I am very improving day by day, building and developing my skills. I have completed | ||
| all the tasks that were in the scope of this GSoC project. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,5 @@ | |
| cut_new_release | ||
| contrib_doc | ||
| roadmap | ||
| gsoc_17_final_report | ||
| gsoc17_final_report | ||
| gsoc19_final_report | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,3 @@ | |
| faq | ||
| support | ||
| perf_report | ||
| plugin_arch | ||
| licence_policy_plugin | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| **Plugins** | ||
| ================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| plugin_arch | ||
| licence_policy_plugin | ||
| plugin_tutorials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Plugin Tutorials | ||
| ================ | ||
|
|
||
| - :ref:`how_to_add_post_scan_plugin` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Print to ``stdout`` (Terminal) | ||
| ------------------------------ | ||
|
|
||
| If you want to format the output in JSON and print it at stdout, you can replace the JSON filename | ||
| with a "-", like ``--json-pp -`` instead of ``--json-pp output.json``. | ||
|
|
||
| The following command will output the scan results in JSON format to ``stdout`` (In the Terminal):: | ||
|
|
||
| ./scancode -clpieu --json-pp - samples/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's 2019 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing This.