Skip to content

Commit c200ee1

Browse files
committed
doc: Add documentation about code formatting to README
Document how to format source code and cmake files.
1 parent ccafc2d commit c200ee1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Protocol (OSP).
2222
- [Support](#support)
2323
- [Maintainer](#maintainer)
2424
- [Contributing](#contributing)
25+
- [Code style and formatting](#code-style-and-formatting)
26+
- [CMake formatting](#cmake-formatting)
2527
- [License](#license)
2628

2729
## Releases
@@ -82,6 +84,33 @@ request](https://github.com/greenbone/gvmd/pulls) on GitHub. Bigger changes need
8284
to be discussed with the development team via the [issues section at
8385
GitHub](https://github.com/greenbone/gvmd/issues) first.
8486

87+
### Code style and formatting
88+
89+
Before creating a pull request, it is recommended to run the following command:
90+
91+
```sh
92+
make format
93+
```
94+
95+
This reformats the new code to ensure that it follows the code style and
96+
formatting guidelines.
97+
98+
### CMake formatting
99+
100+
All CMake files are formatted using [gersemi](https://github.com/BlankSpruce/gersemi).
101+
To install gersemi on a Debian based system the following commands can be used:
102+
103+
```sh
104+
sudo apt install pipx
105+
pipx install gersemi
106+
```
107+
108+
To format all CMake files run the command:
109+
110+
```sh
111+
gersemi -i cmake .
112+
```
113+
85114
## License
86115

87116
Copyright (C) 2009-2025 [Greenbone AG](https://www.greenbone.net/)

0 commit comments

Comments
 (0)