Skip to main content

compdb: the compilation database Swiss army knife

Introduction

compdb is a command line tool to manipulates compilation databases. A compilation database is a database for compile options, it has records of which compile options are used to build the files in a project. An example of compilation database is the JSON Compilation Database

compdb aims to make it easier for you to run tools on your codebase by spoon-feeding you the right compile options.

compdb is not so much about generating the initial compilation database, this, is left to other tools, such as cmake and ninja. It is only a glue between the initial compilation database and your tool(s).

Motivation

With the proliferation of Clang-based tools, it has become apparent that the compile options are no longer useful uniquely to the compiler.

Standalone tools such as clang-tidy or text editors with libclang integration have to deal with compile options.

Examples of such tools, dealing with compilation databases are: irony-mode, rtags and ycmd.

Based on this evidence, compdb came to life. A tool that has knowledge of the compile options and can share it both to inform the text editor and to run clang based tool from the shell.

Getting started

Installation

Install with pip:

pip install compdb

>From Github, as user:

pip install --user git+https://github.com/Sarcasm/compdb.git#egg=compdb

For development:

pip install --user -e .

With setuptools:

python setup.py install

Running the tests

To run the tests, type:

python -m tests

Or:

tox --skip-missing-interpreters

For regression tests on a few open source projects:

cd tests/regression/headerdb
make [all|help]

Contribute

Contributions are always welcome!

Try to be consistent with the actual code, it will ease the review.

License

This project is licensed under the MIT License. See LICENSE.txt for details.

Acknowledgments

  • repo: for its ubiquitous command line interface, which served as an inspiration

  • scan-build: for the clear Python package design

  • git: for the git-config API

  • julio.meroh.net: for the interesting article serie on CLI design

Release files for compdb 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compdb 0.0.2
File Size Uploaded
compdb-0.0.2.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compdb 0.0.2
File Interpreter ABI Platform
compdb-0.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 45.2 kB

Release files / compdb-0.0.2.tar.gz

Download URL compdb-0.0.2.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
238c3bdcb42a343b16ebd4dde6503ff771a013471a779dd776fbc5d6b69f991b
BLAKE2b-256 checksum
How to use checksums
4fb601a0971e5be2943fc354f74e23e645a75aeaf86e7d0b05e7e17be5a9e2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / compdb-0.0.2-py2.py3-none-any.whl

Download URL compdb-0.0.2-py2.py3-none-any.whl
Size 25.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
10729518683f4799697152824fe08b864b8e00256a12ed3d66f616a9cec899cf
BLAKE2b-256 checksum
How to use checksums
5babd117cfede7c6e43a99d40d91d408553c3e8877c637e845e4a92f59177a9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.1

2 release files

0.1.0

3 release files

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page