Skip to content

Fix pylint warnings#50

Merged
AlanRockefeller merged 2 commits intomainfrom
test
Mar 13, 2026
Merged

Fix pylint warnings#50
AlanRockefeller merged 2 commits intomainfrom
test

Conversation

@AlanRockefeller
Copy link
Copy Markdown
Owner

@AlanRockefeller AlanRockefeller commented Mar 13, 2026

fix pylint warnings on app.py and the .py files in repo root - also imaging cache.py and editor.py

Summary by CodeRabbit

Release Notes

  • New Features

    • Added metadata fields to track image history: stacked date, upload status, edit status, restack status, favorite flag, and todo marker.
    • Added public utilities for EXIF sanitization and backup file creation.
  • Bug Fixes

    • Improved rawtherapee path detection and validation.
    • Enhanced image size estimation for edge cases.
    • Strengthened error handling in undo/rollback operations.
  • Documentation

    • Added comprehensive docstrings to configuration and image processing modules.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

Refactored deletion and undo state handling by introducing UIStateRestoration dataclass to consolidate UI state snapshots (saved batches, stacks, and indices) and wiring it through DeleteJob. Enhanced image caching and editor utilities with fallback size estimation and EXIF sanitization helpers. Expanded EntryMetadata with new tracking fields and improved logging consistency via parameterized formatting across multiple modules.

Changes

Cohort / File(s) Summary
UI State Refactoring
faststack/deletion_types.py, faststack/app.py
Introduced UIStateRestoration dataclass to encapsulate UI-state snapshots (saved_batches, saved_batch_start_index, saved_stacks, saved_stack_start_index). Updated DeleteJob to carry ui_state: Optional[UIStateRestoration] instead of scattered saved_* fields. Wired throughout deletion/undo/rollback paths in AppController.
Configuration & Logging Improvements
faststack/config.py
Narrowed exception handling in detect_rawtherapee_path from broad Exception to (OSError, RuntimeError). Added class/method docstrings, proactive configuration repair with missing section/key creation, and Windows-specific rawtherapee path validation with re-detection fallback. Converted f-string logging to parameterized style.
Imaging Cache & Eviction
faststack/imaging/cache.py
Enhanced get_decoded_image_size with fallback size estimation from width/height/bytes_per_line (4 BPP default). Updated _fire_evict signature to accept info: Optional[dict] = None with normalization. Added pylint disables and eviction callback enrichment with structured info during replacement/deletion.
Image Editor Utilities
faststack/imaging/editor.py
Added public helpers sanitize_exif_orientation(exif_bytes) and create_backup_file(original_path). Adjusted channel-count derivation via arr.shape[2] and refined EXIF/save workflows. Removed geometric transform sidecar detection in main save path.
JPEG Decoder Refactoring
faststack/imaging/jpeg.py
Replaced per-module jpeg_decoder with module-level JPEG_DECODER constant and added TURBO_AVAILABLE flag. Updated all PyTurboJPEG usage sites and error logging to use JPEG_DECODER, maintaining Pillow fallback consistency.
Public API Extensions
faststack/models.py, faststack/io/sidecar.py
Expanded EntryMetadata with new tracking fields (stacked_date, uploaded, uploaded_date, edited, edited_date, restacked, restacked_date, favorite, todo, todo_date). Added type overloads to SidecarManager.get_metadata for improved type safety with create parameter variations.
Logging Standardization & Formatting
faststack/imaging/prefetch.py, faststack/imaging/metadata.py, faststack/tests/...*, faststack/thumbnail_view/...
Converted f-string log messages to parameterized logging style across multiple modules. Reformatted multi-line expressions, import blocks, and data structures for readability. Pure formatting changes with no functional impact.
Minor Public API Updates
faststack/app.py
Added JPG_EXTENSIONS constant to public API imports alongside existing RAW_EXTENSIONS for extension checks. Expanded AppController with deferred-init state fields for safe defaults (e.g., _save_initiated_path, _batch_indices_cache, recycle_bin_dir, reporter).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • #40: Modifies deletion and UI-state plumbing in AppController with DeleteJob and UIState-related flows.
  • #13: Updates deletion/undo machinery and AppController UI state handling with new delete/undo slots and rollback data structures.
  • #38: Refactors faststack/io/deletion helpers and confirm/permanent-delete logic related to the core deletion flow.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Fix pylint warnings' is vague and overly generic, using non-descriptive terminology that doesn't convey specific information about the changeset. Consider a more specific title that highlights the primary structural or functional change (e.g., 'Refactor UI state management with UIStateRestoration' or 'Consolidate saved state into UIStateRestoration structure').
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 82.14% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AlanRockefeller
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 13, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AlanRockefeller AlanRockefeller merged commit c50cc6b into main Mar 13, 2026
3 checks passed
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