find_traps.py: fail on a path that doesn't exist
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 90/100
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
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 ofmain()(line 125).CMakeLists.txtlines 259-271: thefind-traps-hint-*tests run the script and match its output withPASS_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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hazeliscoding/sdl3-porter
-
trap-cards check: require every part of a trap cardPossibly taken A pull request linked to this issue is open or already merged. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
hazeliscoding/sdl3-porter#20 ·
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
hazeliscoding/sdl3-porter#19 ·
-
Test find_traps.py's search of the committed SDL2 codePossibly taken @ian0318git claimed this 3 days ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
hazeliscoding/sdl3-porter#18 ·
-
trap-cards check: require a sample and an eval case for every trapPossibly taken A pull request linked to this issue is open or already merged. Openenhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 82/100
hazeliscoding/sdl3-porter#21 ·
-
help wanted trap candidate
Difficulty 5/5 Over a week Newbie friendliness 25/100
hazeliscoding/sdl3-porter#16 ·
All issues in hazeliscoding/sdl3-porter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
FriendsofECCE/ECCE#519 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
containers/crun#2415 ·
Maintainers usually reply within 1 day
-
Bluetooth: Controller: memcpy() with NULL source in HCI extended and periodic reportsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zephyrproject-rtos/zephyr#123423 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day