Skip to content

Review and recommend project improvements#1

Merged
matcharr merged 7 commits into
mainfrom
claude/project-improvement-review-01H7AZzrwW8wYQUR7XD4Geon
Dec 11, 2025
Merged

Review and recommend project improvements#1
matcharr merged 7 commits into
mainfrom
claude/project-improvement-review-01H7AZzrwW8wYQUR7XD4Geon

Conversation

@matcharr

@matcharr matcharr commented Dec 11, 2025

Copy link
Copy Markdown
Owner

Description

Brief description of changes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • Tests pass locally
  • New tests added for new functionality
  • Integration tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • CHANGELOG.md updated (if needed)

Note

Adds --exclude inverse matching and shell completions, introduces Docker support, enforces regex size limits, and updates deps/version to 0.2.0.

  • CLI/Config:
    • Add --exclude/-e with literal/regex support and case-insensitive optimization (Config::should_exclude).
    • Add shell completions via --completions and Args::generate_completions; --file no longer required when generating completions.
    • Report version from env!("CARGO_PKG_VERSION").
  • Watcher/Highlighter:
    • Apply exclusions in dry-run and tail paths; track lines_excluded in WatcherStats and show in shutdown summary.
  • Security/Regex:
    • Impose regex size_limit/dfa_size_limit; adjust invalid regex error messaging.
  • Packaging:
    • Add multi-stage Dockerfile and .dockerignore for containerized builds.
    • Bump deps: notify to 8, crossterm to 0.29; add clap_complete.
    • Set crate version to 0.2.0.
  • Docs:
    • Update README.md and CHANGELOG.md with exclude patterns, completions, Docker usage, and security note.
  • Tests/Benches:
    • Update integration/unit tests for new version/output and exclusions/completions; expand notification error handling cases.
    • Adjust benchmarks to new Args fields.

Written by Cursor Bugbot for commit 3734b91. This will update automatically on new commits. Configure here.

…e patterns, Dockerfile

- Fix version mismatch: use env!("CARGO_PKG_VERSION") instead of hardcoded version
- Add ReDoS protection with regex size limits (10MB) for user-provided patterns
- Add shell completions support (--completions flag for bash/zsh/fish/powershell)
- Add exclude pattern support (--exclude flag for inverse matching)
- Create multi-stage Dockerfile for containerized deployment
- Add .dockerignore for optimized Docker builds
- Update tests for new fields and error messages
- Add exclude patterns documentation (--exclude / -e)
- Add shell completions documentation (--completions)
- Add Docker installation and usage instructions
- Update changelog with v0.2.0 changes
- Add examples for exclude patterns and shell completions
- Add should_exclude() check in process_line() for live monitoring
- Add should_exclude() check in dry-run processing loop
- Update CHANGELOG.md with new features for v0.2.0
Copilot AI review requested due to automatic review settings December 11, 2025 01:23
@matcharr matcharr self-assigned this Dec 11, 2025
- Add missing completions and exclude fields to benchmark Args struct
- Add #![allow(deprecated)] for Command::cargo_bin in integration tests
- Fix cargo fmt formatting in watcher.rs and integration.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds several significant features to the logwatcher tool including exclude patterns for filtering out unwanted log lines, shell completion generation support, Docker containerization, and security improvements with ReDoS protection. The version is also updated from 0.1.0 to 0.2.0 with the version string now correctly sourced from Cargo.toml.

Key changes:

  • Added exclude pattern functionality (--exclude/-e) with support for both literal and regex matching
  • Implemented shell completion generation for bash, zsh, fish, and PowerShell via --completions flag
  • Added Docker support with multi-stage Dockerfile for containerized deployment
  • Enhanced security with ReDoS protection using regex size limits
  • Fixed version reporting to use env!("CARGO_PKG_VERSION") instead of hardcoded value

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/cli.rs Added completions and exclude CLI arguments, implemented parsing and completion generation
src/config.rs Added exclude pattern compilation and matching logic, implemented ReDoS protection with size limits
src/main.rs Added shell completion handling before main application flow
src/watcher.rs Integrated exclude pattern checking in both file processing methods, updated test fixtures
src/matcher.rs Updated test fixtures with new CLI fields
src/notifier.rs Updated test fixtures with new CLI fields
src/highlighter.rs Updated test fixtures with new CLI fields
tests/integration.rs Updated version assertion to 0.2.0, updated error message to match new ReDoS error text
Cargo.toml Added clap_complete dependency for shell completion support
Dockerfile Added multi-stage Docker build with security best practices (non-root user, minimal runtime image)
.dockerignore Optimized Docker build context by excluding unnecessary files
README.md Documented new features with usage examples for exclude patterns, completions, and Docker
CHANGELOG.md Added version 0.2.0 changelog entries documenting all new features and fixes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/config.rs Outdated
Comment thread src/cli.rs
Comment thread src/watcher.rs
Comment thread src/watcher.rs
Comment thread README.md Outdated
Comment thread src/config.rs
- Cache lowercase exclude patterns at config init to avoid repeated
  allocations in should_exclude() (performance optimization)
- Add lines_excluded counter to WatcherStats for better visibility
  into filtering effectiveness
- Move lines_processed increment after exclusion check so stats
  accurately reflect only processed (non-excluded) lines
- Add Zsh fpath setup note to README shell completions section
- Fix unnecessary_unwrap clippy lint (use if-let instead)
- Update notify 6 -> 8
- Update crossterm 0.27 -> 0.29
- Keep criterion at 0.5 (0.8 has breaking API changes)
@codecov

codecov Bot commented Dec 11, 2025

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

- Update Cargo.toml version
- Update CHANGELOG.md with 0.2.1 release notes
- Update integration test version check
@matcharr matcharr merged commit a0905dc into main Dec 11, 2025
12 checks passed
@matcharr matcharr deleted the claude/project-improvement-review-01H7AZzrwW8wYQUR7XD4Geon branch December 11, 2025 02:11
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.

3 participants