From b9954a64484f4680478adb5c4a98e82974ffce89 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Mon, 7 Jul 2025 11:09:50 +0800 Subject: [PATCH 1/5] Added note on recommended process number for optimal performance #2980 Signed-off-by: Chin Yeung Li --- docs/source/rst_snippets/core_options.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/source/rst_snippets/core_options.rst b/docs/source/rst_snippets/core_options.rst index 453763ca57..e7354cd926 100644 --- a/docs/source/rst_snippets/core_options.rst +++ b/docs/source/rst_snippets/core_options.rst @@ -25,3 +25,12 @@ All "Core" Scan Options including and below the starting point. INTEGER must be positive or zero for no limit. [Default: 0] + + +.. note:: + + For optimal performance, it's recommended to set the `-n, --processes` + option to "number of CPU cores minus 1". + For example, on a quad-core/eight-thread machine, use ``-n 7``. + + From a4d92197a69df6fc28a21b8734e88e730e41c807 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Mon, 7 Jul 2025 11:30:16 +0800 Subject: [PATCH 2/5] Removed duplicate content from "All Available Options" The `extractcode` and `scancode-reindex-licenses` are already in the "Other available CLIs" section. Signed-off-by: Chin Yeung Li --- docs/source/cli-reference/list-options.rst | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/source/cli-reference/list-options.rst b/docs/source/cli-reference/list-options.rst index 8e2f14fa12..17fb1e2b67 100644 --- a/docs/source/cli-reference/list-options.rst +++ b/docs/source/cli-reference/list-options.rst @@ -3,7 +3,8 @@ All Available Options ===================== -This section contains an exhaustive list of all ScanCode options, arranged in various sections. +This section contains an exhaustive list of all ScanCode-Toolkit options, +arranged in various sections. The sections are as follows: - Basic Scan Options @@ -13,25 +14,12 @@ The sections are as follows: - Pre-Scan Options - Post-Scan Options -There's also another section for ``extractcode`` options. - -The order of the sections and all their options is the same as in the :ref:`cli_help_text`, -available in the command line. - .. _cli_basic: .. include:: /rst_snippets/basic_options.rst ---- -.. include:: /rst_snippets/extract.rst - ----- - -.. include:: /rst_snippets/scancode-reindex-licenses.rst - ----- - .. include:: /rst_snippets/core_options.rst ---- From bc1c6551130ee4d7c0bdaa670c284dfc1c077f55 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Mon, 7 Jul 2025 12:01:37 +0800 Subject: [PATCH 3/5] Enhance description of the `--from-json` option #2562 Signed-off-by: Chin Yeung Li --- docs/source/cli-reference/core-options.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/source/cli-reference/core-options.rst b/docs/source/cli-reference/core-options.rst index c2fc6ae9e0..24b0fd44a2 100644 --- a/docs/source/cli-reference/core-options.rst +++ b/docs/source/cli-reference/core-options.rst @@ -84,6 +84,20 @@ Comparing Progress Message Options This inputs the scan results from ``sample.json``, runs the post-scan plugin ``--classify`` and outputs the results for this scan to ``sample_2.json``. + You can also convert the input .json file to other output format + without using any scan option. + + For instance,:: + + scancode --from-json sample.json --yaml sample.yml + + The above command takes ``sample.json`` as input and generates file in .yml formats. + + .. note:: + + This only works for options that require only the input JSON file; + options that rely on other files or source code will not work. + ---- .. _max_in_memory_option: From 6c46ab4b62d07e76bfed484db2b12cabbe8788a4 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Thu, 10 Jul 2025 10:17:49 +0800 Subject: [PATCH 4/5] Update documentation format Signed-off-by: Chin Yeung Li --- docs/source/cli-reference/core-options.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/cli-reference/core-options.rst b/docs/source/cli-reference/core-options.rst index 24b0fd44a2..ab53726e28 100644 --- a/docs/source/cli-reference/core-options.rst +++ b/docs/source/cli-reference/core-options.rst @@ -84,14 +84,14 @@ Comparing Progress Message Options This inputs the scan results from ``sample.json``, runs the post-scan plugin ``--classify`` and outputs the results for this scan to ``sample_2.json``. - You can also convert the input .json file to other output format + You can also convert the input ``.json`` file to other output format without using any scan option. For instance,:: scancode --from-json sample.json --yaml sample.yml - The above command takes ``sample.json`` as input and generates file in .yml formats. + The above command takes ``sample.json`` as input and generates file in ``.yml`` formats. .. note:: From 3c251f0a9aca05a1d57e3093087eee2b87f51155 Mon Sep 17 00:00:00 2001 From: Chin Yeung Li Date: Thu, 10 Jul 2025 10:18:29 +0800 Subject: [PATCH 5/5] Update note for ``--processess`` option Signed-off-by: Chin Yeung Li --- docs/source/rst_snippets/core_options.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/rst_snippets/core_options.rst b/docs/source/rst_snippets/core_options.rst index e7354cd926..a96dcbfc7e 100644 --- a/docs/source/rst_snippets/core_options.rst +++ b/docs/source/rst_snippets/core_options.rst @@ -29,8 +29,8 @@ All "Core" Scan Options .. note:: - For optimal performance, it's recommended to set the `-n, --processes` - option to "number of CPU cores minus 1". - For example, on a quad-core/eight-thread machine, use ``-n 7``. + For local machines running additional applications like browsers, IDEs, + or chat tools, it’s recommended to allocate (number of CPUs) minus 2, + or fewer, based on current CPU usage for optimal stability.