{"id":31768931,"url":"https://github.com/tktech/comscrub","last_synced_at":"2025-10-10T02:22:30.365Z","repository":{"id":315537172,"uuid":"1059877947","full_name":"TkTech/comscrub","owner":"TkTech","description":"Strips all comments from C/C++/Obj-C/Obj-C++ sources and headers.","archived":false,"fork":false,"pushed_at":"2025-09-19T06:02:06.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-02T01:43:52.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TkTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"TkTech","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-09-19T04:42:07.000Z","updated_at":"2025-09-19T06:02:09.000Z","dependencies_parsed_at":"2025-09-19T07:41:19.315Z","dependency_job_id":"264fb10d-b7ce-4fd0-a57c-29b980010475","html_url":"https://github.com/TkTech/comscrub","commit_stats":null,"previous_names":["tktech/comscrub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TkTech/comscrub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TkTech%2Fcomscrub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TkTech%2Fcomscrub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TkTech%2Fcomscrub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TkTech%2Fcomscrub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TkTech","download_url":"https://codeload.github.com/TkTech/comscrub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TkTech%2Fcomscrub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002539,"owners_count":26083399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T02:22:29.182Z","updated_at":"2025-10-10T02:22:30.357Z","avatar_url":"https://github.com/TkTech.png","language":"Python","funding_links":["https://github.com/sponsors/TkTech"],"categories":[],"sub_categories":[],"readme":"comscrub\n=========\n\nStrip comments from C-family source files using libclang’s tokenizer. Unlike\nregex-based approaches, this relies on clang’s understanding of the language,\nso strings and tricky edge cases are handled correctly.\n\nUsage\n-----\n\n- CLI: `comscrub file.c` (or `python -m comscrub file.c`).\n- Prints to stdout by default; use `--inplace` to rewrite files.\n- Remove only line comments with `--line-comments-only` (keeps `/* ... */`).\n\nExamples:\n\n- `comscrub data/sample.c`\n- `comscrub --inplace data/sample.c`\n- Remove only line comments: `comscrub --line-comments-only data/sample.cpp`\n- Force language (otherwise inferred from extension): `comscrub -x c++ foo.hpp`\n- Pass extra clang args (repeatable): `comscrub --clang-arg -std=c11 file.c`\n\n\nOne-liners:\n\n- In‑place across repo (batch files safely):\n   - find . -type f \\( -name '*.cpp' -o -name '*.hpp' \\) -exec uv run comscrub --inplace {} +\n- Dry‑run to stdout (one file at a time to keep outputs separate):\n   - find . -type f \\( -name '*.cpp' -o -name '*.hpp' \\) -exec uv run comscrub {} \\;\n- Only remove line comments:\n   - find . -type f \\( -name '*.cpp' -o -name '*.hpp' \\) -exec uv run comscrub --line-comments-only --inplace {} +\n- Handle paths with spaces using null‑sep + xargs:\n   - find . -type f \\( -name '*.cpp' -o -name '*.hpp' \\) -print0 | xargs -0 uv run comscrub --inplace\n- Exclude common build/VC dirs:\n   - find . -type d \\( -name .git -o -name build -o -name dist \\) -prune -o -type f \\( -name '*.cpp' -o -name '*.hpp' \\) -exec uv run comscrub --inplace {} +\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftktech%2Fcomscrub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftktech%2Fcomscrub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftktech%2Fcomscrub/lists"}