Skip to content

brobeson/CppStarter

Repository files navigation

CppStarter

Static Analysis

This is a template repository to start a new C++ project.

Using This Template

  1. In GitHub, click Use this template, then click Create a new repository.
  2. Fill out the form for your new repository. The values shouldn't affect the template's behavior.
  3. Wait for GitHub to create your new repository.
  4. After GitHub creates your repository, run the New Project Setup workflow.
    1. Click the Actions tab.
    2. Click the New Project Setup workflow.
    3. Click the Run workflow combobox.
    4. Set Use workflow from to Branch: main.
    5. Click the Run workflow button.

New Project Setup Workflow

The New Project Setup workflow customizes your new project. The workflow performs these steps:

  1. Clone the repository
  2. Change all instances of CppStarter to the new repository's name
  3. Remove the workflow file and shell script
  4. Remove these instructions from README.md
  5. Create a Next Release milestone
  6. Commit and push the changes to main

What You Get From This Template

This template repository provides all the boiler plate to get started with a high quality C++ project.

A C++ Project

The template provides a complete C++ project that builds and runs.

  • CMake infrastructure to generate a build system.
  • A simple unit test that builds and runs.

GitHub Workflows

The template includes GitHub workflows that run right out of the box.

  • Support File Quality
    This workflow ensures there are no mistakes in project support files such as Markdown documentation and tool configuration files.
  • C++ Build
    Runs debug and release builds on Ubuntu, MacOS, and Windows.
  • C++ Static Analysis
    Runs static analysis tools on the C++ code.

Visual Studio Code Configuration

I use Visual Studio Code, so this template includes settings, tasks, and extension recommendations for that IDE.

Tasks

The VS Code configuration includes a set of tasks to emulate the GitHub workflows. These can help you check the entire code base of your project before pushing. Each task has the prefix ProjectName:, where "ProjectName" is the name of the repo you create from the template. The available tasks are:

  • ProjectName: Spell Check - Run CSpell on all files in the repository. Spelling mistakes are captured in the Problems panel.
  • ProjectName: Markdownlint - Run Markdownlint on all Markdown files in the repository. Markdown mistakes are captured in the Problems panel.
  • ProjectName: Prettier Format - Run Prettier on all files in the repository. This doesn't report formatting errors; it reformats the files in-place.
  • ProjectName: Pipeline - Run all the other tasks. This is a shortcut to invoke all the other tasks with a single command.

About

A template repository for C++ projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published