Skip to content

Development Setup

Requirements

Bazel configuration

Check out the bazelrc files in the .build folder to help configure Spoor for your environment.

Build

bazel build //...

Test

bazel test //...

Style and lint

Format C++, Objective-C, and Python

bazel build //... --aspects toolchain/style/style.bzl%format --output_groups=report

Format Starlark

bazel run //toolchain/style:buildifier

Lint C++ and Python

bazel build //... --aspects toolchain/style/style.bzl%lint --output_groups=report

CI toolchain

CI uses the LLVM toolchain when running the linter.

--crosstool_top=//toolchain/crosstool:llvm_toolchain
./toolchain/copyright_header/add_copyright_header.sh

Compilation database

Generate a compile_commands.json compilation database used by Clang Tidy for linting and by some IDEs to offer code completion. Details.

./toolchain/compilation_database/generate_compilation_database.sh

Documentation

Build

mkdocs build

Live preview server

mkdocs serve
INFO     -  Building documentation...
INFO     -  Cleaning site directory
INFO     -  Documentation built in 0.80 seconds
INFO     -  [00:00:00] Serving on http://127.0.0.1:8000/