Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 98 additions & 45 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
================
ScanCode toolkit
================

A typical software project often reuses hundreds of third-party packages.
License and origin information is not always easy to find and not normalized:
ScanCode discovers and normalizes this data for you.

Read more about ScanCode here: `scancode-toolkit.readthedocs.io <https://scancode-toolkit.readthedocs.io/en/latest/>`_.

Why use ScanCode?
=======================
=================

- As a **standalone command line tool**, ScanCode is **easy to install**, run
and embed in your CI/CD processing pipeline. It runs on **Windows, macOS and Linux**.
and embed in your CI/CD processing pipeline. It runs on **Windows, MacOS and Linux**.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS is the correct case from what I can see on Apple's website

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, will correct this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!


- ScanCode is **used by several projects and organizations** such as the `Eclipse
Foundation <https://www.eclipse.org>`_, `OpenEmbedded.org <https://www.openembedded.org>`_,
Expand Down Expand Up @@ -37,8 +40,9 @@ Why use ScanCode?

- ScanCode is heavily **tested** with an automated test suite of over **8000 tests**.

See our roadmap for upcoming features:
https://github.com/nexB/scancode-toolkit/wiki/Roadmap
- ScanCode has extensive and updated Documentation help for users.

See our `roadmap <https://scancode-toolkit.readthedocs.io/en/latest/contribute/roadmap.html>`_ for upcoming features.

Build and tests status
======================
Expand All @@ -51,72 +55,123 @@ Build and tests status
|Develop| |devel-cov| | |devel-posix| | |devel-win| |
+-------+--------------+-----------------+--------------+

Documentation Build

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from the documentation link below?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is the Documentation Build (RTD) status, like the code build status often displayed on README's. The ones below are just links. Check it out here

-------------------

Quick Start
===========
+--------+--------------+
|Version | **RTD Build**|
+========+==============+
| Latest | |docs-rtd| |
+--------+--------------+

Install Python 2.7 then download and extract the latest ScanCode release from
https://github.com/nexB/scancode-toolkit/releases/

Then run ``./scancode -h`` for help.
Documentation
=============

The ScanCode documentation is hosted at `scancode-toolkit.readthedocs.io <https://scancode-toolkit.readthedocs.io/en/latest/>`_.

If you are new to Scancode, start `here <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/newcomer.html>`_.

Other Important Documentation Pages:

- A `Synopsis <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/synopsis.html>`_ of ScanCode Command Line Options
- Tutorials on `How to Run a Scan <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_run_a_scan.html>`_ and `How to Visualize Scan results <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_visualize_scan_results.html>`_
- An exhaustive List of `All Available Options <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html>`_
- Documentation on `Contributing to Code Development <https://scancode-toolkit.readthedocs.io/en/latest/contribute/contrib_dev.html>`_
- Documentation on `Plugin Architecture <https://scancode-toolkit.readthedocs.io/en/latest/plugins/plugin_arch.html>`_
- `FAQ <https://scancode-toolkit.readthedocs.io/en/latest/misc/faq.html>`_

See also https://aboutcode.org for related companion projects and tools.


Installation
============

Pre-requisites:
There are 3 main ways you can `install ScanCode <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html>`_.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move the bulk of this in an INSTALL.rst file instead? and only keep the simple happy installation path here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pombredanne could you elaborate.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay right. That would definitely be better IMHO, the README being smaller and more concise. Should I do that? In that case I'd only link to the installation documentation right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!


- Installation as an Application: Downloading Releases (Recommended)
- Installation as a library: via pip
- Installation from Source Code: Git Clone

Prerequisites
-------------

Before installing ScanCode make sure you've installed the prerequisites properly. This mainly
refers to installing the required Python interpreter (Python 3.6 is recommended).

- For Linux(Ubuntu): ``sudo apt install python3.6-dev bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev``
- For MacOS: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.6.pkg
- For Windows: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe

Refer `Prerequisites <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#prerequisites>`_ for detailed information on all different platforms and Python Versions.

