You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add automated repository validation to catch merge markers and Python compilation errors before merging.
Move user configuration out of the repository root into a per-user config directory to avoid committing local settings.
Improve the main UI to provide better sorting, filtering and group management for duplicate results.
Remove stray placeholder files and sanitize config.json contents to avoid leaking local paths.
Description
Added a GitHub Actions workflow /.github/workflows/validate.yml that runs python scripts/validate_repo.py on pull_request and push to main.
Implemented scripts/validate_repo.py which checks for conflict markers and branch artefacts, and compiles src and main.py with compileall, returning non-zero on failure.
Updated .gitignore to ignore config.json and added a local app config directory ~/.duplicate-file-cleaner usage in src/app.py with migration from legacy config.json in the repo root via _migrate_legacy_config_if_needed.
Reworked config I/O with _read_json_file, load_config, and save_config to reliably read/write JSON and ensure the app config directory exists.
Enhanced UI in src/app.py: added SortableTreeWidgetItem for numeric sorting by size, a collapsible filters panel built by _build_filters_panel, splitters and layout adjustments, buttons to expand/collapse groups, and improved results tree column sizing and behavior.
Deferred loading of the previous selection until showEvent to avoid initialization race conditions and added a _selection_loaded guard.
Replaced repository config.json contents with an empty object and removed several stray files that appeared to be artifacts.
Testing
Executed python scripts/validate_repo.py which reported no conflict markers and succeeded compiling src and main.py (validation passed).
Confirmed the new GitHub Actions job Validate runs python scripts/validate_repo.py on pull_request and push as defined in /.github/workflows/validate.yml (workflow added).
load_config falls back to LEGACY_CONFIG_FILE whenever the parsed user config is an empty dict because it checks truthiness (if config) instead of file existence. In the case where ~/.duplicate-file-cleaner/config.json is intentionally reset to {} (or otherwise empty), the app will unexpectedly load legacy settings from config.json in the working directory, reintroducing stale paths/filters and undermining the migration behavior.
The validation workflow is positioned as repository-wide, but check_conflict_markers only inspects main.py and src/**/*.py; unresolved merge markers in files like workflow YAML, docs, or config files will still pass CI. That means this guard can miss exactly the class of merge artifacts it is intended to block unless the scan covers the broader repository tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
config.jsoncontents to avoid leaking local paths.Description
/.github/workflows/validate.ymlthat runspython scripts/validate_repo.pyonpull_requestandpushtomain.scripts/validate_repo.pywhich checks for conflict markers and branch artefacts, and compilessrcandmain.pywithcompileall, returning non-zero on failure..gitignoreto ignoreconfig.jsonand added a local app config directory~/.duplicate-file-cleanerusage insrc/app.pywith migration from legacyconfig.jsonin the repo root via_migrate_legacy_config_if_needed._read_json_file,load_config, andsave_configto reliably read/write JSON and ensure the app config directory exists.src/app.py: addedSortableTreeWidgetItemfor numeric sorting by size, a collapsible filters panel built by_build_filters_panel, splitters and layout adjustments, buttons to expand/collapse groups, and improved results tree column sizing and behavior.showEventto avoid initialization race conditions and added a_selection_loadedguard.config.jsoncontents with an empty object and removed several stray files that appeared to be artifacts.Testing
python scripts/validate_repo.pywhich reported no conflict markers and succeeded compilingsrcandmain.py(validation passed).Validaterunspython scripts/validate_repo.pyonpull_requestandpushas defined in/.github/workflows/validate.yml(workflow added).Codex Task