IRNAS / irnas-guidelines-docs

This repository contains guidelines related to various aspects of managing GitHub repositories at IRNAS and working with them.
Other
3 stars 1 forks source link

Select a coding style for C/C++ and start enforcing it with clang-format #16

Closed MarkoSagadin closed 2 years ago

MarkoSagadin commented 2 years ago

Context

We do not follow any exact coding standard. Sometime ago Barr's C standard was recommended to be followed however, this was never enforced, therefore it was left to the programmers discipline to follow it.

Goal

Decide on a common coding style and start enforcing it with clang-format. Decide on the minimal amount of code comments, where they should be, how should they look like. Above two lines should produce a markdown document that will be located in irnas-core repository. This document needs to be referenced in every project's main README file.

Details

Installation of clang-format should be taken by the script that performs VS Code setup, apt package manager on Ubuntu 20.04 downloads version 10, which came out 2 years ago, although version 13 is already out.

Clang-format is already used on nRF5 SDK projects. I started with a configuration template that I copied from Zephyr project and changed few things.

MarkoSagadin commented 2 years ago

This was done inside of clang-format folder.