Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Run tests
run: cargo test --all-features
Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
testpkg/
.claude/settings.local.json
target/
.pysubclasses-cache
139 changes: 139 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ clap = { version = "4", features = ["derive"] }
anyhow = "1"
thiserror = "1"

# Logging
log = "0.4"
env_logger = "0.11"

# File System
ignore = "0.4"

Expand All @@ -34,6 +38,10 @@ rayon = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# Cache serialization and compression
bincode = "2"
flate2 = "1"

[dev-dependencies]
assert_cmd = "2"
assert_fs = "1"
Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ A Rust CLI tool and library for finding all subclasses (direct and transitive) o
- **Gitignore support**: Automatically respects `.gitignore` files using the `ignore` crate
- **Multiple output formats**: Text and JSON output formats
- **Fast and efficient**: Written in Rust with parallel file traversal
- **Smart caching**: Caches parsed files with gzip compression for 2.5x speedup on repeated runs
- **Configurable logging**: Uses `env_logger` for flexible logging control

## Installation

Expand Down Expand Up @@ -76,12 +78,38 @@ Get results in JSON format for scripting:
pysubclasses Animal --format json
```

### Verbose Mode
### Logging

Show additional information about the search process:
Control logging verbosity using the `RUST_LOG` environment variable:

```bash
pysubclasses Animal --verbose
# No logging (default) - only shows output
pysubclasses Animal

# Show cache statistics
RUST_LOG=info pysubclasses Animal

# Show detailed debug information
RUST_LOG=debug pysubclasses Animal

# Show only pysubclasses logs (filter out dependencies)
RUST_LOG=pysubclasses=debug pysubclasses Animal
```

### Exclude Directories

Exclude specific directories from analysis:

```bash
pysubclasses Animal --exclude ./tests
```

### Disable Cache

Force re-parsing of all files:

```bash
pysubclasses Animal --no-cache
```

## Examples
Expand Down Expand Up @@ -249,6 +277,7 @@ src/
├── parser.rs # AST parsing
├── registry.rs # Class registry
├── graph.rs # Inheritance graph
├── cache.rs # File-based caching with gzip
└── error.rs # Error types

tests/
Expand Down
7 changes: 6 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
version: "3"

tasks:
fix.fmt: cargo fmt
fix.lint: cargo clippy --all-targets --all-features --fix --allow-staged
fix.fmt: cargo fmt

fix:
cmds:
- task: fix.lint
- task: fix.fmt

check.test: cargo test --all-features
check.lint: cargo clippy --all-targets --all-features -- -D warnings
Expand Down
Loading