### Initial Development Environment Setup Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Commands to clone the Skeletor repository, set up the development environment including git hooks, and build/test the project. ```bash # Clone and set up development environment git clone https://github.com/theGeekist/skeletor.git cd skeletor # Install git hooks and configure environment ./scripts/setup-git-hooks.sh # Build and test cargo build cargo test ``` -------------------------------- ### Shell Script for Setup Git Hooks Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Demonstrates the usage of a shell script for initial development setup, specifically for configuring Git hooks. The script `./scripts/setup-git-hooks.sh` is intended for this purpose. ```bash ./scripts/setup-git-hooks.sh ``` -------------------------------- ### Install Skeletor via Script (Linux/macOS) Source: https://github.com/thegeekist/skeletor/blob/main/README.md Installs Skeletor by downloading and executing an installation script. It is recommended to review the script before execution for security purposes. ```bash curl -fsSL https://raw.githubusercontent.com/theGeekist/skeletor/main/install.sh | bash ``` -------------------------------- ### Example Skeletor Configuration Source: https://github.com/thegeekist/skeletor/blob/main/README.md An example of a `.skeletorrc` YAML file defining a project's directory structure and initial file contents. This configuration includes source files, tests, and a Cargo.toml manifest. ```yaml directories: src: main.rs: | fn main() { println!("Hello, Skeletor!"); } lib.rs: "" tests: integration.rs: | #[test] fn sample_test() { assert_eq!(2 + 2, 4); } Cargo.toml: | [package] name = "my_project" version = "0.1.0" ``` -------------------------------- ### Build Skeletor from Source Source: https://github.com/thegeekist/skeletor/blob/main/README.md Builds and installs Skeletor from its source code. This method requires Git, Rust, and Cargo to be installed on your system. ```bash git clone https://github.com/theGeekist/skeletor.git cd skeletor cargo install --path . ``` -------------------------------- ### Install Skeletor via Cargo Source: https://github.com/thegeekist/skeletor/blob/main/README.md Installs Skeletor directly from crates.io using the Cargo package manager. This is the recommended installation method for users who already have Rust and Cargo installed. ```bash cargo install skeletor ``` -------------------------------- ### Cargo Release Workflow for CHANGELOG Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Demonstrates the automated CHANGELOG.md update process using cargo-release. It explains how to add changes and the automatic steps performed by cargo-release during the release process. ```bash # 1. Add changes under [Unreleased] section manually # 2. Run release process - cargo-release automatically: # - Converts [Unreleased] to [version] - date # - Creates new [Unreleased] section for future changes # - Updates comparison links with proper version tags # - Maintains automation markers for next release # ❌ NEVER manually add version entries like ## [0.3.1] - 2024-01-01 # ✅ ALWAYS add content under existing ## [Unreleased] section ``` -------------------------------- ### Setup and Test Skeletor Development Environment (Bash) Source: https://github.com/thegeekist/skeletor/blob/main/README.md This snippet demonstrates how to clone the Skeletor repository, set up the development environment including Git hooks, and run tests and quality checks using Cargo. It ensures the project is correctly configured for development. ```bash # Clone and set up development environment git clone https://github.com/theGeekist/skeletor.git cd skeletor ./scripts/setup-git-hooks.sh # Run tests and quality checks cargo test cargo clippy -- -D warnings ``` -------------------------------- ### Install Skeletor via Homebrew Source: https://github.com/thegeekist/skeletor/blob/main/README.md Installs Skeletor using the Homebrew package manager on macOS and Linux. This is a convenient method if Homebrew is already set up on your system. ```bash brew tap theGeekist/skeletor brew install skeletor ``` -------------------------------- ### Correct CLI Testing in Rust Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Demonstrates the correct way to perform CLI testing in Rust by using helper functions for subcommand parsing and asserting the success of the `run_apply` function. This approach ensures proper handling of arguments and subcommands. ```rust // Use helper functions for proper subcommand parsing if let Some(sub_m) = create_apply_matches(args) { let result = run_apply(&sub_m); assert!(result.is_ok()); } ``` -------------------------------- ### CHANGELOG.md Structure with Automation Markers Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Illustrates the expected structure of the CHANGELOG.md file, including the `` and `` automation markers used by cargo-release for managing unreleased and historical release entries. ```markdown # Changelog ## [Unreleased] - ReleaseDate ### Added - New features go here ### Changed - Changes go here ### Fixed - Bug fixes go here ## [0.3.0] - 2024-12-19 [Unreleased]: https://github.com/theGeekist/skeletor/compare/v0.3.0...HEAD [0.3.0]: https://github.com/thegeekist/skeletor/releases/tag/v0.3.0 ``` -------------------------------- ### Automated Release Commands with Cargo Release Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Shows how to use `cargo release` for automating project releases. Commands are provided for patching, releasing minor versions, and releasing major versions, with the `--execute` flag to perform the actions. ```bash # Use cargo-release for automated versioning cargo release patch --execute # 0.3.1 → 0.3.2 cargo release minor --execute # 0.3.1 → 0.4.0 cargo release major --execute # 0.3.1 → 1.0.0 ``` -------------------------------- ### Test Execution Commands Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Commands for running tests in the Skeletor project, including running all tests, performing coverage analysis with HTML output, and running specific test modules. ```bash # Run all tests cargo test # Run with coverage analysis cargo llvm-cov --html # Run specific test modules cargo test apply::tests cargo test snapshot::tests cargo test integration_test ``` -------------------------------- ### Rust Version Sync Macro Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Demonstrates how the Rust `env!` macro is used to dynamically fetch the package version from Cargo.toml at compile time, ensuring version consistency across the codebase. ```rust env!("CARGO_PKG_VERSION") ``` -------------------------------- ### Shell Script for Git Pre-commit Hook Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Details the execution of the `scripts/pre-commit.sh` script, which functions as a Git pre-commit hook. This script is designed to be auto-executed during the `git commit` process. ```bash scripts/pre-commit.sh ``` -------------------------------- ### Shell Script for Checking Version Consistency Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Illustrates how to manually validate version consistency within the project using a dedicated shell script. The command `./scripts/check-version-consistency.sh` should be executed for this check. ```bash ./scripts/check-version-consistency.sh ``` -------------------------------- ### Incorrect CLI Testing in Rust Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Illustrates an incorrect method for CLI testing in Rust, highlighting the risk of manually constructing CLI matches. This can lead to failures if arguments do not include the subcommand correctly. ```rust // Don't manually construct CLI matches let matches = build_cli().get_matches_from(args); // This can fail if args don't include subcommand properly ``` -------------------------------- ### Check Version Consistency Script Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Shell script to manually check version consistency within the Skeletor project. This script is part of the automated enforcement points, including pre-commit hooks and CI pipelines. ```bash # Manual version check ./scripts/check-version-consistency.sh # Automated enforcement points: # ✅ Pre-commit hooks (optional developer setup) # ✅ CI pipeline (mandatory - blocks builds with drift) # ✅ Release process (mandatory - validates before publishing) ``` -------------------------------- ### Rust Code Quality Checks Source: https://github.com/thegeekist/skeletor/blob/main/DEVELOPMENT.md Provides essential commands for maintaining code quality in a Rust project. This includes linting with `cargo clippy`, checking formatting with `cargo fmt --check`, and running documentation tests with `cargo test --doc`. ```bash # Linting cargo clippy -- -D warnings # Formatting cargo fmt --check # Documentation tests cargo test --doc ``` -------------------------------- ### Create Skeletor Snapshot Source: https://github.com/thegeekist/skeletor/blob/main/README.md Captures the structure of an existing directory and its contents into a Skeletor YAML configuration file. Options allow for saving to a file, excluding specific files or patterns, and adding notes. ```bash skeletor snapshot . -o my-template.yml skeletor snapshot -n "Initial snapshot" -i .gitignore -i .git/ . skeletor snapshot --dry-run . skeletor snapshot --dry-run --verbose . ``` -------------------------------- ### Skeletor Library Usage in Rust Source: https://github.com/thegeekist/skeletor/blob/main/README.md Demonstrates how to use Skeletor as a Rust library for programmatic scaffolding. It shows loading a configuration from a YAML string and applying it to a target directory, with results including created files, directories, and duration. ```rust use skeletor::{SkeletorConfig, apply_config}; use std::path::Path; // Load configuration from YAML string let config = SkeletorConfig::from_yaml_str(r#" directories: src: main.rs: | fn main() { println!("Hello, world!"); } tests: test.rs: "// Test content" "#)?; // Apply configuration to target directory let result = apply_config(&config, Path::new("./my-project"), false, false)?; println!("Created {} files and {} directories in {:?}", result.files_created, result.dirs_created, result.duration); ``` -------------------------------- ### Apply Skeletor Configuration Source: https://github.com/thegeekist/skeletor/blob/main/README.md Applies a Skeletor configuration to generate files and directories. It can use a default `.skeletorrc` file or a custom YAML configuration. Options like `--dry-run` and `--verbose` allow for previewing and detailed logging. ```bash skeletor apply skeletor apply custom.yml skeletor apply --dry-run skeletor apply my-template.yml --dry-run --verbose ``` -------------------------------- ### Display Skeletor Info Source: https://github.com/thegeekist/skeletor/blob/main/README.md Displays metadata and information from a Skeletor configuration file. It can target the default `.skeletorrc` or a specified custom YAML file. ```bash skeletor info skeletor info my-template.yml ``` -------------------------------- ### Automated Release Workflow with Cargo-Release (Bash) Source: https://github.com/thegeekist/skeletor/blob/main/README.md This snippet shows how to use the cargo-release tool for automated version management and releases. It includes commands for dry-runs to preview changes and actual release commands. Manual version number edits are strictly prohibited. ```bash # Dry-run (see what would happen) # cargo release patch # 0.3.1 → 0.3.2 # cargo release minor # 0.3.1 → 0.4.0 # cargo release major # 0.3.1 → 1.0.0 # Actual release (maintainers only) cargo release patch --execute ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.