# CI Scripts

This directory contains useful scripts for Continuous Integration and development quality assurance.

## Scripts Overview

### 📊 Code Quality & Testing

- **`test_coverage.sh`** - Generates and displays test coverage report, highlighting missing lines
- **`fuzzer.sh`** - Runs fuzz testing on the parser to find edge cases and crashes
- **`mutation_test.sh`** - Performs simple mutation testing to verify test quality
- **`linter.sh`** - Runs comprehensive linting and code quality checks
- **`fix_all.sh`** - Automatically fixes all linter errors using clippy, rustfmt, and cargo fix

### 🚀 Usage

All scripts are designed to be run from the project root directory:

```bash
# Run test coverage analysis
./scripts/ci/test_coverage.sh

# Run fuzzer for 30 seconds
./scripts/ci/fuzzer.sh

# Run mutation testing
./scripts/ci/mutation_test.sh

# Run linter checks
./scripts/ci/linter.sh

# Automatically fix all linter errors
./scripts/ci/fix_all.sh
```

### 📋 Requirements

- **Rust toolchain** with `cargo` and standard tools
- **cargo-tarpaulin** for coverage (installed automatically)
- **cargo-fuzz** for fuzzing (installed automatically)
- **cargo-mutants** for mutation testing (installed automatically)
- **cargo-machete** for unused dependency checking (installed automatically)
- **cargo-audit** for security auditing (installed automatically)
- **cargo-outdated** for dependency freshness checking (installed automatically)
- **clippy** for linting (part of standard Rust toolchain)
- **bc** for basic calculator operations (usually pre-installed)
- **regex** library support for advanced pattern matching

### 🔧 Integration

These scripts are designed to be easily integrated into:
- GitHub Actions workflows
- GitLab CI pipelines
- Local development workflows
- Pre-commit hooks

### 📈 Coverage Goals

- **Line coverage**: Target 80%+ for core parsing logic
- **Branch coverage**: Target 75%+ for complex control flow
- **Function coverage**: Target 90%+ for public API

### 🐛 Fuzzing Strategy

The fuzzer targets:
- Parser input validation
- Edge cases in meta-line parsing
- Malformed input handling
- Memory safety issues

### 🧬 Mutation Testing

Tests the quality of your test suite by:
- Introducing small code changes (mutations)
- Running tests against mutated code
- Verifying that tests catch the mutations

### 📝 Linting Rules

Enforces:
- Rust best practices
- Code style consistency
- Performance optimizations
- Security patterns