This repository provides CLion style settings which are as close as possible to ROS 2 coding style found here: https://github.com/ros2/ros2/wiki/Developer-Guide#language-versions-and-code-format
In CLion go to File - Settings Repository and add this repository as Upstream URL. Afterwards click Merge or Overwrite Local.