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

Test find_traps.py's search of the committed SDL2 code

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

@ian0318git is already working on this.

Since Oct 21, 2026.

  • #25 by @ian0318git — open

Assessment

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

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

good first issue

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:

  1. creates a git repo in the build folder with a main.c that contains if (SDL_Init(SDL_INIT_VIDEO) != 0), and commits it
  2. rewrites that line to if (!SDL_Init(SDL_INIT_VIDEO))
  3. runs find_traps.py on the folder and expects a main.c:<line> (HEAD): hit in the init.md: bool-returns section

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 in CMakeLists.txt lines 238-244
  • plugins/sdl3-porter/evals/blend-by-default/scaffold.sh line 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

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.