Installation as an Application : Downloading Releases
-----------------------------------------------------

* On Windows, please follow the `Comprehensive Installation instructions
<https://github.com/nexB/scancode-toolkit/wiki/Comprehensive-Installation>`_.
Make sure you use Python 2.7 32 bits from
https://www.python.org/ftp/python/2.7.15/python-2.7.15.msi
#. Download and extract the latest ScanCode release from https://github.com/nexB/scancode-toolkit/releases/

* On macOS, install Python 2.7 from
https://www.python.org/ftp/python/2.7.15/python-2.7.15-macosx10.6.pkg
#. Open a terminal window and then `cd` to the extracted ScanCode directory.

Next, download and extract the latest ScanCode release from
https://github.com/nexB/scancode-toolkit/releases/
#. Run this command to self-configure and display the help-text.

* On Linux install the Python 2.7 "devel" and these packages using your
distribution package manager:
- Linux/Mac : ``./scancode --help``
- Windows : ``scancode --help``

* On Ubuntu 14, 16 and 18 use:
``sudo apt-get install python-dev xz-utils zlib1g libxml2-dev libxslt1-dev bzip2``
Installation as a library: via pip
----------------------------------

* On Debian and Debian-based distros use:
``sudo apt-get install python-dev xz-utils zlib1g libxml2-dev libxslt1-dev libbz2-1.0``
#. Create a Python 3.6 Virtual Environment and activate the same::

* On RPM distros use:
``sudo yum install python-devel xz-libs zlib libxml2-devel libxslt-devel bzip2-libs``
virtualenv -p /usr/bin/python3.6 venv-scancode && source venv-scancode/bin/activate

* On Fedora 22 and later use:
``sudo dnf install python-devel xz-libs zlib libxml2-devel libxslt-devel bzip2-libs``
#. Run ``pip install scancode-toolkit``

* See also the `Comprehensive Installation instructions
<https://github.com/nexB/scancode-toolkit/wiki/Comprehensive-Installation>`_
for additional instructions.
Installation from Source Code: Git Clone
----------------------------------------

#. Download the Source Code or Use Git Clone::

Next, download and extract the latest ScanCode release from
https://github.com/nexB/scancode-toolkit/releases/
git clone https://github.com/nexB/scancode-toolkit.git
cd scancode-toolkit

#. You can jump to any checkpoint/Branch/Commit using the following command::

Open a terminal window and then `cd` to the extracted ScanCode directory and run
this command to display help. ScanCode will self-configure if needed::
git checkout master

./scancode --help
#. Run the Configure Script

- On Linux/Mac: ``./configure``
- On Windows: ``configure``


Note the `Commands will vary <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#commands-variation>`_ across different Installation methods and Platforms.

If this displays the `Help Text <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/help-text-options.html#help-text>`_, you are all set to start using ScanCode.


Quick Start
===========

Note the `Commands Variation <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#commands-variation>`_ across Installation methods and Platforms.

You can run an example scan printed on screen as JSON::

./scancode -clip --json-pp - samples

Follow the `How to Run a Scan <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_run_a_scan.html>`_ Tutorial
to perform a basic scan on the ``samples`` directory distributed by default with Scancode.

See more command examples::

./scancode --examples

Refer `How to set what will be detected in Scan <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_set_what_will_be_detected_in_a_scan.html>`_
and `How to specify Scancode Output Format <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_format_scan_output.html>`_ for more information.

You can also refer to `Command Line Options Synopsis <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/synopsis.html>`_ and an exhaustive List of `All Available Options <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html>`_.

Archive extraction
===================
==================

The archives that exist in a codebase must be extracted before running a scan:
ScanCode does not extract files from tarballs, zip files, etc. as part of the
Expand All @@ -126,14 +181,7 @@ the mytar.tar.bz2-extract directory::

./extractcode mytar.tar.bz2


Documentation & FAQ
===================

https://github.com/nexB/scancode-toolkit/wiki

