]> git.ipfire.org Git - thirdparty/systemd.git/blame - docs/CODE_QUALITY.md
docs: move doc/ to docs/
[thirdparty/systemd.git] / docs / CODE_QUALITY.md
CommitLineData
7c2c028c
LP
1# Code Quality Tools
2
3The systemd project has a number of code quality tools set up in the source
4tree and on the github infrastructure. Here's an incomprehensive list of the
5available functionality:
6
71. Use `ninja -C build test` to run the unit tests. Some tests are skipped if
8 no privileges are available, hence consider also running them with `sudo
9 ninja -C build test`. A couple of unit tests are considered "unsafe" (as
10 they change system state); to run those too, build with `meson
11 -Dtests=unsafe`. Finally, some unit tests are considered to be very slow,
12 build them too with `meson -Dslow-tests=true`. (Note that there are a couple
13 of manual tests in addition to these unit tests.)
14
152. Use `./test/run-integration-tests.sh` to run the full integration test
16 suite. This will build OS images with a number of integration tests and run
17 them in nspawn and qemu. Requires root.
18
193. Use `./coccinelle/run-coccinelle.sh` to run all
20 [Coccinelle](http://coccinelle.lip6.fr/) semantic patch scripts we ship. The
21 output will show false positives, hence take it with a pinch of salt.
22
234. Use `./tools/find-double-newline.sh recdiff` to find double newlines. Use
24 `./tools/find-double-newline.sh recpatch` to fix them. Take this with a grain
25 of salt, in particular as we generally leave foreign header files we include in
26 our tree unmodified, if possible.
27
285. Similar use `./tools/find-tabs.sh recdiff` to find TABs, and
29 `./tools/find-tabs.sh recpatch` to fix them. (Again, grain of salt, foreign
30 headers should usually be left unmodified.)
31
e5988600 326. Use `ninja -C build check-api-docs` to compare the list of exported
7c2c028c
LP
33 symbols of `libsystemd.so` and `libudev.so` with the list of man pages. Symbols
34 lacking documentation are highlighted.
35
367. Use `ninja -C build hwdb-update` to automatically download and import the
37 PCI, USB and OUI databases into hwdb.
38
398. Use `ninja -C build man/update-man-rules` to update the meson rules for
40 building man pages automatically from the docbook XML files included in
41 `man/`.
42
439. There are multiple CI systems in use that run on every github PR submission.
44
4510. [Coverity](https://scan.coverity.com/) is analyzing systemd master in
46 regular intervals. The reports are available
47 [online](https://scan.coverity.com/projects/systemd).
48
4911. [oss-fuzz](https://oss-fuzz.com/) is continuously fuzzing the
50 codebase. Reports are available
51 [online](https://oss-fuzz.com/v2/testcases?project=systemd).
52
8b9e4b21 5312. Our tree includes `.editorconfig`, `.dir-locals.el` and `.vimrc` files, to
5cadf58e 54 ensure that editors follow the right indentiation styles automatically.
8b9e4b21
LP
55
5613. When building systemd from a git checkout the build scripts will
5cadf58e 57 automatically enable a git commit hook that ensures whitespace cleanliness.
8b9e4b21 58
8cc9d188
EV
5914. [LGTM](https://lgtm.com/) analyzes every commit pushed to master. The list
60 of active alerts can be found at
61 https://lgtm.com/projects/g/systemd/systemd/alerts/?mode=list.
62
63Access to Coverity and oss-fuzz reports is limited. Please reach out to the
64maintainers if you need access.