Skip to content

Improve documentation #4467

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Improve documentation #4467

wants to merge 5 commits into from

Conversation

chinyeungli
Copy link
Contributor

Fixes
#2980 Added note on recommended process number for optimal performance
#2562 Enhance description of the --from-json option
Removed duplicate content from "All Available Options"

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • [] Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

The failing tests don't related to the documentation update.

Signed-off-by: Chin Yeung Li tli@nexb.com

The `extractcode` and `scancode-reindex-licenses` are already in the "Other available CLIs" section.

Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

Thanks @chinyeungli looks good.
See my comments for your consideration


.. note::

For optimal performance, it's recommended to set the `-n, --processes`
Copy link
Member

Choose a reason for hiding this comment

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

@chinyeungli this was merged as default with #4104
See also docs above which was changed:

[Default: (number of CPUs)-1]

This explanation is nice, but we need to modify this a bit.
We could also say it's safer to use (number of CPUs)-2 for local machines with other applications (browser/IDEs/chatrooms etc) open, or even less after looking at current CPU usage.

We should probably have a seperate section on performance and explanations, but this can be done a bit more explicitly as a sub-task of #4069 eith detailed explanations and recommendations on CPU/memory

.. _cli_basic:

.. include:: /rst_snippets/basic_options.rst

----

.. include:: /rst_snippets/extract.rst
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we want to remove these sections, they are pretty useful IMHO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AyanSinhaMahapatra I'm removing this from the list-options since extract.rst is already included in other-commands.rst. Having it in both places seem redundant.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can also convert the input .json file to other output format
You can also convert the input ``.json`` file to other output format


.. note::

This only works for options that require only the input JSON file;
Copy link
Member

Choose a reason for hiding this comment

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

Generally the post-scan options (like --summary, --todo) are configured to just operate on the codebase (with top-level licenses/packages etc and all resource level results) and this should work fine with --from-json
The core scan options (like --license --info) and pre-scan options cannot be run here. There are some post-scan options which have required options as dependencies, so those also need to be there in the loaded scan if those options are being specified.

Copy link
Contributor Author

@chinyeungli chinyeungli Jul 10, 2025

Choose a reason for hiding this comment

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

@AyanSinhaMahapatra I am wondering is it true that all the "Pre-Scan" options cannot be run with --from-json?
https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html#all-pre-scan-options
It seems to be the "--ignore" and "--include" don't really need the code files to have it work (I didn't look at the source code to verify it). Also, https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/core-options.html#from-json-option , the current --from-json` is usung --classify`` as a sample.

For the post-scans, I want to verify that if an option's dependencies are missing, the command still executes without errors, it just won’t return results related to the missing dependencies, correct?

Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants