An open API service indexing awesome lists of open source software.

https://github.com/swift-nav/nocuckoo

A command-line tool for scanning source code files for license information and check compliance
https://github.com/swift-nav/nocuckoo

foss license-checking

Last synced: 5 months ago
JSON representation

A command-line tool for scanning source code files for license information and check compliance

Awesome Lists containing this project

README

          

# nocuckoo

(Pronounced noʊˈku:ku:)

![nocuckoo](docs/nocuckoo.png)

A command-line tool for scanning source code files to detect and extract license information. This tool helps developers and organizations maintain compliance by identifying licenses in their codebase.

The name is inspired by the cuckoo bird, a brood parasite that lays its eggs in other birds' nests. Similarly, developers want to avoid incorporating foreign work into their products unknowingly. The name also refers to avoiding being "cuckoo" (foolish) by monitoring third-party license usage across a codebase.

## Features

- Scan source code files for license information
- Highly configurable file extensions and ignore patterns
- Directly integratable into a CI solution
- Whitelist support for accepted licenses
- Support for multiple report output formats:
- Standard output (stdout) for human-readable results
- JSON output for programmatic processing
- HTML output for web-based viewing and sharing

## Design Goals

- Performance focused (scans 10,000 files in < 30s)
- High test coverage
- Well documented

## Installation

For just using the tool, install it via:

```bash
cargo install --git https://github.com/swift-nav/nocuckoo
```

In case you want to contribute to the project, follow these steps to clone the sources:

```bash
# Clone the repository
git clone https://github.com/yourusername/nocuckoo.git
cd nocuckoo

# Run the project
cargo run --release
```

### License Database

This tool requires a license database to match licenses against.
The database must be a directory consisting of JSON files in the SPDX format.
Please download the database directly from [SPDX](https://github.com/spdx/license-list-data/tree/main/json/details).

## Usage

Basic usage:

```bash
nocuckoo [OPTIONS] --licenses ...
```

Invoke `nocuckoo --help` for detailed information.

## Output Formats

### Stdio Output

Prints a report with overall statistics and a tabular per-file summary.

### JSON Output

Outputs a JSON file with detailed report information for further processing.

### HTML Output

Generates a formatted HTML report with the same information as the Stdio report.

## License

See [LICENSE](LICENSE)