cargo-attribution

Crates.iocargo-attribution
lib.rscargo-attribution
version
sourcesrc
created_at2023-10-07 05:12:57.756971
updated_at2024-12-01 01:51:43.465015
descriptionA cargo subcommand to give credit to your dependencies
homepage
repositoryhttps://github.com/ameknite/cargo-attribution
max_upload_size
id996096
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Ame アメ (ameknite)

documentation

https://docs.rs/cargo-attribution

README

cargo-attribution

License Crates.io Minimum Supported Rust Version CI

A cargo subcommand to give credit to your dependencies

Usage: cargo attribution [OPTIONS]

Options:
      --manifest-path <MANIFEST_PATH>
          Path to the Cargo.toml, [default: ./Cargo.toml]
      --current-dir <CURRENT_DIR>
          Directory of the cargo process, [default: .]
      --output-dir <OUTPUT_DIR>
          Directory of the output files, [default: ./attribution]
  -d, --dependencies-name <DEPENDENCIES_NAME>
          Dependencies file name [default: dependencies]
      --self-name <SELF_NAME>
          Self file name [default: self]
      --all-features
          Activate all available features
      --no-default-features
          Deactivate default features
      --features <FEATURES>
          Select features to activate, e.g. f1,f2,f3
      --filter-platform <FILTER_PLATFORM>
          Filter by target triple, e.g., "wasm32-unknown-unknown"
      --only-normal-dependencies
          Avoid dev, build, and unknown dependencies
  -h, --help
          Print help
  -V, --version
          Print version

Installation

Cargo install

Compile the crate yourself with:

cargo install cargo-attribution

Cargo binstall

Install a binary version:

cargo binstall cargo-attribution

Main Features

  • Download a general version of the licenses used by your dependencies. They are downloaded from the spdx license-list-data: https://github.com/spdx/license-list-data

  • Create a dependencies.toml file that contains metadata for the project's dependencies, and a self.toml file that includes metadata of the project itself, including copyright notices.

Example of a dependency:

[[dependencies]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
description = "Experimental WASI API bindings for Rust"
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
authors = ["The Cranelift Project Developers"]
repository = "https://github.com/bytecodealliance/wasi"

You can check the dependencies.toml file, self.toml and licenses generated for this project.

Purpose

This command allows you to comply with licenses that require you to retain the license and copyright notices, such as the MIT license, without the need to include the same license repeatedly.

MIT license extract:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

LICENSE

cargo-attribution is provided under the MPL v2.0 license. Refer to the LICENSE file for more details.

Commit count: 450

cargo fmt