Skip to content

Unit tests for filehelpfunctions.collect_python_source_files() #20

Merged
nocomplexity merged 2 commits intonocomplexity:mainfrom
jurgenwigg:test/ut-filehelpfunctions
Apr 22, 2026
Merged

Unit tests for filehelpfunctions.collect_python_source_files() #20
nocomplexity merged 2 commits intonocomplexity:mainfrom
jurgenwigg:test/ut-filehelpfunctions

Conversation

@jurgenwigg
Copy link
Copy Markdown
Contributor

@jurgenwigg jurgenwigg commented Apr 22, 2026

I've noticed strange behaviour in the collect_python_source_files() function:

dirs are completely unused. Is that expected?

EXCLUDE_DIRS could be a global constant for this module.

@jurgenwigg jurgenwigg marked this pull request as ready for review April 22, 2026 15:24
@nocomplexity
Copy link
Copy Markdown
Owner

Hi there! Thanks again so much for the PR—this is a really helpful addition!

I’m excited to get this merged. Adding more tests to these functions is a win; It will help us catch any tricky side effects down the road and keep the codebase stable. More tests on some functions will improve unwanted side effects in future!

The variable dirs is used in this function. dirs is used as a control mechanism for traversal. That’s how the function now avoids unwanted directories efficiently. The use of os.walk() combined with the slice assignment dirs[:] is a way to controls which subdirectories the loop will enter next. EXCLUDE_DIRS is only used in this function. Maybe in future configurable for users without touching code in a visual UI.

Great work, and thanks again for your contribution!

Regards!

@nocomplexity nocomplexity merged commit 87e0f8b into nocomplexity:main Apr 22, 2026
4 checks passed
nocomplexity added a commit that referenced this pull request Apr 22, 2026
@nocomplexity
Copy link
Copy Markdown
Owner

Updated file header: (C) 2026 @jurgenwigg
I do not want credit for your work!
Regards!

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.

2 participants