Skip to content

Major Update to PureCode v0.2.0 - #2

Merged
harkaranbrar7 merged 1 commit into
mainfrom
feat/v0.2.0-new-features
Dec 8, 2025
Merged

harkaranbrar7 merged 1 commit into
mainfrom
feat/v0.2.0-new-features

Conversation

@harkaranbrar7

Copy link
Copy Markdown
Contributor

Summary

This PR introduces a major update to PureCode, evolving it from a simple git diff analyzer to a comprehensive code analysis tool with support for both diff and snapshot modes, configuration files, and enhanced CI integration.

Key Changes

🚀 New Features

  • Snapshot Mode: Added purecode files command to analyze entire directories/files instead of just diffs
  • Configuration Support: Introduced .purecode.toml for default settings (base branch, format, thresholds, etc.)
  • Subcommand Structure: Refactored CLI with diff and files subcommands for better organization
  • Complexity Scoring: Added review complexity calculation based on churn and code type
  • Token Estimation: Improved token counting for added code
  • Per-File Reporting: Option to show detailed statistics per file
  • CI Mode: Machine-readable output with summary lines for automated processing

🔧 Improvements

  • Enhanced Classifiers: Improved HTML/Vue comment handling and C-style block comment logic
  • Better Error Handling: More robust parsing with warnings for context lines and binary files
  • Language Detection: Centralized language detection using a proper enum
  • Output Formats: Redesigned human-readable reports with colors, plain text, and structured JSON
  • Threshold Checks: More flexible threshold validation with detailed error messages

🛠️ Technical Changes

  • Dependencies: Added serde, serde_json, toml, walkdir, glob for configuration and file handling
  • Code Structure: Split functionality into dedicated modules (config.rs, files.rs, language.rs)
  • Data Models: Introduced FileStats, AnalysisResult, and ThresholdError for better type safety
  • GitHub Actions:
    • Improved auto-release workflow to skip existing releases and use generated notes
    • Added code formatting and linting checks in CI

📚 Documentation

  • README Overhaul: Complete rewrite with architecture overview, installation guides, and comprehensive usage examples
  • Configuration Guide: Detailed .purecode.toml configuration options
  • Integration Examples: Updated pre-commit hooks and GitHub Actions workflows

Breaking Changes

  • CLI Interface: Root command now defaults to diff mode; use subcommands for explicit modes
  • Configuration: Some flags now have defaults from config file; CLI flags still override
  • Output Format: Human-readable output redesigned with new layout and metrics

Migration Guide

  • Existing scripts using purecode directly will continue to work (diff mode)
  • For new snapshot functionality, use purecode files
  • Add .purecode.toml to your repo root for project-specific defaults
  • Update CI scripts to use --ci flag for machine-readable output

Testing

  • All existing tests pass
  • Added tests for new classifiers and parsing logic
  • Manual testing of diff and files modes with various file types

This update significantly expands PureCode's capabilities while maintaining backward compatibility for core diff analysis functionality. The tool is now ready for broader use cases including codebase audits, CI/CD pipelines, and team workflow integration.

- Implement snapshot analysis for file directories
- Add complexity scoring based on churn and code type
- Introduce configuration file (.purecode.toml) for defaults
- Update CLI with subcommands for diff and files modes
- Enhance classifiers for better HTML/Vue comment handling
- Add per-file statistics and CI-friendly output formats
- Bump version to 0.2.0 with new features and improved documentation

BREAKING CHANGE: CLI structure updated with subcommands; root command remains backward compatible for diff mode
@harkaranbrar7
harkaranbrar7 merged commit e9a586b into main Dec 8, 2025
3 checks passed
@harkaranbrar7
harkaranbrar7 deleted the feat/v0.2.0-new-features branch December 8, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant