General-purpose development tools for Rust projects - character validation, release automation, and more.
cargo install apdev-rsOr install from local source:
cd rust
cargo install --path .Validate that files contain only allowed characters (ASCII, common emoji, and technical symbols like arrows and box-drawing characters). Flags dangerous invisible/bidirectional characters in code (Trojan Source - CVE-2021-42574) while allowing them in comments.
Supports comment-aware checking for .rs, .py, .js, .ts, .tsx, .jsx files.
# Check default project directories (src/, tests/, examples/) and config files
apdev-rs check-chars
# Check a directory recursively
apdev-rs check-chars src/
# Check specific files
apdev-rs check-chars src/lib.rs src/main.rs
# Enable extra charset (e.g. Chinese characters)
apdev-rs check-chars --charset chinese src/
# Use a custom charset JSON file
apdev-rs check-chars --charset-file custom.json src/Options:
--charset <name>— Enable a built-in charset preset (repeatable). Available:chinese,japanese,korean--charset-file <path>— Load a custom charset JSON file (repeatable)- Environment variable
APDEV_EXTRA_CHARS— Comma-separated list of charset names or file paths, used when no--charset/--charset-fileis given
Interactive release automation for publishing Rust crates to crates.io and GitHub. Auto-detects project name from Cargo.toml and GitHub repo from git remote.
# Run with auto-detected version from Cargo.toml
apdev-rs release
# Specify version explicitly
apdev-rs release 0.1.0
# Silent mode (auto-accept all defaults, for CI/CD)
apdev-rs release --yes
apdev-rs release --yes 0.1.0The command provides an interactive menu with steps:
- Version verification (checks
Cargo.toml) - Status check (git tag, crates.io)
- Run tests (
cargo test) - Build release (
cargo build --release) - Create git tag and push
- Create GitHub release (via
ghCLI) - Publish to crates.io (
cargo publish)
Override auto-detection with environment variables:
PROJECT_NAME=mycrate GITHUB_REPO=owner/repo apdev-rs releaseRequires apdev-rs installed on the system (cargo install apdev-rs):
repos:
- repo: local
hooks:
- id: check-chars
name: apdev-rs check-chars
entry: apdev-rs check-chars
language: system
types_or: [text, rust]Prerequisites: Rust >= 1.70.
cd rust
cargo build # Build
cargo test # Run tests
cargo build --release # Build release binaryApache-2.0