Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

find_traps.py: fail on a path that doesn't exist

Open Beginner friendly
#17 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
90/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cmake, python
Domain
testing, tooling

Research direction

Read source_files() and the start of main() in plugins/sdl3-porter/skills/sdl3-porter/scripts/find_traps.py, then compare the find-traps-hint-* tests in CMakeLists.txt. Run the provided Python command to check missing-path behavior, then configure and build before running the find-traps CTest tests. Done means the missing path produces a non-zero exit with its name, the new find-traps-missing-path test passes, and the rest of CTest passes.

Written by the indexing model from the issue text.

Description

bug good first issue

find_traps.py skips a path it can't find without saying so. find_traps.py src inclde sweeps src, ignores the typo and exits 0, so an agent believes it swept code it never read. The only error comes when no path has sources, and that message doesn't say the path is missing.

What to do

Check each path before collecting files. If one doesn't exist, exit non-zero with a message that names it, such as No such file or folder: inclde. Then add a CTest test named find-traps-missing-path that runs the script on one real folder and one missing one. It should pass only on that message.

Where to look

  • plugins/sdl3-porter/skills/sdl3-porter/scripts/find_traps.py: source_files() (line 75) and the start of main() (line 125).
  • CMakeLists.txt lines 259-271: the find-traps-hint-* tests run the script and match its output with PASS_REGULAR_EXPRESSION. Use the same shape.

Done when

  • A missing path stops the script with a non-zero exit and a message that names the path.
  • The new test passes, and so does the rest of ctest.

Testing it

python3 plugins/sdl3-porter/skills/sdl3-porter/scripts/find_traps.py samples/bounce/src no-such-dir
cmake -S . -B build
cmake --build build --config Debug
ctest --test-dir build -C Debug -R find-traps --output-on-failure

The first configure downloads and builds SDL, which takes a few minutes.

Dominant language
C
Stars
1
Forks
1
Avg merge
3m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hazeliscoding/sdl3-porter

All issues in hazeliscoding/sdl3-porter

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.