ntu/CHANGELOG.md
dschlueter b84dd70f80 feat: Add --max-depth option and safe symlink handling (v1.2.0)
## Neue Features

- **--max-depth N**: Begrenzt Rekursionstiefe auf N Ebenen (erfordert -r)
  - Nützlich für sehr tiefe Verzeichnisbäume (z.B. node_modules)
  - Verhindert unnötige Traversierung tiefer Strukturen

- **Explizites Symlink-Handling**:
  - Standard: Symlinks werden komplett übersprungen (sicher)
  - Mit --special: Nur Symlink-Namen werden bereinigt, Ziel bleibt unangetastet
  - follow_links(false) explizit gesetzt zur Vermeidung von Endlosschleifen
  - Verhindert unbeabsichtigte Änderungen außerhalb des Zielverzeichnisses

- **Verbose Symlink-Logging**: Zeigt mit -v welche Symlinks übersprungen werden

## Tests

- 5 neue Integration-Tests hinzugefügt:
  - test_max_depth_option
  - test_max_depth_requires_recursive
  - test_symlinks_default_behavior (Unix only)
  - test_symlinks_with_special_flag (Unix only)
  - test_symlinks_not_followed (Unix only)

- Alle 30 Tests bestehen (25 bestehende + 5 neue)

## Dokumentation

- README.md: Neue Beispiele und "Symlink Behavior" Sektion
- CHANGELOG.md: v1.2.0 Eintrag mit allen Änderungen
- man/ntu.1: --max-depth Option und SYMLINK BEHAVIOR Sektion
- CLAUDE.md: Aktualisierte Code-Architektur Dokumentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 13:39:41 +01:00

5.6 KiB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.2.0] - 2025-02-12

Added

  • --max-depth N option: Limit recursion depth to N levels (requires -r/--recursive)
  • Explicit symlink handling: Symlinks are no longer followed (follow_links(false))
    • Default: Symlinks are completely skipped (not renamed, not followed)
    • With --special: Only the symlink name is sanitized, target remains unchanged
    • Prevents infinite loops from circular symlinks
    • Prevents unintended changes outside target directory
  • Verbose symlink logging: Shows which symlinks are skipped when using -v

Changed

  • WalkDir now explicitly uses follow_links(false) for safety
  • Improved verbose logging to indicate when max-depth is active

Technical

  • Added 5 new integration tests for max-depth and symlink behavior
  • All tests passing (30 total: 25 existing + 5 new)
  • Unix-specific symlink tests use #[cfg(unix)] attribute

[1.1.0] - 2025-02-10

Added

  • -s/--sequence <name> option: Select transformation sequence (default, lower, upper, minimal, utf-8)
  • -L option: List all available sequences (use with -v for details)
  • 5 hardcoded sequences:
    • default: Current behavior (umlauts→ASCII, spaces→underscores)
    • lower: Like default + convert to lowercase
    • upper: Like default + convert to UPPERCASE
    • minimal: Only replace spaces, keep UTF-8 characters
    • utf-8: UTF-8 friendly (keep umlauts, remove special chars)

Changed

  • Refactored clean_filename() to support sequence-based transformations
  • Umlaut replacements moved from hardcoded to sequence-specific logic
  • Case transformations now also apply to file extensions

Technical

  • Added Sequence struct and CaseTransform enum in sanitizer.rs
  • Extended CLI with -s and -L options
  • Added list_sequences() function in main.rs
  • Updated all unit tests to pass Sequence parameter
  • Added 8 new integration tests for sequence functionality

[1.0.0] - 2025-02-10

⚠️ BREAKING CHANGES

  • Recursion is now opt-in: By default, ntu only processes the specified paths and their immediate children. Use -r/--recursive flag to enable recursive directory traversal.
  • Migration: Add -r to existing commands to preserve v0.x behavior

Added

  • --conf <FILE> option: Specify a single configuration file, bypassing the default hierarchy (/etc → ~/.config → ./). Errors if file doesn't exist.
  • -r/--recursive flag: Enable recursive directory processing

Changed

  • Default behavior is now non-recursive (use -r for recursive processing)
  • All integration tests updated to explicitly use -r flag

Migration Guide

# Old command (v0.x - always recursive):
ntu /path/to/files

# New equivalent (v1.x - explicit recursion):
ntu -r /path/to/files

[0.3.0] - 2025-02-10

Added

  • CI/CD Pipeline: Automated testing and release builds via GitHub Actions
    • CI workflow: Tests on Rust stable and beta, Clippy, rustfmt checks
    • Release workflow: Multi-platform builds (Linux x86_64, Linux musl, macOS Intel, macOS ARM)
  • Shell Completions: Auto-completion support for all major shells
    • Bash completion (completions/ntu.bash)
    • Zsh completion (completions/_ntu)
    • Fish completion (completions/ntu.fish)
  • Manpage: Professional manual page (man/ntu.1) with full documentation
  • Colored Output: Terminal colors for better visual feedback
    • Green for successful renames
    • Yellow for dry-run mode
    • Red for errors
    • Cyan/bold for statistics
    • --no-color flag to disable colors
  • Integration Tests: 13 comprehensive integration tests using assert_cmd
  • README: Installation instructions for pre-built binaries, badges (CI, Release, Version, License)

Changed

  • Improved .gitignore with better organization
  • Better error messages with colored output
  • Updated test framework to use modern cargo_bin! macro

Fixed

  • Removed unused warn import

[0.2.0] - 2025-02-10

Added

  • CLI: --dry-run as primary option (with --no-changes as deprecated alias for backward compatibility)
  • CLI: --special flag to process symlinks and special files (normally skipped)
  • Smart Default Excludes: Automatically ignore .git, .svn, node_modules, .cache, __pycache__
  • Double Extensions: Proper handling of .tar.gz, .tar.bz2, .tar.xz, .tar.zst, .tar.lz, .tar.Z
  • Parallel Processing: Using rayon for parallel filename cleaning when processing ≥100 files
  • Write Permission Checks: Check write permissions before attempting rename operations
  • Unit Tests: 9 comprehensive tests for clean_filename() covering edge cases

Fixed

  • Critical Bug: Hidden files (like .gitignore) are no longer incorrectly renamed to unnamed.xxx
  • Leading dot in hidden files is now correctly preserved
  • Fixed all clippy warnings

Changed

  • Binary renamed from NameToUnix to ntu (shorter CLI usage)
  • Improved error messages for permission issues
  • Better handling of hidden files with spaces (.my config.my_config)

Performance

  • Parallel processing with rayon for large directory trees (threshold: 100 files)
  • Optimized regex patterns using once_cell::Lazy

[0.1.0] - 2025-03-07

Added

  • Initial release
  • Basic filename sanitization
  • Configurable replacements via TOML
  • Recursive directory processing
  • Exclude patterns support
  • German umlaut conversion
  • Special identifier preservation (C++, C#)