Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 3.97 KB

CONTRIBUTING.md

File metadata and controls

61 lines (43 loc) · 3.97 KB

Contributing

Thank you for your interest in contributing to palpatine! 🪅

"The Dark Side Of The Force Is A Pathway To Many Abilities Some Consider To Be Unnatural." - Palpatine

Discuss the change you wish to make via issues page

Environment setup

macOS

First install Homebrew if you don't have it already. If you don't have Xcode installed, you can at least run the xcode-select --install command to install the command line tools. This will ensure you have (clang++, gcc, git etc.) installed.
Test if you have the required tools with;

  • clang++ --version , if not install by running brew install clang++
  • cmake --version (tested with 3.15.4) - if not install with brew install cmake
  • make --version - if not install with brew install make

Linux

Tested on Ubuntu 20.04.5 LTS (Focal Fossa) with;

  • clang++ --version , if not install by running sudo apt install clang++
  • cmake --version (tested with 3.15.4) - if not install with sudo apt install cmake
  • make --version - if not install with sudo apt install make

Building

Clone the repository and run either ./palpatine or make prepare in the root directory of the project.

Note: If you get permission denied error when running ./palpatine you can run chmod +x palpatine to give the executable permission to run. See more about chmod here.

This automates the traditional cmake build process (i.e. mkdir build && cd build && cmake .. && make) and creates an executable file in the build/app directory. Preview the prepare command in Makefile and executable palpatine script to see what commands are being run for better understanding.

Unit testing

cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target unit_tests
cd tests
./unit_tests

Dependencies

CMake is used to configure the following dependencies as git submodules, and they will be installed in the external directory when the Building step is completed:

  • p-ranav/argparse - A single-file header-only C++11 library for parsing command line arguments.
  • ikalnytskyi/termcolor - A header-only C++ library for printing colored messages to a terminal.
  • nlohmann/json - JSON for Modern C++. Used to parse the config file and generate the static site.

You can visualize these dependencies by running make prepare in your terminal and view the image file from build/dependency.png. This command will require graphviz and dot to be installed in your system.
You can install this with brew install graphviz && brew install dot

This step is completely optional and only useful to visualize what dependencies are required. Currently, it looks like this -

CleanShot 2022-11-03 at 23 37 13@2x

Raise PR

  1. Run clang-format -i src/* and clang-tidy ./src/*.h ./src/*.cpp ./app/main.cpp -p build to format and lint your changes.

Note: If you get clang-tidy: command not found error, you can install it with brew install clang-tidy on macOS or sudo apt install clang-tidy on Linux. The -p build flag is used to specify the build directory for the compilation database. See more about clang-tidy here.

  1. Update the README.md depending on the changes you made.
  2. Increase the version numbers MAJOR.MINOR.PATCH that this change will be released as.