Skip to content

Add repo validation workflow; migrate config to user profile and refine UI (sorting, filters, preview)#7

Merged
VHugoDevIA merged 2 commits into
mainfrom
codex/review-repository-code-argiid
Mar 14, 2026
Merged

Add repo validation workflow; migrate config to user profile and refine UI (sorting, filters, preview)#7
VHugoDevIA merged 2 commits into
mainfrom
codex/review-repository-code-argiid

Conversation

@VHugoDevIA
Copy link
Copy Markdown
Owner

Motivation

  • 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).

Codex Task

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

if config:
return config
return _read_json_file(LEGACY_CONFIG_FILE)

P2 Badge Use app config file whenever it exists

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.


targets = [ROOT / "main.py", *(ROOT / "src").rglob("*.py")]

P2 Badge Expand conflict-marker scan beyond Python sources

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.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@VHugoDevIA VHugoDevIA merged commit 3c47d43 into main Mar 14, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant