Skip to content

Add repo validation and conflict-fix tooling; migrate config and improve UI in src/app.py#11

Closed
VHugoDevIA wants to merge 5 commits into
mainfrom
codex/review-repository-code-p61gr6
Closed

Add repo validation and conflict-fix tooling; migrate config and improve UI in src/app.py#11
VHugoDevIA wants to merge 5 commits into
mainfrom
codex/review-repository-code-p61gr6

Conversation

@VHugoDevIA
Copy link
Copy Markdown
Owner

Motivation

  • Prevent broken commits caused by unresolved merge artifacts and keep Python sources syntactically valid before commit/CI.
  • Provide a quick way to clean common conflict markers introduced by automated review branch names.
  • Improve user configuration handling by migrating legacy config.json to a per-user config directory and make the app UI more robust and user-friendly.

Description

  • Add scripts/validate_repo.py to detect merge conflict tokens, codex/branch artifacts and Python syntax errors and to compile main.py and src for final validation.
  • Add scripts/fix_conflict_artifacts.py to sanitize files (default src/app.py) by removing conflict markers and branch artifacts and create a .bak backup when writing.
  • Install a local pre-commit hook .githooks/pre-commit that runs python scripts/validate_repo.py and a GitHub Actions workflow .github/workflows/validate.yml to run the same validation on PRs and pushes to main.
  • Update .gitignore to exclude local config.json and remove example/placeholder files; set config.json to an empty object.
  • Update README.md with quick conflict-resolution instructions and recommended Git settings and hook activation.
  • Substantially refactor src/app.py: migrate config storage to ~/.duplicate-file-cleaner/config.json with a migration path from the legacy repo config.json, add robust JSON read/write helpers, add SortableTreeWidgetItem for numeric sorting, reorganize UI (splitters, filter panel, expand/collapse controls, improved column sizing), defer loading selection until showEvent, and various small UI/UX tweaks.

Testing

  • Ran the repository validation script with python scripts/validate_repo.py, which returned success and compiled main.py and src without syntax or merge-artifact errors.
  • Added a GitHub Actions workflow .github/workflows/validate.yml to execute the same validation on PRs and pushes to main (CI not shown here but configured).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7253970f61

ℹ️ 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".

Comment thread src/app.py
Comment on lines +60 to +62
if config:
return config
return _read_json_file(LEGACY_CONFIG_FILE)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat empty user config as authoritative

When ~/.duplicate-file-cleaner/config.json exists but contains {} (a valid “reset” state), this branch falls back to config.json in the working directory and can silently resurrect stale legacy settings. That means users who clear their new profile config can still get old scan paths/modes loaded from the repo-local file, which defeats the migration behavior. The loader should distinguish “file missing/invalid” from “empty but valid JSON” instead of using truthiness here.

Useful? React with 👍 / 👎.

@VHugoDevIA VHugoDevIA closed this Mar 14, 2026
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