Skip to content

Commit 7af5bf1

Browse files
committed
Initial release of cargo-crategeist
0 parents  commit 7af5bf1

19 files changed

Lines changed: 5643 additions & 0 deletions

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[*.rs]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.toml]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.{yml,yaml}]
18+
indent_style = space
19+
indent_size = 2
20+
21+
[*.md]
22+
trim_trailing_whitespace = false

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dtolnay/rust-toolchain@stable
19+
- uses: Swatinem/rust-cache@v2
20+
- run: cargo check
21+
22+
fmt:
23+
name: Format
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dtolnay/rust-toolchain@stable
28+
with:
29+
components: rustfmt
30+
- run: cargo fmt --check
31+
32+
clippy:
33+
name: Clippy
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@stable
38+
with:
39+
components: clippy
40+
- uses: Swatinem/rust-cache@v2
41+
- run: cargo clippy -- -D warnings
42+
43+
build:
44+
name: Build
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: [ubuntu-latest, macos-latest]
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: dtolnay/rust-toolchain@stable
52+
- uses: Swatinem/rust-cache@v2
53+
- run: cargo build --release

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
crategeist-report.html

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
## 0.1.0
4+
5+
Initial release.
6+
7+
- Security audit via RustSec advisory database
8+
- Per-crate compile time measurement
9+
- Dead dependency detection via source scanning
10+
- Critical path analysis through dependency graph
11+
- Most depended-on crates ranking
12+
- Terminal output with colored tables
13+
- Self-contained HTML report generation
14+
- Workspace support with per-member analysis
15+
- `-p`/`--package` flag for targeting specific workspace members
16+
- `--skip-timing` and `--skip-security` flags

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to crategeist
2+
3+
Thanks for wanting to contribute. Here's how to get started.
4+
5+
## Development setup
6+
7+
```sh
8+
git clone https://github.com/arferreira/crategeist.git
9+
cd crategeist
10+
cargo build
11+
```
12+
13+
## Running locally
14+
15+
```sh
16+
# Quick test (no build, no network)
17+
cargo run -- crategeist --skip-timing --skip-security
18+
19+
# Full run on itself
20+
cargo run -- crategeist
21+
```
22+
23+
## Before submitting a PR
24+
25+
```sh
26+
cargo fmt --check
27+
cargo clippy -- -D warnings
28+
cargo build
29+
```
30+
31+
Make sure there are no warnings.
32+
33+
## What to work on
34+
35+
Check the [issues](https://github.com/arferreira/crategeist/issues) for open tasks. If you want to work on something not listed, open an issue first to discuss the approach.
36+
37+
Good first contributions:
38+
- Improving unused dependency detection accuracy
39+
- Adding output formats (JSON, markdown)
40+
- Better timing measurement strategies
41+
- Documentation improvements
42+
43+
## Guidelines
44+
45+
- Keep it simple. Don't over-engineer.
46+
- One PR per feature or fix.
47+
- Write clear commit messages.
48+
- No async — this is a sequential CLI tool (rayon for parallelism where needed).
49+
- Stable Rust only, no nightly features.
50+
- Test your changes by running crategeist on real projects.
51+
52+
## Project structure
53+
54+
```
55+
src/
56+
main.rs # CLI entry, orchestration
57+
metadata.rs # cargo_metadata wrapper, workspace support
58+
analyze/
59+
timing.rs # cargo build JSON message parsing
60+
security.rs # rustsec advisory DB audit
61+
unused.rs # regex source scanning
62+
critical_path.rs # petgraph DAG longest-path
63+
report/
64+
terminal.rs # comfy-table + colored output
65+
html.rs # maud single-file HTML report
66+
```

0 commit comments

Comments
 (0)