Skip to content

chore: remove dead code Util::copyDir#855

Merged
annejan merged 11 commits intomainfrom
chore/remove-dead-code-copyDir
Mar 30, 2026
Merged

chore: remove dead code Util::copyDir#855
annejan merged 11 commits intomainfrom
chore/remove-dead-code-copyDir

Conversation

@nogeenhenk
Copy link
Copy Markdown
Contributor

Summary

Removes the unused Util::copyDir function from the codebase.

Background

From issue #842:

The static function Util::copyDir in src/util.cpp is only called from unit tests, never from production code.

History

Investigation

Checked usage of all Util static functions:

Function Used in Production
findBinaryInPath Yes
findPasswordStore Yes
normalizeFolderPath Yes
checkConfig Yes
getDir Yes
endsWithGpg Yes
protocolRegex Yes
newLinesRegex Yes
copyDir No (only in tests)

Changes

  • Removed copyDir declaration from src/util.h
  • Removed copyDir implementation from src/util.cpp
  • Removed 4 test functions from tests/auto/util/tst_util.cpp
  • Updated skill documentation

Testing

Build and run tests to verify nothing is broken.

Closes #842

Add paths filters to skip CI when irrelevant files change:
- ccpp.yml: src/**, tests/**, Qt files, localization, icons, docs
- codeql.yml: only C++ code
- publiccode.yml: only publiccode.yml
- reuse.yml: unfiltered (repo-wide compliance check)

Also adds merge_group trigger (without branches filter).

Note: paths filtering is only used for non-required checks.
- Remove paths filter from workflow triggers
- Add dorny/paths-filter to detect changed files
- Make expensive jobs conditional based on changes
- merge_group always runs all jobs

This avoids the 'pending required check' issue by keeping
workflows always running but skipping expensive jobs internally.
- Add changes job to detect relevant file changes
- Make expensive jobs conditional based on changes
- merge_group and tags always run builds
- Tags still trigger builds for releases
- Add no-op job to each workflow that runs when no relevant files changed
- No-op jobs emit a success result instead of being skipped
- This ensures required checks always report (success or skipped, never pending)

This completes the fix for issue where path filtering caused required checks to stay pending.
- Remove job-level 'if' condition that caused SKIPPED status
- Add step-level conditionals to skip heavy work when no changes
- Job always reports SUCCESS instead of being skipped
- This fixes required checks staying pending
- Remove job-level 'if' conditions that caused SKIPPED status
- Add step-level conditionals to skip heavy work when no changes
- Jobs always report SUCCESS instead of being skipped
- This fixes required checks staying pending
- copyDir was never called from production code (only tests)
- Added in 2017 by Anne Jan Brouwer, purpose unclear
- Tests were added later but no production usage ever
- Fixes issue #842
@annejan annejan merged commit 431a8b9 into main Mar 30, 2026
21 of 22 checks passed
@annejan annejan deleted the chore/remove-dead-code-copyDir branch March 30, 2026 02:39
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.

Dead code: Util::copyDir is never called from production code

2 participants