cargo-workspace-analyzer

Crates.iocargo-workspace-analyzer
lib.rscargo-workspace-analyzer
version0.3.1
sourcesrc
created_at2024-10-27 13:58:24.449128
updated_at2024-11-08 23:16:42.193768
descriptionA CLI tool that prases manifest files and gives insights about the workspace
homepage
repositoryhttps://github.com/jaads/cargo-workspace-analyzer
max_upload_size
id1424652
size240,068
Jan Arends (jaads)

documentation

README

Cargo workspace analyzer

A CLI tool which provides insights about a Cargo workspace. Currently, the following is supported.

Workspace Visualization

It visualizes the workspace with a Mermaid diagram. That way the user can see how packages depend on each other may identify layers of the application. As an example, here is the resulting diagram a randomly selected workspace, Vector. If you use the --no-file argument, the resulting Mermaid diagram will be printed to the console. You can copy it for somewhere else for further processing. Here a small sample:

graph TD
    service-1 --> db-connector
    API --> service-2
    API --> service-1
    service-2 --> db-connector

Circular Dependency Detection

This analyzer finds circular dependencies. It highlights those packages, which form a circle. By running the analyzer regularly, one can detect circular dependencies before they get hard if not impossible to resolve later on. See this example.

Package Count

It will also display the amount of packages in your workspace.

Installation

Install it globally:

cargo install cargo-workspace-analyzer

Then navigate to a Cargo workspace and run the tool:

cd path/to/your/workspace
cargo-workspace-analyzer

Or use an argument to specify the location of the workspace and run it from where ever you want.

cargo-workspace-analyzer --working-dir /path/to/your/workspace

For further details, use cargo-workspace-analyzer --help

Commit count: 56

cargo fmt