ai-refactor-cli 0.2.0

Rule-based legacy code refactoring CLI (TypeScript any / Python typing / Django FBV→CBV). Complement to general AI coding agents.
Documentation
# Changelog

All notable changes to this project will be documented in this file. The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [0.2.0] — 2026-05-21

### Added

- **tree-sitter AST detection for Python** (`tree-sitter-python = "0.21"`).
  - `python-missing-typing` and `django-fbv` rules now parse real AST nodes instead of regex, eliminating false positives inside comments and string literals.
  - New `src/ast/python.rs` module exposes `make_parser()`, `detect_missing_typing()`, `detect_django_fbv()`.
- **Real `--apply` for `django-fbv`** (`detectors/django/fbv_to_cbv.rs`):
  - Converts top-level function-based Django views to class-based views.
  - Writes a `.bak` backup before any in-place edit.
  - Multi-method dispatch (`if request.method == "POST"`) emits a warning instead of silently mangling the file.
  - Extra URL parameters after `request` are preserved in the CBV `get` signature.
  - Decorated views (`@login_required`) are detected and the decorator is preserved.
- **Library crate target** (`src/lib.rs`): `ai_refactor_cli` is now importable as a Rust library for embedding in other tools.
- **Benchmark harness** (`benches/check_bench.rs`, `criterion = "0.5"`): measures `python-missing-typing` and `django-fbv` scan time on a synthetic 10 000-line Python file with `cargo bench`.
- `--dry-run` flag on `fix` subcommand (alias for omitting `--apply`).
- `rust-version = "1.75"` declared in `Cargo.toml`.
- License changed from MIT to **Apache-2.0** for crates.io friendliness.
- `documentation`, `homepage`, `readme`, `categories` fields added to `Cargo.toml`.
- README rewritten to crates.io publication quality (Installation / Quick Start / Examples / Library usage / CI integration sections).

### Changed

- `scanner.rs`: Python files now take the AST path; only TypeScript/TSX files still use the regex path.
- `main.rs`: `fix --apply` is no longer a no-op; dispatches to `detectors::django::fbv_to_cbv::apply()`.
- `fix --apply` for rules other than `django-fbv` returns a clear error message rather than silently doing nothing.
- 33 unit tests (was 13) — expanded across `ast::python`, `detectors::django::fbv_to_cbv`, and `scanner`.

### Fixed

- Comments containing `def foo(x):` no longer produce false-positive findings (AST-backed detection).
- String literals containing `def foo(x):` no longer produce false-positive findings.
- Class method `def get(self, request)` no longer flagged as a Django FBV.

---

## [0.1.0] — 2026-05-13

Initial MVP α. Detection-only release.

### Added

- `ai-refactor scan <path>` command with `--rule` and `--format {text,json}` flags.
- `ai-refactor fix <path> --rule <id> [--apply]` command. `--apply` is a documented no-op stub in this release.
- Three built-in rules:
  - `typescript-no-any` — matches `: any`, `<any>`, `any[]`, `Array<any>`.
  - `python-missing-typing` — matches `def foo(x):` style untyped signatures.
  - `django-fbv` — matches function-based Django views.
- CI pipeline running `cargo fmt --check`, `cargo clippy -- -D warnings`, `cargo test`, and `cargo build --release` against stable Rust 2021.
- MIT license, README, architecture doc.

### Known limitations

- Detection uses regex; tree-sitter is wired into `Cargo.toml` but unused. Migrating to AST queries lands in v0.2.0.
- No `--apply` transformation logic.
- No support for custom user rules — only the three built-ins.