Skip to content

Add code linting

Tyler Tsui requested to merge ci/lint into master

Context:

Ci/lint branch adds a pipeline that checks the format style of any code being pushed into the project. The purpose of this is to ensure that any code written retains a uniformed standard. This guarantees that any code within this project is easy to read and understand. The format styler that was chosen is Clang-Format, a widely used format style for c++ coding.

Overview:

When code is being pushed, the pipeline will check if the make format command was used to correctly format the code. If the code conforms the Clang-Format styling, it wil allow the code to be added to the branch. Otherwise, the pipeline will fail and give a warning to run the make format command.

Two make commands were added in this merge request: make format and make lint. The former will apply the Clang-Format to all the files currently in the working directory and format the code accordingly. The latter will indicate where there are errors in styling and display it to the user without changing any of the code.

How was this tested?

Tested locally and in the pipeline. See history. In order to test locally, you'll need to install Clang-format and have access to a linux command line interface (like cygwin).

Important Note:

The reason that this merge request displays such a large number of changes within the code is due to the fact that the code was formatted. None of the code functionalities were changed and the code itself remains the same save for indentations and spacing.

Edited by Tyler Tsui

Merge request reports