big-code-analysis-cli 1.0.0

Tool to compute and export code metrics
Documentation
[package]
name = "big-code-analysis-cli"
version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository = "https://github.com/dekobon/big-code-analysis/blob/main/big-code-analysis-cli/"
keywords = ["metrics"]
description = "Tool to compute and export code metrics"

[[bin]]
name = "bca"
path = "src/main.rs"

[dependencies]
clap = { version = "^4.0", features = ["derive"] }
globset = "^0.4"
ignore = "^0.4"
# The CLI exposes every language `bca` advertises, so it pins the
# library's full feature set explicitly. Disabling default features
# here would silently drop grammars from the CLI build. See #252.
big-code-analysis = { path = "..", version = "=1.0.0", default-features = false, features = [
  "all-languages",
] }
serde = { version = "^1.0", features = ["derive"] }
serde_cbor = "^0.11"
serde_json = "^1.0"
serde_yaml = "^0.9"
toml = "^1.1"

[lints]
workspace = true

[dev-dependencies]
assert_cmd = "^2.0"
csv = "=1.4.0"
insta = "1.29.0"
jsonschema = "^0.46"
predicates = "^3.0"
quick-xml = "^0.39"
tempfile = "^3.0"

# Debian/Ubuntu packaging — consumed by `cargo deb` in release CI.
# The binary asset path `target/release/bca` is rewritten by cargo-deb
# to `target/<triple>/release/bca` when `--target` is passed; all other
# asset source paths are resolved relative to this crate's Cargo.toml.
# `name` is intentionally omitted — cargo-deb defaults the deb package
# name to the cargo package name (`big-code-analysis-cli`), which is
# what we want.
[package.metadata.deb]
maintainer = "Elijah Zupancic <elijah@zupancic.name>"
section = "devel"
priority = "optional"
extended-description = """\
Compute maintainability metrics for source code in many languages.

big-code-analysis-cli ships the `bca` command, which extracts metrics
(cognitive complexity, cyclomatic, Halstead, LOC, maintainability index,
ABC, exit points, and more) from source code via tree-sitter parsers
for C, C++, JavaScript, TypeScript, Python, Java, C#, Go, Kotlin, Rust,
Bash, Lua, Perl, PHP, and Tcl. Reports can be emitted as JSON, YAML,
TOML, CBOR, or rendered as Markdown / HTML.\
"""
assets = [
  [
    "target/release/bca",
    "usr/bin/",
    "755",
  ],
  [
    "../README.md",
    "usr/share/doc/big-code-analysis-cli/README.md",
    "644",
  ],
  [
    "../LICENSE",
    "usr/share/doc/big-code-analysis-cli/LICENSE",
    "644",
  ],
  # Per-binary TPL — covers bca's dep closure (clap + ignore + lib +
  # grammars). bca-web's actix-web/tokio/futures deps are NOT in this
  # file; they ship in THIRD-PARTY-LICENSES-bca-web.md alongside the
  # web crate's deb.
  [
    "../THIRD-PARTY-LICENSES-bca.md",
    "usr/share/doc/big-code-analysis-cli/THIRD-PARTY-LICENSES-bca.md",
    "644",
  ],
  # Man pages. Generated by the workspace `xtask` (`cargo xtask`) and
  # checked into `man/` at the repo root; CI gates them against
  # drift. dpkg's post-install hook gzips pages under
  # /usr/share/man/man1, so we ship them uncompressed and let dpkg do
  # the rest.
  [
    "../man/bca.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-check.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-count.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-dump.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-find.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-functions.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-list-metrics.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-metrics.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-ops.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-preproc.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-report.1",
    "usr/share/man/man1/",
    "644",
  ],
  [
    "../man/bca-strip-comments.1",
    "usr/share/man/man1/",
    "644",
  ],
]

# RHEL/Rocky/Fedora/Amazon Linux packaging — consumed by
# `cargo generate-rpm` in release CI. Source paths are resolved
# relative to this crate's Cargo.toml. `name` is intentionally
# omitted — defaults to the cargo package name.
[package.metadata.generate-rpm]
summary = "Compute maintainability metrics for source code in many languages (CLI)"
license = "MPL-2.0"
vendor = "Elijah Zupancic"
url = "https://github.com/dekobon/big-code-analysis"
# `doc = true` marks a file as `%doc` in the generated spec, which
# Fedora's container images (and any system with `tsflags=nodocs` in
# dnf.conf) filter out on install. Keep `%doc` only on the README —
# the LICENSE / THIRD-PARTY-LICENSES files are compliance artefacts
# and must not be filtered out.
assets = [
  { source = "../target/release/bca", dest = "/usr/bin/bca", mode = "755" },
  { source = "../README.md", dest = "/usr/share/doc/big-code-analysis-cli/README.md", mode = "644", doc = true },
  { source = "../LICENSE", dest = "/usr/share/doc/big-code-analysis-cli/LICENSE", mode = "644" },
  { source = "../THIRD-PARTY-LICENSES-bca.md", dest = "/usr/share/doc/big-code-analysis-cli/THIRD-PARTY-LICENSES-bca.md", mode = "644" },
  { source = "../man/bca.1", dest = "/usr/share/man/man1/bca.1", mode = "644" },
  { source = "../man/bca-check.1", dest = "/usr/share/man/man1/bca-check.1", mode = "644" },
  { source = "../man/bca-count.1", dest = "/usr/share/man/man1/bca-count.1", mode = "644" },
  { source = "../man/bca-dump.1", dest = "/usr/share/man/man1/bca-dump.1", mode = "644" },
  { source = "../man/bca-find.1", dest = "/usr/share/man/man1/bca-find.1", mode = "644" },
  { source = "../man/bca-functions.1", dest = "/usr/share/man/man1/bca-functions.1", mode = "644" },
  { source = "../man/bca-list-metrics.1", dest = "/usr/share/man/man1/bca-list-metrics.1", mode = "644" },
  { source = "../man/bca-metrics.1", dest = "/usr/share/man/man1/bca-metrics.1", mode = "644" },
  { source = "../man/bca-ops.1", dest = "/usr/share/man/man1/bca-ops.1", mode = "644" },
  { source = "../man/bca-preproc.1", dest = "/usr/share/man/man1/bca-preproc.1", mode = "644" },
  { source = "../man/bca-report.1", dest = "/usr/share/man/man1/bca-report.1", mode = "644" },
  { source = "../man/bca-strip-comments.1", dest = "/usr/share/man/man1/bca-strip-comments.1", mode = "644" },
]
auto-req = "disabled"