{"id":13648346,"url":"https://github.com/Sarcasm/compdb","last_synced_at":"2025-04-22T07:31:14.792Z","repository":{"id":49761122,"uuid":"62843631","full_name":"Sarcasm/compdb","owner":"Sarcasm","description":"The compilation database Swiss army knife","archived":false,"fork":false,"pushed_at":"2024-02-20T14:56:12.000Z","size":171,"stargazers_count":313,"open_issues_count":11,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-13T04:11:24.614Z","etag":null,"topics":["clang","compilation-database"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sarcasm.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2016-07-07T23:08:35.000Z","updated_at":"2025-04-11T03:38:33.000Z","dependencies_parsed_at":"2024-06-19T01:30:46.844Z","dependency_job_id":"4561157d-6bce-4993-894d-e51024fba5bf","html_url":"https://github.com/Sarcasm/compdb","commit_stats":{"total_commits":149,"total_committers":4,"mean_commits":37.25,"dds":"0.020134228187919434","last_synced_commit":"62b4c0f6daa0654256a0ae9036d59cd5026f280f"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Fcompdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Fcompdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Fcompdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarcasm%2Fcompdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sarcasm","download_url":"https://codeload.github.com/Sarcasm/compdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250195033,"owners_count":21390230,"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","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":["clang","compilation-database"],"created_at":"2024-08-02T01:04:09.892Z","updated_at":"2025-04-22T07:31:14.527Z","avatar_url":"https://github.com/Sarcasm.png","language":"Python","readme":"compdb: the compilation database Swiss army knife\n=================================================\n\n.. contents:: :local:\n\n\nIntroduction\n------------\n\ncompdb_ is a command line tool to manipulates compilation databases.\nA compilation database is a database for compile options,\nit has records of which compile options are used to build the files in a project.\nAn example of compilation database is the `JSON Compilation Database`_\n\n``compdb`` aims to make it easier for you to run tools on your codebase\nby spoon-feeding you the right compile options.\n\n``compdb`` is not so much about generating the initial compilation database,\nthis, is left to other tools, such as ``cmake`` and ``ninja``.\nIt is only a glue between the initial compilation database and your tool(s).\n\n\nMotivation\n----------\n\nWith the proliferation of Clang-based tools,\nit has become apparent that the compile options\nare no longer useful uniquely to the compiler.\n\nStandalone tools such as clang-tidy_\nor text editors with libclang_ integration have to deal with compile options.\n\nExamples of such tools, dealing with compilation databases are:\nirony-mode_, rtags_ and ycmd_.\n\nBased on this evidence, ``compdb`` came to life.\nA tool that has knowledge of the compile options and can share it\nboth to inform the text editor and to run clang based tool from the shell.\n\n\nGetting started\n---------------\n\nInstallation\n~~~~~~~~~~~~\n\nInstall with pip_::\n\n  pip install compdb\n\nFrom Github, as user::\n\n  pip install --user git+https://github.com/Sarcasm/compdb.git#egg=compdb\n\n\nGenerate a compilation database with header files\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAssuming a build directory ``build/``, containing a ``compile_commands.json``,\na new compilation database, containing the header files,\ncan be generated with::\n\n  compdb -p build/ list \u003e compile_commands.json\n\n\nRunning the tests\n~~~~~~~~~~~~~~~~~\n\nTo run the tests, type::\n\n  python -m tests\n\nOr::\n\n  tox --skip-missing-interpreters\n\nFor regression tests on a few open source projects::\n\n  cd tests/regression/headerdb\n  make [all|help]\n\n\nContribute\n----------\n\nContributions are always welcome!\n\nTry to be consistent with the actual code, it will ease the review.\n\n\nLicense\n-------\n\nThis project is licensed under the MIT License.\nSee LICENSE.txt for details.\n\n\nAcknowledgments\n---------------\n\n* repo_: for its ubiquitous command line interface,\n  which served as an inspiration\n* scan-build_: for the clear Python package design\n* git_: for the ``git-config`` API\n* `julio.meroh.net`_: for the interesting article serie on `CLI design`_\n\n\n.. _clang-tidy: http://clang.llvm.org/extra/clang-tidy/\n.. _CLI design: https://julio.meroh.net/2013/09/cli-design-series-wrap-up.html\n.. _compdb: https://github.com/Sarcasm/compdb\n.. _git: https://git-scm.com/\n.. _irony-mode: https://github.com/Sarcasm/irony-mode\n.. _julio.meroh.net: https://julio.meroh.net/\n.. _JSON Compilation Database: http://clang.llvm.org/docs/JSONCompilationDatabase.html\n.. _libclang: http://clang.llvm.org/doxygen/group__CINDEX.html\n.. _pip: https://pip.pypa.io/\n.. _repo: https://gerrit.googlesource.com/git-repo/\n.. _rtags: https://github.com/Andersbakken/rtags\n.. _scan-build: https://github.com/rizsotto/scan-build\n.. _ycmd: https://github.com/Valloric/ycmd\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSarcasm%2Fcompdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSarcasm%2Fcompdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSarcasm%2Fcompdb/lists"}