Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

This guide walks through setting up an rsconstruct project for the two primary supported languages: Python and C++.

Python

Prerequisites

Setup

Create a project directory and configuration:

mkdir myproject && cd myproject
# rsconstruct.toml
[processor.ruff]

Create a Python source file:

mkdir -p src
# src/hello.py
def greet(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    print(greet("world"))

Run the build:

rsconstruct build

Expected output:

Processing ruff (1 product)
  hello.py

Run again — nothing has changed, so rsconstruct skips the check:

Processing ruff (1 product)
  Up to date

Adding pylint

Install pylint and add a section for it:

# rsconstruct.toml
[processor.ruff]

[processor.pylint]

Pass extra arguments via processor config:

[processor.pylint]
args = ["--disable=C0114,C0115,C0116"]

Adding spellcheck for docs

If your project has markdown documentation, add a section for the spellcheck processor:

[processor.ruff]

[processor.pylint]

[processor.spellcheck]

Create a .spellcheck-words file in the project root with any custom words (one per line) that the spellchecker should accept.

C++

Prerequisites

Setup

Create a project directory and configuration:

mkdir myproject && cd myproject
# rsconstruct.toml
[processor.cc_single_file]

Create a source file under src/:

mkdir -p src
// src/hello.c
#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}

Run the build:

rsconstruct build

Expected output:

Processing cc_single_file (1 product)
  hello.elf

The compiled executable is at out/cc_single_file/hello.elf.

Run again — the source hasn’t changed, so rsconstruct restores from cache:

Processing cc_single_file (1 product)
  Up to date

Customizing compiler flags

Pass flags via processor config:

[processor.cc_single_file]
cflags = ["-Wall", "-Wextra", "-O2"]
cxxflags = ["-Wall", "-Wextra", "-O2"]
include_paths = ["include"]

See the CC Single File processor docs for the full configuration reference.

Adding static analysis

Install cppcheck and add a section for it:

[processor.cc_single_file]

[processor.cppcheck]

Both processors run on the same source files — rsconstruct handles them independently.

Next Steps