Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 08 Dec 20:38
e9a586b

PureCode v0.2.0 Release Notes

Overview

PureCode v0.2.0 represents a major evolution of the tool, transforming it from a simple git diff analyzer into a comprehensive code analysis platform. This release introduces snapshot analysis, configuration management, and enhanced CI integration while maintaining full backward compatibility for existing diff analysis workflows.

Highlights

🚀 New Capabilities

  • Dual Analysis Modes: Diff mode (existing) + Files mode (new snapshot analysis)
  • Configuration System: Project-specific settings via .purecode.toml
  • Review Complexity Scoring: Quantifies PR review effort based on code changes
  • Enhanced CI Integration: Machine-readable outputs and flexible threshold checking
  • Per-File Reporting: Detailed statistics breakdown by individual files

🔧 Technical Improvements

  • Robust Language Support: Improved classifiers for HTML/Vue, C-style languages, and multi-line comments
  • Better Error Handling: Warnings for context lines, binary file detection, and malformed diffs
  • Structured Output: Redesigned reports with JSON serialization and CI-friendly formats
  • Code Quality: Added Rust formatting and linting to CI pipeline

What's New

Core Features

  • Snapshot Mode (purecode files): Analyze entire codebases or specific directories
  • Configuration File: .purecode.toml for project defaults and team settings
  • Subcommand Architecture: Organized CLI with diff and files commands
  • Complexity Metrics: Algorithm-based scoring for review difficulty assessment
  • Token Estimation: Improved calculation for LLM token usage

CLI Enhancements

  • Per-File Stats: --per-file flag for detailed file-by-file breakdown
  • CI Mode: --ci flag for automation-friendly output with summary lines
  • Flexible Thresholds: Enhanced validation with --warn-only option
  • Configuration Override: CLI flags take precedence over config file settings

Language & Parsing

  • HTML/Vue Improvements: Better handling of multi-line comments and mixed content
  • C-Style Refinements: More accurate inline comment detection
  • Binary File Support: Automatic skipping of binary diffs
  • Context Line Warnings: Alerts when using diffs without --unified=0

Changes

Added

  • New dependencies: serde, serde_json, toml, walkdir, glob
  • config.rs: Configuration loading and management
  • files.rs: Directory scanning and file analysis
  • language.rs: Centralized language detection enum
  • Complexity calculation and token estimation functions
  • JSON output format with structured data models
  • CI summary lines for automation

Changed

  • CLI Structure: Root command defaults to diff mode; explicit subcommands for clarity
  • Output Format: Redesigned human reports with language breakdown and complexity scores
  • Classifier Logic: Improved state management for multi-line constructs
  • GitHub Actions: Enhanced release workflow with duplicate detection and generated notes
  • README: Complete rewrite with architecture docs and usage examples

Fixed

  • HTML comment parsing edge cases
  • C-style block comment handling in mixed lines
  • Language detection consistency
  • Diff parsing robustness

Removed

  • Manual release notes generation (now uses GitHub's generated notes)
  • Some redundant classifier code paths

Compatibility

Breaking Changes

  • CLI Defaults: Some flags now pull from config file; use explicit flags to override
  • Output Structure: JSON format includes new fields; existing parsers may need updates
  • Module Structure: Internal reorganization may affect custom integrations

Backward Compatibility

  • ✅ Existing purecode command continues to work (diff mode)
  • ✅ All existing CLI flags supported
  • ✅ Diff analysis behavior unchanged
  • ✅ Core API functions preserved

Migration Guide

For Users

  1. No Action Required: Existing scripts continue working
  2. Optional: Add .purecode.toml to your repository root for team defaults
  3. New Features: Try purecode files for codebase analysis
  4. CI Updates: Add --ci flag for machine-readable output

For CI/CD

# Before
- run: purecode --format json

# After (recommended)
- run: purecode --ci --format json

Configuration Example

[purecode]
base = "origin/main"
format = "human"
max_noise_ratio = 0.6
min_pure_lines = 5
fail_on_decrease = true
warn_only = false
ci = false

include = ["src/**"]
exclude = ["**/*.lock", "dist/**", "target/**", "node_modules/**"]

Installation

From Source (Recommended)

cargo install --path .

Pre-built Binaries

Available via GitHub releases with automated installation scripts.

Performance

  • Memory Usage: Minimal increase due to new data structures
  • Execution Speed: Maintained for diff mode; snapshot mode scales with codebase size
  • Binary Size: ~15% increase due to additional dependencies

Testing

  • All existing tests pass
  • New test coverage for classifiers, parsing, and configuration
  • Manual validation across multiple languages and project types
  • CI pipeline includes formatting and linting checks

Acknowledgments

This release represents significant community-driven improvements and internal refactoring to position PureCode for future growth. Special thanks to contributors who provided feedback on the v0.1.0 release.

Future Roadmap

  • History analysis mode (scaffolding included)
  • Custom language rule definitions
  • Integration with popular code review platforms
  • Performance optimizations for large codebases

Full Changelog: See commit history and PR #2 for complete details.

Documentation: Updated README.md and inline help (purecode --help)

Support: File issues on GitHub for bugs or feature requests.