Generator for Yeoman that scaffolds cross-platform C++ projects with GitHub and VS Code integrations. Example.
I like trying new ideas with C++. Setting up a new C++ project for me is so time-consuming that I often find myself spending more time configuring it than actually coding. On top of that, I tend to skip quality tools such as unit testing, SCA and linting in the early stages and then suffer to make them work with already-existing code base. To address all that, I've made this generator. For myself. With technologies that I am often using. With structure that makes sense best to me. Then I thought it could be useful for somebody. So here it is.
Pre-requisites:
npm install -g generator-cpp-github
yo cpp-github:app
code .
See an example of the project that has been generated with it.
yo cpp-github:lib
code .
See an example of the project that has been generated with it.
yo cpp-github:[type] --validate
This will check that your folder structure is the same as in the reference template.
- C++20
- macOS(apple-clang 14), Linux(gcc 9) and Windows(MSVC 193)
- just
- Conan 2.0
- CMake + ccache + Ninja(on all platforms)
- GoogleTest
- clang-format
- Sonar Lint
- cppcheck
- Python 3 + black
- Homebrew, Chocolatey and Apt
- GitHub Action
- Docker
- VS Code + Grammarly + CodeWhisper
- GPL-3.0 license is generated by default just to have something. Not enforced
- Use existing open-source tools as much as possible. Minimize custom solutions
- Prefer tools that are easy to set up over highly-customizable complex tools
- Prefer cross-toolchain tools over toolchain-specific solutions. Example - SonarLint over clang-tidy
- The project is as self-contained as possible. If something is needed to be installed/configured by the developer - there should be a task to do it within the project. Exception - task runner itself and basics such as git
- Everything should be usable from the local machine. No "CI-specific" solutions. Local ease of use is a priority
- Thin CI-integration. CI just executes the same tasks that the developer can execute locally
- Latest C++ standard
- Code-style is enforced
- Unit-testing is enforced
- Maximum possible SCA and linter strictness is enforced
- Dependencies should be versioned(where possible)
- If something is unused then it should be removed
- VS Code is the editor of choice. However, editor-independent solutions are preferred
- You should be able to build, test, debug and analyze the project without the editor. CLI solutions are preferred
- macOS, Linux and Windows are the target platforms
- Trunk-based development
- Forbid merge into the
main
unless PR passed all quality checks on a CI - Squash merge strategy. Every commit in the
main
is self-contained - Every commit in the
main
branch is a release candidate - Every commit in the
main
branch has the unique version