summaryrefslogtreecommitdiff
path: root/docs/CODE_QUALITY.md
diff options
context:
space:
mode:
authorFilipe Brandenburger <filbranden@google.com>2018-09-07 01:02:42 -0700
committerFilipe Brandenburger <filbranden@google.com>2018-09-08 13:39:03 -0700
commit9e825ebf4f5029ae6cb072ac568d7838e0762a9e (patch)
tree4950d3f39fa29f8513a797d313ca6b48fd04c131 /docs/CODE_QUALITY.md
parent9d0798a2edf05438499c7cb5def592d52358f397 (diff)
downloadsystemd-9e825ebf4f5029ae6cb072ac568d7838e0762a9e.tar.gz
docs: move doc/ to docs/
The docs/ directory is special in GitHub, since it can be used to serve GitHub Pages from, so there's a benefit to switching to it in order to expose it directly as a website. Updated references to it from the documentations themselves, from the CONTRIBUTING.md file and from Meson build files.
Diffstat (limited to 'docs/CODE_QUALITY.md')
-rw-r--r--docs/CODE_QUALITY.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/docs/CODE_QUALITY.md b/docs/CODE_QUALITY.md
new file mode 100644
index 0000000000..e673ad58ad
--- /dev/null
+++ b/docs/CODE_QUALITY.md
@@ -0,0 +1,64 @@
+# Code Quality Tools
+
+The systemd project has a number of code quality tools set up in the source
+tree and on the github infrastructure. Here's an incomprehensive list of the
+available functionality:
+
+1. Use `ninja -C build test` to run the unit tests. Some tests are skipped if
+ no privileges are available, hence consider also running them with `sudo
+ ninja -C build test`. A couple of unit tests are considered "unsafe" (as
+ they change system state); to run those too, build with `meson
+ -Dtests=unsafe`. Finally, some unit tests are considered to be very slow,
+ build them too with `meson -Dslow-tests=true`. (Note that there are a couple
+ of manual tests in addition to these unit tests.)
+
+2. Use `./test/run-integration-tests.sh` to run the full integration test
+ suite. This will build OS images with a number of integration tests and run
+ them in nspawn and qemu. Requires root.
+
+3. Use `./coccinelle/run-coccinelle.sh` to run all
+ [Coccinelle](http://coccinelle.lip6.fr/) semantic patch scripts we ship. The
+ output will show false positives, hence take it with a pinch of salt.
+
+4. Use `./tools/find-double-newline.sh recdiff` to find double newlines. Use
+ `./tools/find-double-newline.sh recpatch` to fix them. Take this with a grain
+ of salt, in particular as we generally leave foreign header files we include in
+ our tree unmodified, if possible.
+
+5. Similar use `./tools/find-tabs.sh recdiff` to find TABs, and
+ `./tools/find-tabs.sh recpatch` to fix them. (Again, grain of salt, foreign
+ headers should usually be left unmodified.)
+
+6. Use `ninja -C build check-api-docs` to compare the list of exported
+ symbols of `libsystemd.so` and `libudev.so` with the list of man pages. Symbols
+ lacking documentation are highlighted.
+
+7. Use `ninja -C build hwdb-update` to automatically download and import the
+ PCI, USB and OUI databases into hwdb.
+
+8. Use `ninja -C build man/update-man-rules` to update the meson rules for
+ building man pages automatically from the docbook XML files included in
+ `man/`.
+
+9. There are multiple CI systems in use that run on every github PR submission.
+
+10. [Coverity](https://scan.coverity.com/) is analyzing systemd master in
+ regular intervals. The reports are available
+ [online](https://scan.coverity.com/projects/systemd).
+
+11. [oss-fuzz](https://oss-fuzz.com/) is continuously fuzzing the
+ codebase. Reports are available
+ [online](https://oss-fuzz.com/v2/testcases?project=systemd).
+
+12. Our tree includes `.editorconfig`, `.dir-locals.el` and `.vimrc` files, to
+ ensure that editors follow the right indentiation styles automatically.
+
+13. When building systemd from a git checkout the build scripts will
+ automatically enable a git commit hook that ensures whitespace cleanliness.
+
+14. [LGTM](https://lgtm.com/) analyzes every commit pushed to master. The list
+ of active alerts can be found at
+ https://lgtm.com/projects/g/systemd/systemd/alerts/?mode=list.
+
+Access to Coverity and oss-fuzz reports is limited. Please reach out to the
+maintainers if you need access.