See also https://aboutcode.org for related companion projects and tools.

Refer `All Extractcode Options <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html#all-extractcode-options>`_ and `How To Extract Archives <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_extract_archives.html>`_ for more information.

Support
=======
Expand All @@ -151,6 +199,7 @@ For discussions and chats, we have:
You can use your favorite IRC client or use the web chat at
https://webchat.freenode.net/

* a Gitter channel to discuss Documentation at https://gitter.im/aboutcode-org/gsod-season-of-docs

Source code and downloads
=========================
Expand Down Expand Up @@ -192,3 +241,7 @@ the third-party code used in ScanCode for more details.
.. |devel-win| image:: https://ci.appveyor.com/api/projects/status/4webymu0l2ip8utr/branch/develop?png=true
:target: https://ci.appveyor.com/project/nexB/scancode-toolkit
:alt: Windows Develop branch tests status

.. |docs-rtd| image:: https://readthedocs.org/projects/scancode-toolkit/badge/?version=latest
:target: https://scancode-toolkit.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
28 changes: 16 additions & 12 deletions docs/source/cli-reference/synopsis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,30 @@ Toolkit Command Line Interface in the following sections:
Installation
------------

Scancode-Toolkit installation can be installed from ``pip``, the default Python Package Manager.
However, there are more ways to perform an installation, and refer the following sections for
Scancode-Toolkit installation can be done by downloading ScanCode as an application, which
is recommended generally. For users who wish to use ScanCode as a library, it can be
installed via ``pip``, the default Python Package Manager. Refer the following sections for
detailed Instructions on the each of the Installation Methods.

- :ref:`app_install`
- :ref:`pip_install`
- :ref:`latest_release_download_install`
- :ref:`source_configure_install`
- :ref:`source_code_install`

.. _synopsis_quickstart:

Quickstart
----------

The basic command to perform a scan, if Scancode is installed from ``pip``::
The basic command to perform a scan, in case of a download and configure installation
(on Linux/MacOS) is::

scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <SCAN INPUT>
path/to/scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <SCAN INPUT>

The basic usage in case of a download and configure installation (on Linux/MacOS) is::
The basic usage, if Scancode is installed from ``pip``, or in Windows::

path/to/scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <SCAN INPUT>
scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <SCAN INPUT>

.. include:: /rst_snippets/tip_snippets/synopsis_quickstart.rst
.. include:: /rst_snippets/note_snippets/synopsis_install_quickstart.rst

Here Scancode scans the <SCAN INPUT> file or directory for license, origin and packages and saves
results to FILE(s) using one or more output format option. Error and progress are printed to
Expand All @@ -64,10 +66,12 @@ While a scan using absolute paths from the file system root will look like::
home/ayansm/software/scancode-toolkit-3.1.1/scancode -clpieu --json-pp home/ayansm/scan_scan_results/output.json home/ayansm/codebases/samples/

Commands similar to ``scancode --clpi --json-pp output.json samples`` will be used as examples
throughout the documentation. Here we are inside the ``virtualenv`` where Scancode-Toolkit was
installed by ``pip``, and the default ``samples`` folder is being scanned, which is distributed
by default with Scancode-Toolkit.
throughout the documentation.

- Here we are inside the ``virtualenv`` where Scancode-Toolkit is configured.

- And the default ``samples`` folder is being scanned, which is distributed by default with
Scancode-Toolkit.

.. _scancode_cli_options:

Expand Down
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
# This points to aboutcode.readthedocs.io
# In case of "undefined label" ERRORS check docs on intersphinx to troubleshoot
# Link was created at commit - https://github.com/nexB/aboutcode/commit/faea9fcf3248f8f198844fe34d43833224ac4a83

intersphinx_mapping = {'aboutcode': ('https://aboutcode.readthedocs.io/en/latest/', None),
'scancode-workbench': ('https://scancode-workbench.readthedocs.io/en/develop/', None)}

Expand Down
Loading