| Crates.io | scancode-rust |
| lib.rs | scancode-rust |
| version | 0.0.4 |
| created_at | 2025-03-21 15:38:10.343201+00 |
| updated_at | 2025-05-17 12:23:06.643744+00 |
| description | A Rust-based tool for scanning and analyzing code. |
| homepage | |
| repository | https://github.com/mstykow/scancode-rust |
| max_upload_size | |
| id | 1600634 |
| size | 30,969,834 |
A high-performance code scanning tool written in Rust that detects licenses, copyrights, and other relevant metadata in source code.
scancode-rust is designed to be a faster alternative to the Python-based ScanCode Toolkit, aiming to produce compatible output formats while delivering significantly improved performance. This tool currently scans codebases to identify:
More ScanCode features coming soon!
You can download the appropriate binary for your platform from the GitHub Releases page. Simply extract the binary and place it in your system's PATH.
Alternatively, you can use the scancode-rust-installer.sh script to automatically download and install the correct binary for your architecture and platform:
curl -sSfL https://github.com/mstykow/scancode-rust/releases/latest/download/scancode-rust-installer.sh | sh
git clone https://github.com/yourusername/scancode-rust.git
cd scancode-rust
./setup.sh # Initialize the submodule and configure sparse checkout
cargo build --release
The compiled binary will be available at target/release/scancode-rust.
scancode-rust [OPTIONS] <DIR_PATH> --output-file <OUTPUT_FILE>
Options:
-o, --output-file <OUTPUT_FILE> Output JSON file path
-d, --max-depth <MAX_DEPTH> Maximum directory depth to scan [default: 50]
-e, --exclude <EXCLUDE>... Glob patterns to exclude from scanning
-h, --help Print help
-V, --version Print version
scancode-rust ~/projects/my-codebase -o scan-results.json --exclude "*.git*" "target/*" "node_modules/*"
scancode-rust is designed to be significantly faster than the Python-based ScanCode Toolkit, especially for large codebases. Performance improvements come from:
The tool produces JSON output compatible with ScanCode Toolkit, including:
Contributions are welcome! Please feel free to submit a Pull Request.
To contribute to scancode-rust, follow these steps to set up the repository for local development:
Install Rust
Ensure you have Rust installed on your system. You can install it using rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Clone the Repository
Clone the scancode-rust repository to your local machine:
git clone https://github.com/mstykow/scancode-rust.git
cd scancode-rust
Initialize the License Submodule
Use the following script to initialize the submodule and configure sparse checkout:
./setup.sh
Install Dependencies
Install the required Rust dependencies using cargo:
cargo build
Run Tests
Run the test suite to ensure everything is working correctly:
cargo test
Start Developing
You can now make changes and test them locally. Use cargo run to execute the tool:
cargo run -- [OPTIONS] <DIR_PATH>
If you want to update the embedded license data, simply run the setup.sh script:
./setup.sh
This will reconfigure the sparse checkout and fetch the latest changes. After updating the license data, rebuild the binary:
cargo build --release
This will embed the latest changes from the license-list-data repository into the binary.
This project is licensed under the Apache License 2.0.