fix(manager): skip ignored files early to suppress spurious warnings#124
Open
TimeToBuildBob wants to merge 1 commit intoActivityWatch:masterfrom
Open
fix(manager): skip ignored files early to suppress spurious warnings#124TimeToBuildBob wants to merge 1 commit intoActivityWatch:masterfrom
TimeToBuildBob wants to merge 1 commit intoActivityWatch:masterfrom
Conversation
Files like aw-qt.spec are already in ignored_filenames, but the discovery loop only checked ignored_filenames via filter_modules after building the module list. This meant non-executable matches (e.g. aw-qt.spec on Windows) still triggered 'Found matching file but was not executable' warnings before being filtered out. Skip ignored filenames at the start of the loop so they never reach the warning branch. Also moves the _filename_to_name() call up so it's computed once and reused. Fixes spurious warnings reported in ActivityWatch#110.
Contributor
Greptile SummaryThis PR makes a small, targeted fix to Key changes:
No issues found. The logic is correct, consistent with the existing Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[glob aw-* in directory] --> B[for each match: compute basename]
B --> C["name = _filename_to_name(basename)"]
C --> D{name in ignored_filenames?}
D -- yes --> E[continue ⟵ NEW early exit\nsuppresses spurious WARNING]
D -- no --> F{is_executable AND\nstartswith 'aw-'?}
F -- yes --> G["modules.append(Module(name, path, 'bundled'))"]
F -- no --> H{isdir AND\nos.X_OK?}
H -- yes --> I[recurse into subdirectory]
H -- no --> J[logger.warning: not executable]
Last reviewed commit: f708523 |
This was referenced Mar 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Files like
aw-qt.spec(the PyInstaller spec file) are already inignored_filenames, but the discovery loop only appliedfilter_modules()after building the module list. This meant non-executable files matchingaw-*(e.g.aw-qt.specon Windows) still hit the warning branch before being filtered out, resulting in:This confused users since it looks like an error but is actually harmless. Reported in #110.
Fix
Skip
ignored_filenamesat the top of the loop so they never reach the warning branch. Also hoists_filename_to_name()so it's computed once and reused.Changes
_discover_modules_in_directory: earlycontinuefor ignored filenamesname = _filename_to_name(basename)before theis_executablecheckNo behavior change for any legitimate module — only suppresses the spurious warning for files that were already going to be ignored.