Test find_traps.py's search of the committed SDL2 code
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Read cmake/check-trap-searches.py and the find-traps CTest registration in CMakeLists.txt, then inspect head_versions() in plugins/sdl3-porter/skills/sdl3-porter/scripts/find_traps.py and the commit example in plugins/sdl3-porter/evals/blend-by-default/scaffold.sh. Add the requested temporary-repository check and run the documented CMake and CTest commands; it is done when the (HEAD) hit is verified and the check fails if head_versions() returns {}.
Written by the indexing model from the issue text.
Description
For every file that differs from git's HEAD, find_traps.py also searches the committed version and marks those hits (HEAD), because some traps only show in the SDL2 code. SKILL.md step 6 relies on this, but no test covers it. Every current test runs the script on files that match HEAD, so a break in head_versions() would go unnoticed.
What to do
Add a check, run by CTest, that:
- creates a git repo in the build folder with a
main.cthat containsif (SDL_Init(SDL_INIT_VIDEO) != 0), and commits it - rewrites that line to
if (!SDL_Init(SDL_INIT_VIDEO)) - runs
find_traps.pyon the folder and expects amain.c:<line> (HEAD):hit in theinit.md: bool-returnssection
Pass the commit identity on the command line, and add -c commit.gpgsign=false so the commit works on machines that sign by default.
Where to look
plugins/sdl3-porter/skills/sdl3-porter/scripts/find_traps.py:head_versions()(line 94)cmake/check-trap-searches.py: a Python check that runs the script, registered inCMakeLists.txtlines 238-244plugins/sdl3-porter/evals/blend-by-default/scaffold.shline 10: a commit with its identity passed on the command line
Done when
- The test passes.
- Making
head_versions()return{}makes it fail. Try this locally, then revert it.
Testing it
cmake -S . -B build
cmake --build build --config Debug
ctest --test-dir build -C Debug -R find-traps --output-on-failure
- 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 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
hazeliscoding/sdl3-porter#17 ·
-
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
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
emerge failure MARK mark-unstable media-kit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
macaroni-os/mark-issues#834 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NVIDIA/open-gpu-kernel-modules#1479 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 93/100
webarkit/WebARKitLib#107 ·
Maintainers usually reply within 1 day