{"id":18378088,"url":"https://github.com/mlabbe/cleanup-compdb","last_synced_at":"2026-03-05T09:01:42.964Z","repository":{"id":143152018,"uuid":"570319332","full_name":"mlabbe/cleanup-compdb","owner":"mlabbe","description":"Postprocess and clean up compile_commands.json","archived":false,"fork":false,"pushed_at":"2025-04-10T13:02:53.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-30T21:05:27.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlabbe.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-11-24T22:15:51.000Z","updated_at":"2025-04-10T13:02:57.000Z","dependencies_parsed_at":"2025-04-14T02:06:32.117Z","dependency_job_id":"c0438e75-77a2-4557-8d91-cbff6276cc6f","html_url":"https://github.com/mlabbe/cleanup-compdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mlabbe/cleanup-compdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabbe%2Fcleanup-compdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabbe%2Fcleanup-compdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabbe%2Fcleanup-compdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabbe%2Fcleanup-compdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlabbe","download_url":"https://codeload.github.com/mlabbe/cleanup-compdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabbe%2Fcleanup-compdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-11-06T00:31:07.706Z","updated_at":"2026-03-05T09:01:42.904Z","avatar_url":"https://github.com/mlabbe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compilation Database Cleanup #\n\nPostprocess and clean up your `compilation_commands.json`, as generated from your build tool.  Does the following:\n\n - Append to the compile arguments, useful for suppressing additional warnings\n - Converts relative paths into absolute paths for increased readability\n - Removes problematic `cmd /C` prefix in commands on Windows, which confuses clangd\n - Strip linker commands and phony targets which are not real compilation commands\n - Increases readability with unix-style slashes on all platforms (clangd on Windows accepts this)\n \n## Rationale ##\n\nCompilation databases are useful for getting an editor to preview compile errors or provide semantic context while adhering to a specific mode of compilation.  Intutitively, the best way to generate them is to have your existing build tooling generate them so the compile commands match how the project is actually being built.\n\nHowever, in practice, the set of arguments that produces the most timely error messages can vary from the final compilation settings.  For instance, it can be annoying that an unused function is generating a warning in the editor.  However, it is useful during compilation time, so adding `-Wno-unused-function` to the compilation database configures an editor to prevent this warning, while continuing to generate it at compile time.\n\nFurther afield, cleanup-compdb can be used to provide compatibility to clangd for [unity builds](https://en.wikipedia.org/wiki/Unity_build).  This [blog post](https://www.frogtoss.com/labs/clangd-with-unity-builds.html) proposes a solution to this problem.\n\n## Changelog ##\n\nrelease | what's new                  | date\n--------|-----------------------------|---------\n0.0.1   | initial                     | jan 2023\n0.2.1   | better error handling       | apr 2025\n\n## Usage ##\n\n`cd` to your project root, and:\n\n`ninja -t compdb | cleanup-compdb \u003e compile_commands.json`\n\n## Project Status ##\n\nTested and working with Ninja 1.10 through 1.12 over three years on Linux, Windows and MacOS.  In continued use by the author.\n\nRecommended for public use.\n\n# Copyright and Credit #\n\nCopyright \u0026copy; 2022-2025 [Frogtoss Games](http://www.frogtoss.com), Inc.\nFile [LICENSE](LICENSE) covers all files in this repo.\n\nCompilation Database Cleanup by Michael Labbe\n\u003cmike@frogtoss.com\u003e\n\n[json_compilation_db crate](https://github.com/rizsotto/json_compilation_db) by László Nagy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabbe%2Fcleanup-compdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlabbe%2Fcleanup-compdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabbe%2Fcleanup-compdb/lists"}