diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..f716a6650b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +--- +Checks: ' + -*, + misc-header-include-cycle +' +WarningsAsErrors: '*' +HeaderFileExtensions: + - h +ImplementationFileExtensions: + - c +... diff --git a/.clang-tidy-ignore b/.clang-tidy-ignore new file mode 100644 index 0000000000..6e0889f080 --- /dev/null +++ b/.clang-tidy-ignore @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +man/* +# These contain external headers that we don't want to check. +src/basic/include/* +# clang-tidy can't parse BPF source files. +src/core/bpf/* +src/network/bpf/* +src/nsresourced/bpf/* +# The glib headers contain cyclic dependencies and clang-tidy +# can't distinguish between our code and glib headers so we +# exclude this test. +src/libsystemd/sd-bus/test-bus-marshal.c diff --git a/.clangd b/.clangd new file mode 100644 index 0000000000..8cc437ab81 --- /dev/null +++ b/.clangd @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +Diagnostics: + UnusedIncludes: None diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0907e4358b..65a121306a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -36,29 +36,46 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_GITHUB_ACTIONS: true + - uses: systemd/mkosi@dbb4020beee2cdf250f93a425794f1cf8b0fe693 + - name: Check that tabs are not used in Python code run: sh -c '! git grep -P "\\t" -- src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py' - - name: Install ruff and mypy + - name: Build tools tree run: | - python3 -m pip install --break-system-packages --upgrade setuptools wheel pip - python3 -m pip install --break-system-packages mypy types-Pillow ruff + tee mkosi/mkosi.local.conf <